1274 changed files with 176935 additions and 3295 deletions
@ -1,16 +1,4 @@ |
|||||
###################################################################### |
/.gitignore |
||||
# Build Tools |
/node_modules |
||||
|
|
||||
/unpackage/* |
|
||||
/node_modules/* |
|
||||
|
|
||||
###################################################################### |
|
||||
# Development Tools |
|
||||
|
|
||||
/.idea/* |
|
||||
/.vscode/* |
|
||||
/.hbuilderx/* |
|
||||
|
|
||||
package-lock.json |
|
||||
yarn.lock |
|
||||
|
|
||||
|
/unpackage |
||||
|
@ -0,0 +1,16 @@ |
|||||
|
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ |
||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 |
||||
|
"version": "0.0", |
||||
|
"configurations": [{ |
||||
|
"app-plus" : |
||||
|
{ |
||||
|
"launchtype" : "local" |
||||
|
}, |
||||
|
"default" : |
||||
|
{ |
||||
|
"launchtype" : "local" |
||||
|
}, |
||||
|
"type" : "uniCloud" |
||||
|
} |
||||
|
] |
||||
|
} |
@ -1,34 +1,37 @@ |
|||||
<script> |
<script> |
||||
import config from './config' |
export default { |
||||
import store from '@/store' |
onLaunch: function(option) { |
||||
import { getAccessToken } from '@/utils/auth' |
console.log('App Launch') |
||||
|
}, |
||||
export default { |
onShow: function() { |
||||
onLaunch: function() { |
// setInterval(function(){ |
||||
this.initApp() |
// uni.hideKeyboard() |
||||
}, |
// },60) |
||||
methods: { |
// console.log('App Show') |
||||
// 初始化应用 |
}, |
||||
initApp() { |
onHide: function() { |
||||
// 初始化应用配置 |
// console.log('App Hide') |
||||
this.initConfig() |
} |
||||
// 检查用户登录状态 |
} |
||||
//#ifdef H5 |
|
||||
this.checkLogin() |
|
||||
//#endif |
|
||||
}, |
|
||||
initConfig() { |
|
||||
this.globalData.config = config |
|
||||
}, |
|
||||
checkLogin() { |
|
||||
if (!getAccessToken()) { |
|
||||
this.$tab.reLaunch('/pages/login') |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss"> |
<style lang="scss"> |
||||
@import '@/static/scss/index.scss' |
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */ |
||||
|
/*每个页面公共css */ |
||||
|
@import "./uni_modules/vk-uview-ui/index.scss"; |
||||
|
// @import './common/PDA_style.css'; |
||||
|
@import './common/style/new_style.css'; |
||||
|
@import "./static/icon/iconfont.css"; |
||||
|
@import './common/style/uni.css'; |
||||
|
@import './common/style/pdabasic.css'; |
||||
|
@import './uni.scss'; |
||||
|
@import '@/static/scss/index.scss'; |
||||
|
|
||||
|
body{ |
||||
|
background-color: #EBEEF0; |
||||
|
} |
||||
|
|
||||
|
.content{ |
||||
|
background-color:#fff |
||||
|
} |
||||
</style> |
</style> |
||||
|
@ -0,0 +1,129 @@ |
|||||
|
# hello-uniapp |
||||
|
|
||||
|
`uni-app`框架示例,一套代码,同时发行到iOS、Android、H5、小程序等多个平台,请使用手机在下方扫码快速体验`uni-app`的强大功能。[官方文档](https://uniapp.dcloud.net.cn/) |
||||
|
|
||||
|
## 快速上手 |
||||
|
hello-uniapp 示例工程可以通过两种方式创建, 一种是 HBuilderX, 配套 IDE,集成开发;另一种是 CLI 创建;推荐前者。 |
||||
|
### 通过 HBuilderX 可视化界面创建(推荐) |
||||
|
|
||||
|
可视化的方式比较简单,HBuilderX内置相关环境,开箱即用,无需配置nodejs。 |
||||
|
|
||||
|
开始之前,开发者需先下载安装如下工具: |
||||
|
|
||||
|
- HBuilderX:[官方IDE下载地址](https://www.dcloud.io/hbuilderx.html) |
||||
|
|
||||
|
HBuilderX是通用的前端开发工具,但为`uni-app`做了特别强化,请下载App开发版。 |
||||
|
|
||||
|
由于截图在 github 不便浏览,参见官方文档 [HBuilderX 可视化界面创建](https://uniapp.dcloud.net.cn/quickstart?id=_1-%e9%80%9a%e8%bf%87-hbuilderx-%e5%8f%af%e8%a7%86%e5%8c%96%e7%95%8c%e9%9d%a2) |
||||
|
|
||||
|
### 通过 vue-cli 创建 |
||||
|
|
||||
|
``` |
||||
|
npm install -g @vue/cli |
||||
|
``` |
||||
|
|
||||
|
#### 创建uni-app |
||||
|
|
||||
|
**使用正式版**(对应HBuilderX最新正式版) |
||||
|
|
||||
|
``` |
||||
|
vue create -p dcloudio/uni-preset-vue my-project |
||||
|
``` |
||||
|
|
||||
|
**使用alpha版**(对应HBuilderX最新alpha版) |
||||
|
|
||||
|
``` |
||||
|
vue create -p dcloudio/uni-preset-vue#alpha my-alpha-project |
||||
|
``` |
||||
|
|
||||
|
此时,会提示选择项目模板,选择 `hello uni-app` 项目模板,如下所示: |
||||
|
|
||||
|
<div> |
||||
|
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/h5-cli-01.png" width="300"> |
||||
|
</div> |
||||
|
|
||||
|
创建好后,进入项目目录 |
||||
|
``` |
||||
|
cd my-project |
||||
|
``` |
||||
|
|
||||
|
执行该命令运行到 h5 端 |
||||
|
``` |
||||
|
npm run dev:h5 |
||||
|
``` |
||||
|
|
||||
|
欢迎提 issues,推荐到[官方社区](https://ask.dcloud.net.cn/explore/)提问。 |
||||
|
|
||||
|
## 扫码体验 |
||||
|
|
||||
|
<div class="quick"> |
||||
|
<p>一套代码编到10个平台,这不是梦想。眼见为实,扫描10个二维码,亲自体验最全面的跨平台效果!</p> |
||||
|
<div style="display: flex;"> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/ba7d0750-517d-11eb-bdc1-8bd33eb6adaa.png" width="160" /> |
||||
|
</div> |
||||
|
<b>Android版</b> |
||||
|
</a> |
||||
|
<a href="https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/bb3ef7c0-517d-11eb-bdc1-8bd33eb6adaa.png" width="160" /> |
||||
|
</div> |
||||
|
<b>iOS版</b> |
||||
|
</a> |
||||
|
<a href="https://hellouniapp.dcloud.net.cn/" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/bb3ef7c0-517d-11eb-bdc1-8bd33eb6adaa.png" width="160" /> |
||||
|
</div> |
||||
|
<b>H5版</b> |
||||
|
</a> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"><img src="//img.cdn.aliyun.dcloud.net.cn/guide/uniapp/gh_33446d7f7a26_430.jpg" width="160" /></div> |
||||
|
<b>微信小程序版</b> |
||||
|
</a> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"><img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b131e0d0-517d-11eb-a16f-5b3e54966275.png" width="160" /></div> |
||||
|
<b>支付宝小程序版</b> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="flex-img-group-view" style="margin-top: 20px;"> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"><img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b204e840-517d-11eb-8ff1-d5dcf8779628.png" width="160" /></div> |
||||
|
<b>百度小程序版</b> |
||||
|
</a> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/mp-toutiao.png" width="160" /> |
||||
|
</div> |
||||
|
<b>字节跳动小程序版</b> |
||||
|
</a> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-qq.png" width="160" /> |
||||
|
</div> |
||||
|
<b>QQ小程序版</b> |
||||
|
</a> |
||||
|
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-qa-union.png" width="160" /> |
||||
|
</div> |
||||
|
<b>快应用</b> |
||||
|
</a> |
||||
|
<a href="https://so.mp.360.cn/mp.html?appid=qh4j181qqtru354st6" target="_blank" class="clear-style barcode-view"> |
||||
|
<div class="barcode-img-box"> |
||||
|
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-mp-360-qr.png" width="160" /> |
||||
|
</div> |
||||
|
<b>360小程序</b> |
||||
|
</a> |
||||
|
</div> |
||||
|
<p> |
||||
|
<em>注:某些平台不能提交简单demo,故补充了一些其他功能;hello uni-app示例代码可从[github](https://github.com/dcloudio/hello-uniapp)获取</em></br> |
||||
|
<em>快应用仅支持 vivo 、oppo、华为</em></br> |
||||
|
<em>360小程序仅 windows平台支持,需要在360浏览器中打开</em></br> |
||||
|
</p> |
||||
|
</div> |
||||
|
|
||||
|
`uni-app`官网文档详见[https://uniapp.dcloud.io](https://uniapp.dcloud.io) |
||||
|
|
||||
|
更多uni-app的模板、示例详见[插件市场](https://ext.dcloud.net.cn/) |
||||
|
|
@ -0,0 +1,40 @@ |
|||||
|
|
||||
|
function service(options = {}) { |
||||
|
let contentType = localStorage.token_type ? "application/json" : "application/x-www-form-urlencoded"; |
||||
|
// contentType ="application/x-www-form-urlencoded";
|
||||
|
contentType ="application/json"; |
||||
|
// localStorage.setItem('token', "4810b80d-f047-4915-821d-d2baf661bb91")
|
||||
|
let token = localStorage.getItem("token") |
||||
|
options.header = { |
||||
|
"content-type": contentType, |
||||
|
"Authorization": "Bearer "+token |
||||
|
// 'withCredentials': true,
|
||||
|
// 'Blade-Auth':'bearer '+store.state.token,
|
||||
|
// 'token_type': localStorage.token_type
|
||||
|
}; |
||||
|
return new Promise((resolve, reject) => { |
||||
|
options.success = (res) => { |
||||
|
if (res ) { |
||||
|
if(res.statusCode == 200){ |
||||
|
if(res.data.code==0){ |
||||
|
resolve(res.data); |
||||
|
}else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
|
||||
|
}else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
|
||||
|
} else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
}; |
||||
|
options.fail = (err) => { |
||||
|
reject(err); |
||||
|
}; |
||||
|
uni.request(options); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default service; |
@ -0,0 +1,108 @@ |
|||||
|
import store from '@/store' |
||||
|
// import config from '@/config'
|
||||
|
import errorCode from '@/common/utils/errorCode' |
||||
|
import { toast, showConfirm, tansParams } from '@/common/utils/common' |
||||
|
import storage from '@/common/utils/storage' |
||||
|
|
||||
|
let timeout = 10000 |
||||
|
// const baseUrl = config.baseUrl + config.baseApi;
|
||||
|
|
||||
|
const request = config => { |
||||
|
let requestUrl=""; |
||||
|
if(getApp()!=undefined){ |
||||
|
requestUrl = getApp().globalData.request_url |
||||
|
} |
||||
|
// 是否需要设置 token
|
||||
|
const isToken = (config.headers || {}).isToken === false |
||||
|
config.header = config.header || {} |
||||
|
if (storage.getStorage(storage.constant.token) && !isToken) { |
||||
|
config.header['Authorization'] = 'Bearer ' + storage.getStorage(storage.constant.token) |
||||
|
} |
||||
|
// 设置租户 TODO 芋艿:强制 1 先
|
||||
|
// config.header['tenant-id'] = storage.getStorage(storage.constant.tenantId);
|
||||
|
config.header['tenant-id'] = getApp().globalData.tenantId |
||||
|
// get请求映射params参数
|
||||
|
if (config.params) { |
||||
|
let url = config.url + '?' + tansParams(config.params) |
||||
|
url = url.slice(0, -1) |
||||
|
config.url = url |
||||
|
} |
||||
|
return new Promise((resolve, reject) => { |
||||
|
uni.request({ |
||||
|
method: config.method || 'get', |
||||
|
timeout: config.timeout || timeout, |
||||
|
// url: config.baseUrl || baseUrl + config.url,
|
||||
|
url:requestUrl+ config.url, |
||||
|
data: config.data, |
||||
|
header: config.header, |
||||
|
dataType: 'json' |
||||
|
}).then(response => { |
||||
|
const res=response |
||||
|
var statusCode =response.statusCode |
||||
|
//请求成功
|
||||
|
if(statusCode==200){ |
||||
|
if(res.data.code==401||res.data.code==500){ |
||||
|
reject(res.data.msg) |
||||
|
}else { |
||||
|
resolve(res.data) |
||||
|
} |
||||
|
|
||||
|
}else if(statusCode==404){ |
||||
|
//请求失败
|
||||
|
if(res.data.error){ |
||||
|
reject(res.data.error) |
||||
|
}else { |
||||
|
reject(res.errMsg) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// const code = res.data.code || 200
|
||||
|
// const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
|
|
||||
|
// if(code==200){
|
||||
|
// if(res.data.status==404){
|
||||
|
// // toast(msg)
|
||||
|
// reject("404")
|
||||
|
// }else {}
|
||||
|
// }
|
||||
|
|
||||
|
// if (code === 401) {
|
||||
|
// showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||
|
// if (res.confirm) {
|
||||
|
// store.dispatch('LogOut').then(res => {
|
||||
|
// uni.reLaunch({ url: '/pages/login' })
|
||||
|
// })
|
||||
|
// }
|
||||
|
// })
|
||||
|
// reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
|
// } else if (code === 500) {
|
||||
|
// toast(msg)
|
||||
|
// reject('500')
|
||||
|
// } else if (code !== 200) {
|
||||
|
// toast(msg)
|
||||
|
// reject(code)
|
||||
|
// }else if(code == 200){
|
||||
|
// if(res.data.status==404){
|
||||
|
// // toast(msg)
|
||||
|
// reject("404")
|
||||
|
// return;
|
||||
|
// }
|
||||
|
// resolve(res.data)
|
||||
|
// }
|
||||
|
}) |
||||
|
.catch(error => { |
||||
|
var message = error.errMsg |
||||
|
if (message === 'Network Error') { |
||||
|
message = '后端接口连接异常' |
||||
|
} else if (message.includes('timeout')) { |
||||
|
message = '系统接口请求超时' |
||||
|
} else if (message.includes('Request failed with status code')) { |
||||
|
message = '系统接口' + message.substr(message.length - 3) + '异常' |
||||
|
} |
||||
|
toast(message) |
||||
|
reject(error) |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default request |
File diff suppressed because it is too large
@ -1,34 +0,0 @@ |
|||||
import request from '@/utils/request' |
|
||||
|
|
||||
// 登录方法
|
|
||||
export function login(username, password, captchaVerification) { |
|
||||
const data = { |
|
||||
username, |
|
||||
password, |
|
||||
captchaVerification |
|
||||
} |
|
||||
return request({ |
|
||||
url: '/system/auth/login', |
|
||||
headers: { |
|
||||
isToken: false |
|
||||
}, |
|
||||
'method': 'POST', |
|
||||
'data': data |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 获取用户详细信息
|
|
||||
export function getInfo() { |
|
||||
return request({ |
|
||||
url: '/system/auth/get-permission-info', |
|
||||
'method': 'GET' |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 退出方法
|
|
||||
export function logout() { |
|
||||
return request({ |
|
||||
url: '/system/auth/logout', |
|
||||
'method': 'POST' |
|
||||
}) |
|
||||
} |
|
@ -0,0 +1,957 @@ |
|||||
|
import request from '@/api/httpRequest.js' |
||||
|
|
||||
|
// let devUrl = "http://dev.ccwin-in.com:59096"
|
||||
|
let devUrl = getApp().globalData.dev_url; |
||||
|
devUrl = "http://dev.ccwin-in.com:23132" |
||||
|
|
||||
|
|
||||
|
export function test(params) { |
||||
|
return request({ |
||||
|
url: "http://www.baidu.com", |
||||
|
method: "get", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function login(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/system/login", |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function logOut() { |
||||
|
return request({ |
||||
|
url: devUrl + "/system/logout", |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function authorize() { |
||||
|
return request({ |
||||
|
url: devUrl + "/system/authorize/permissions", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function getUserInfo() { |
||||
|
return request({ |
||||
|
url: devUrl + "/organization/user/current/info", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*获取业务类型} |
||||
|
* locationCode 获取配置字典 |
||||
|
*/ |
||||
|
export function getBusinesstypeList(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getBusinesstypeList", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* Number 按托码查询库存 |
||||
|
*/ |
||||
|
export function getBalanceByContainer(Number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/query/getBalanceByContainer?Number=" + Number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* Number 按托码查询托码明细 |
||||
|
*/ |
||||
|
export function getContainerDetailByNumber(Number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/query/getContainerDetailByNumber?Number=" + Number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*器具代码} |
||||
|
* ContainerNumber 按器具查询库存明细 |
||||
|
*/ |
||||
|
export function getBalanceByContainerNumberGroup(ContainerNumber) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/query/getBalanceByContainerNumberGroup?ContainerNumber=" + |
||||
|
ContainerNumber, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} itemcode |
||||
|
* 按数量管理查询库存 |
||||
|
*/ |
||||
|
export function getBalanceByItemCode(itemcode) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/query/getBalanceByItemCode?itemcode=" + itemcode, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} itemCode |
||||
|
* 按物品查询库存汇总 |
||||
|
*/ |
||||
|
export function getBalanceByCodeGroup(itemCode) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/query/getBalanceByCodeGroup?itemCode=" + itemCode, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 按物品查询库存明细 |
||||
|
* @param {*} itemCode |
||||
|
* |
||||
|
*/ |
||||
|
export function getBalanceByCode(itemCode) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/query/getBalanceByCode?itemCode=" + itemCode, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} code 物品代码 |
||||
|
* 查询管理精度按库位查询接口未完成 |
||||
|
*/ |
||||
|
export function getProductionlineByItemcode_copy_copy(code) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getProductionlineByItemcode_copy_copy?code=" + code, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} code 物品代码 |
||||
|
* 查询管理精度按物品查询接口未完成 |
||||
|
*/ |
||||
|
export function getProductionlineByItemcode_copy_copy_copy(code) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getProductionlineByItemcode_copy_copy_copy?code=" + code, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} code 生产线代码 |
||||
|
* 查询生产线信息接口 |
||||
|
*/ |
||||
|
export function getProductionlineByItemcode_copy(code) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getProductionlineByItemcode_copy?code=" + code, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} number 器具代码 |
||||
|
* 根据器具查询包装信息(无器具号) |
||||
|
*/ |
||||
|
// export function getBalanceByContainer(number) {
|
||||
|
// return request({
|
||||
|
// url: devUrl + "/magic-api/pda/basic/getBalanceByContainer?number=" + number,
|
||||
|
// method: "get",
|
||||
|
// data: {},
|
||||
|
// });
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} number ASN编号 |
||||
|
* 按ASN查询任务接口 |
||||
|
*/ |
||||
|
export function getPurchaseReturnByAsnNumber(asnNumber) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereturn/getJobByAsnNumber?asnNumber=" + asnNumber, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 承接任务 |
||||
|
* jobStatusId:任务id |
||||
|
jobStatusTableName:任务主表表名 |
||||
|
jobStatusTableNameDetail:任务子表表名 |
||||
|
jobStatusSchemaCode:工作流模板编号 |
||||
|
jobStatusStatusType:状态类型 1 取消承接 2 承接 3 执行 |
||||
|
*/ |
||||
|
export function takeJob(params) { |
||||
|
|
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/public/jobStatusUpdate?jobStatusId=" |
||||
|
+params.jobStatusId |
||||
|
+"&jobStatusTableName="+params.jobStatusTableName |
||||
|
+"&jobStatusTableNameDetail="+params.jobStatusTableNameDetail |
||||
|
+"&jobStatusSchemaCode="+params.jobStatusSchemaCode |
||||
|
+"&jobStatusStatusType="+2, |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 取消承接任务 |
||||
|
* jobStatusId:任务id |
||||
|
jobStatusTableName:任务主表表名 |
||||
|
jobStatusTableNameDetail:任务子表表名 |
||||
|
jobStatusSchemaCode:工作流模板编号 |
||||
|
jobStatusStatusType:状态类型 1 取消承接 2 承接 3 执行 |
||||
|
*/ |
||||
|
export function cancelTakeJob(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/public/jobStatusUpdate?jobStatusId=" |
||||
|
+params.jobStatusId |
||||
|
+"&jobStatusTableName="+params.jobStatusTableName |
||||
|
+"&jobStatusTableNameDetail="+params.jobStatusTableNameDetail |
||||
|
+"&jobStatusSchemaCode="+params.jobStatusSchemaCode |
||||
|
+"&jobStatusStatusType="+1, |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} id 任务id |
||||
|
* 暂存任务 |
||||
|
*/ |
||||
|
export function jobStatusToTemporary(id) { |
||||
|
return request({ |
||||
|
url: devUrl + `/magic-api/pda/job/purchasereceipt/jobStatusToTemporary${id}`, |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} id 任务id |
||||
|
* 获取任务明细暂存 |
||||
|
* {masterID,page,size |
||||
|
} |
||||
|
*/ |
||||
|
export function getJobDetailStaging(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereceipt/getJobDetailStaging", |
||||
|
method: "get", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**采购收货 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getPurchaseReceiptJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereceipt/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} number ASN编号 |
||||
|
* 按ASN查询任务接口 |
||||
|
*/ |
||||
|
export function getPurchasereceiptByAsnNumber(asnNumber) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereceipt/getJobByAsnNumber?asnNumber=" + asnNumber, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取任务总数量 |
||||
|
*/ |
||||
|
export function purchasereceiptGetJobCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereceipt/getJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取新增任务数量 |
||||
|
*/ |
||||
|
export function purchasereceiptNewJobCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereceipt/getNewJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 到货检验任务 提交 |
||||
|
* @param {*} params |
||||
|
*/ |
||||
|
export function submitInspectJob(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereturn/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} packingNumber |
||||
|
* 按唯一码管理查询库存 |
||||
|
*/ |
||||
|
export function getBalanceByUniquecode(packingNumber) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getBalanceByUniquecode?packingNumber=" + packingNumber, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} requestTime Creatorld |
||||
|
* 发料任务筛选接口 |
||||
|
*/ |
||||
|
export function getIssueJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/issue/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} 任务id |
||||
|
* 提交任务 |
||||
|
*/ |
||||
|
export function issueJobSubmit(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/issue/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
export function getPurchaseReturnJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/purchasereturn/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 采购退货 申请列表 |
||||
|
* @param {*} |
||||
|
* 任务状态 |
||||
|
* CreationTimeStart 开始日期 |
||||
|
* CreationTimeEnd 结束日期 |
||||
|
* 获取日期任务列表 |
||||
|
*/ |
||||
|
export function getPurchaseReturnRequestList(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/request/purchasereturn/getRequestList", |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 原料上架 |
||||
|
* @param {*} |
||||
|
* status 任务状态 |
||||
|
* CreationTimeStart 开始日期 |
||||
|
* CreationTimeEnd 结束日期 |
||||
|
* 获取日期任务列表 |
||||
|
*/ |
||||
|
export function getPutawayJobList(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/putaway/getJobList", |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} id 任务id |
||||
|
* 原料上架获取任务明细 |
||||
|
*/ |
||||
|
export function putawayGetJobDetail(id) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/putaway/getJobDetail?id=" + id, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/**原料上架 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getPutawayJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/putaway/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**生产收料 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getProductionReceiptJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productionreceipt/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**生产退料 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getProductionreturnJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productionreturn/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**盘点 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getJobCountByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/count/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} id 任务id |
||||
|
* 制品收货 承接任务 |
||||
|
*/ |
||||
|
export function takeProductReceiptJob(id) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/jobStatusToDoing?id=" + id, |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} id 任务id |
||||
|
* 制品收货 取消承接任务 |
||||
|
*/ |
||||
|
export function cancelTakeProductReceiptJob(id) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/jobStatusToOpen?id=" + id, |
||||
|
method: "post", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/**制品收货 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getProductReceipJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} 任务id |
||||
|
* 提交制品收货 |
||||
|
*/ |
||||
|
export function submitProductReceiptJob(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取任务总数量 |
||||
|
*/ |
||||
|
export function getProductReceiptJobCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/getJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取新增任务数量 |
||||
|
*/ |
||||
|
export function getProductReceiptJobNewCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productreceipt/getNewJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/**制品收货 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getProductPutawayJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productputaway/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} 任务id |
||||
|
* 提交制品收货 |
||||
|
*/ |
||||
|
export function submitProductPutawayJob(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productputaway/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取任务总数量 |
||||
|
*/ |
||||
|
export function getProductPutawayJobCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productputaway/getJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*} |
||||
|
* 获取新增任务数量 |
||||
|
*/ |
||||
|
export function getProductPutawayJobNewCount() { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/productputaway/getNewJobCount", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {*按编号查询生产线} |
||||
|
* |
||||
|
*/ |
||||
|
export function getProductionlineByCode(param) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/basic/getProductionlineByCode", |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**计划外入库 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getJobUnPlannedReceiptByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/unplannedreceipt/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**计划外出库 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getJobUnPlannedIssueByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/unPlannedIssue/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**库存转移 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getInventoryMoveJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/inventorymove/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**制品发货 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getDeliverJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/deliver/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
/** |
||||
|
* 制品发货提交 |
||||
|
* @param {*} params |
||||
|
*/ |
||||
|
export function deliverJobSubmit(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/deliver/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**客户退货 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getCustomerReturnJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/customerreturn/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
/** |
||||
|
* 客户退货提交 |
||||
|
* @param {*} params |
||||
|
*/ |
||||
|
export function customerReturnSubmit(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/customerreturn/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**调拨入库 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getTransferReceiptJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/transferreceipt/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
/** |
||||
|
* 调拨入库提交 |
||||
|
* @param {*} params |
||||
|
*/ |
||||
|
export function transferReceiptSubmit(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/transferreceipt/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/**调拨出库 |
||||
|
* |
||||
|
* @param {*} number 任务编号 |
||||
|
* 按任务编号查询任务 |
||||
|
*/ |
||||
|
export function getTransferIssueJobByNumber(number) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/transferissue/getJobByNumber?Number=" + number, |
||||
|
method: "get", |
||||
|
data: {}, |
||||
|
}); |
||||
|
} |
||||
|
/** |
||||
|
* 调拨出库提交 |
||||
|
* @param {*} params |
||||
|
*/ |
||||
|
export function transferIssueSubmit(id, params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/magic-api/pda/job/transferissue/jobSubmit?id=" + id, |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
File diff suppressed because it is too large
@ -1,42 +0,0 @@ |
|||||
import upload from '@/utils/upload' |
|
||||
import request from '@/utils/request' |
|
||||
|
|
||||
// 用户密码重置
|
|
||||
export function updateUserPwd(oldPassword, newPassword) { |
|
||||
const data = { |
|
||||
oldPassword, |
|
||||
newPassword |
|
||||
} |
|
||||
return request({ |
|
||||
url: '/system/user/profile/update-password', |
|
||||
method: 'PUT', |
|
||||
params: data |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 查询用户个人信息
|
|
||||
export function getUserProfile() { |
|
||||
return request({ |
|
||||
url: '/system/user/profile/get', |
|
||||
method: 'GET' |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 修改用户个人信息
|
|
||||
export function updateUserProfile(data) { |
|
||||
return request({ |
|
||||
url: '/system/user/profile/update', |
|
||||
method: 'PUT', |
|
||||
data: data |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
// 用户头像上传
|
|
||||
export function uploadAvatar(data) { |
|
||||
return upload({ |
|
||||
url: '/system/user/profile/update-avatar', |
|
||||
method: 'PUT', |
|
||||
name: data.name, |
|
||||
filePath: data.filePath |
|
||||
}) |
|
||||
} |
|
@ -0,0 +1,22 @@ |
|||||
|
// import request from '@/common/request.js'
|
||||
|
// import promise from '@/common/promise.js'
|
||||
|
import request from '@/common/request_test.js' |
||||
|
// let devUrl = this.$dev_url;
|
||||
|
|
||||
|
let devUrl = "http://dev.ccwin-in.com:59096" |
||||
|
export function getlogin(params) { |
||||
|
return request({ |
||||
|
url: devUrl + "/api/pda/account/login", |
||||
|
method: "post", |
||||
|
data: params, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
//修改用户密码
|
||||
|
export function changePassword(params) { //
|
||||
|
return request({ |
||||
|
url:devUrl + "/api/pda/account/change-password",//
|
||||
|
data: params, |
||||
|
method: "post" |
||||
|
}) |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
// // import request from '@/common/request.js'
|
||||
|
// // import promise from '@/common/promise.js'
|
||||
|
// import request from '@/common/request_test.js'
|
||||
|
// // let devUrl = this.$dev_url;
|
||||
|
|
||||
|
// let devUrl = "http://dev.ccwin-in.com:59096"
|
||||
|
// export function getlogin(params) {
|
||||
|
// return request({
|
||||
|
// url: devUrl + "/api/pda/account/login",
|
||||
|
// method: "post",
|
||||
|
// data: params,
|
||||
|
// });
|
||||
|
// }
|
||||
|
|
||||
|
// //修改用户密码
|
||||
|
// export function changePassword(params) { //
|
||||
|
// return request({
|
||||
|
// url:devUrl + "/api/pda/account/change-password",//
|
||||
|
// data: params,
|
||||
|
// method: "post"
|
||||
|
// })
|
||||
|
// }
|
@ -0,0 +1,171 @@ |
|||||
|
## 3.4.4(2022-07-25) |
||||
|
- 新增 同步 uni-ui@1.4.20 |
||||
|
- uni-forms 【重要】组件逻辑重构,部分用法旧版本不兼容,请注意兼容问题 |
||||
|
- uni-section 新增组件 |
||||
|
## 3.4.3(2022-07-14) |
||||
|
- 修复 HBuilderX 拉取 hello uni-app 项目直接运行提示无服务空间关联的bug |
||||
|
## 3.4.2(2022-07-06) |
||||
|
- 新增 同步 uni-ui@1.4.18 |
||||
|
- uni-forms 【重要】组件逻辑重构,部分用法旧版本不兼容,请注意兼容问题 |
||||
|
- uni-forms 【重要】组件使用 Provide/Inject 方式注入依赖,提供了自定义表单组件调用 uni-forms 校验表单的能力 |
||||
|
- uni-forms 新增 更多表单示例 |
||||
|
- uni-forms 新增 model 属性,等同于原 value/modelValue 属性,旧属性即将废弃 |
||||
|
- uni-forms 新增 validateTrigger 属性的 blur 值,仅 uni-easyinput 生效 |
||||
|
- uni-forms 新增 onFieldChange 方法,可以对子表单进行校验,可替代binddata方法 |
||||
|
- uni-forms 新增 子表单的 setRules 方法,配合自定义校验函数使用 |
||||
|
- uni-forms 新增 uni-forms-item 的 setRules 方法,配置动态表单使用可动态更新校验规则 |
||||
|
- uni-forms 修复 由 1.4.0 引发的 label 插槽不生效的bug |
||||
|
- uni-forms 修复 子组件找不到 setValue 报错的bug |
||||
|
- uni-forms 修复 uni-data-picker 在 uni-forms-item 中报错的bug |
||||
|
- uni-forms 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug |
||||
|
- uni-forms 修复 表单校验顺序无序问题 |
||||
|
- uni-forms 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式 |
||||
|
- uni-forms 优化 动态表单校验方式,废弃拼接name的方式 |
||||
|
- uni-breadcrumb 修复 微信小程序 separator 不显示问题 |
||||
|
- uni-data-checkbox 优化 在 uni-forms 中的依赖注入方式 |
||||
|
- uni-data-picker 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug |
||||
|
- uni-data-picker 优化 显示样式 |
||||
|
- uni-data-select 优化 显示样式 |
||||
|
- uni-datetime-picker 修复 日历顶部年月及底部确认未国际化 bug |
||||
|
- uni-datetime-picker 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致 |
||||
|
- uni-easyinput 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容 |
||||
|
- uni-easyinput 新增 clear 事件,点击右侧叉号图标触发 |
||||
|
- uni-easyinput 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发 |
||||
|
- uni-easyinput 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等 |
||||
|
- uni-easyinput 优化 clearable 显示策略 |
||||
|
- uni-file-picker 修复 在uni-forms下样式不生效的bug |
||||
|
- uni-nav-bar 修复 组件示例中插槽用法无法显示内容的bug |
||||
|
- uni-swipe-action 修复 vue3 下使用组件不能正常运行的Bug |
||||
|
- uni-swipe-action 修复 h5端点击click触发两次的Bug |
||||
|
- uni-table 修复 微信小程序存在无使用组件的问题 |
||||
|
## 3.4.1(2022-06-30) |
||||
|
- 新增 支持 ios 安全区 |
||||
|
## 3.3.8(2022-05-08) |
||||
|
- 新增 同步 uni-ui@1.4.15 |
||||
|
- uni-data-picker 修复 字节小程序 本地数据无法选择下一级的Bug |
||||
|
- uni-data-select 新增 记住上次的选项(仅 collection 存在时有效) |
||||
|
- uni-search-bar 修复 vue3 input 事件不生效的bug |
||||
|
- uni-search-bar 修复 多余代码导致的bug |
||||
|
- uni-tooltip 更新 text 属性变更为 content |
||||
|
- uni-tooltip 更新 移除 width 属性 |
||||
|
- uni-tooltip 修复 组件根 text 嵌套组件 warning |
||||
|
## 3.3.7(2022-04-06) |
||||
|
- 新增 更新扩展组件 uni-nav-bar、uni-list 的展示页面 |
||||
|
## 3.3.6(2022-03-31) |
||||
|
- 更新 uni-ui 组件及示例 |
||||
|
## 3.3.5(2022-03-30) |
||||
|
- 修复 插槽兼容 vue3, slot -> v-slot |
||||
|
- 新增 更新 uni-ui |
||||
|
## 3.3.4(2022-02-25) |
||||
|
- 修复 编译到 App 平台的控制台报错 |
||||
|
## 3.3.3(2022-02-23) |
||||
|
- 修复 模板城市选择 vue3 报错的bug |
||||
|
- 修复 删除 map.nvue 中多余的 enableOverlooking 变量 |
||||
|
- 修复 swipe-dot.nvue 中条件编译媒体查询 |
||||
|
## 3.3.2(2022-01-26) |
||||
|
- 修复 默认运行到 vue2 |
||||
|
## 3.3.1(2022-01-26) |
||||
|
- 新增 同步 uni-ui@1.4.11 |
||||
|
- uni-collapse 修复 微信小程序resize后组件收起的bug |
||||
|
- uni-countdown 修复 在微信小程序中样式不生效的bug |
||||
|
- uni-countdown 新增 update 方法 ,在动态更新时间后,刷新组件 |
||||
|
- uni-load-more 新增 showText属性 ,是否显示文本 |
||||
|
- uni-load-more 修复 nvue 平台下不显示文本的bug |
||||
|
- uni-load-more 修复 微信小程序平台样式选择器报警告的问题 |
||||
|
- uni-nav-bar 修复 在vue下,标题不垂直居中的bug |
||||
|
- uni-nav-bar 修复 height 属性类型错误 |
||||
|
- uni-nav-bar 新增 height 属性,可修改组件高度 |
||||
|
- uni-nav-bar 新增 dark 属性可可开启暗黑模式 |
||||
|
- uni-nav-bar 优化 标题字数过多显示省略号 |
||||
|
- uni-nav-bar 优化 插槽,插入内容可完全覆盖 |
||||
|
- uni-popup 修复 isMaskClick 失效的bug |
||||
|
- uni-popup 新增 cancelText \ confirmText 属性 ,可自定义文本 |
||||
|
- uni-popup 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 |
||||
|
- uni-popup 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 |
||||
|
## 3.3.0(2022-01-04) |
||||
|
- 修复 开发时在 vue3 下由 pc 端切换到手机端,不能返回上一级页面的 bug |
||||
|
- 优化 去掉 pc 端 topwindow 右上角用于演示的 url 导航 |
||||
|
## 3.2.12(2021-12-20) |
||||
|
- 新增 适配京东小程序 |
||||
|
## 3.2.11(2021-12-07) |
||||
|
- 修复 uni-ui 在 hello-uniapp 中丢失图标、ui 受到公共样式影响等问题 |
||||
|
- 修复 微信登录取值报错的问题 |
||||
|
## 3.2.10(2021-11-30) |
||||
|
- 修复 map 组件示例不显示的 bug |
||||
|
## 3.2.9(2021-11-19) |
||||
|
- 新增 uni-ui 以 uni_modules 方式引入,方便开发者从 hello-uniapp 中 copy 组件及示例 |
||||
|
- 优化 uni-ui 示例页面,完善组件示例 |
||||
|
## 3.2.8(2021-11-10) |
||||
|
- 新增 适配飞书平台(lark) |
||||
|
## 3.2.7(2021-10-26) |
||||
|
- 修复 uni-popup 示例的 button 文字在 iPhone 5 上换行的 bug |
||||
|
- 修复 uni-table 示例,页面顶部距离不对的 bug |
||||
|
- 修复 GlobalData示例,在vue3是无效的 bug |
||||
|
- 优化 删除无用的 project.swan.json 文件 |
||||
|
## 3.2.6(2021-10-08) |
||||
|
- 由于体验问题,暂时撤销 uni-ui 以 uni_modules 方式引入的修改 |
||||
|
|
||||
|
## 3.2.4(2021-09-07) |
||||
|
- 修复 vue3 在 H5 编译报错的 bug |
||||
|
- 新增 同步 uni-ui |
||||
|
- 新增 uni-ui 组件支持国际化 i18n |
||||
|
- uni-data-checkbox 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题 |
||||
|
- uni-datetime-picker 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次 |
||||
|
- uni-datetime-picker 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法 |
||||
|
- uni-datetime-picker 优化 调整字号大小,美化日历界面 |
||||
|
- uni-datetime-picker 修复 因国际化导致的 placeholder 失效的 bug |
||||
|
- uni-file-picker 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug |
||||
|
- uni-file-picker 新增 参数中返回 fileID 字段 |
||||
|
- uni-file-picker 修复 腾讯云传入fileID 不能回显的bug |
||||
|
- uni-file-picker 修复 选择图片后,不能放大的问题 |
||||
|
- uni-link 修复 在 nvue 下不显示的 bug |
||||
|
- uni-list 修复 在vue3中to属性在发行应用的时候报错的bug |
||||
|
- uni-search-bar 修复 value 属性与 modelValue 属性不兼容的Bug |
||||
|
- uni-swipe-action 优化 close-all 方法 |
||||
|
- uni-collapse 优化 show-arrow 属性默认为true |
||||
|
- uni-collapse 新增 show-arrow 属性,控制是否显示右侧箭头 |
||||
|
- uni-data-checkbox 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题 |
||||
|
- uni-easyinput 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug |
||||
|
- uni-file-picker 修复 由于 0.2.11 版本引起的不能回显图片的Bug |
||||
|
- uni-file-picker 新增 clearFiles(index) 方法,可以手动删除指定文件 |
||||
|
- uni-file-picker 修复 v-model 值设为 null 报错的Bug |
||||
|
- uni-swipe-action 新增 close-all 方法,关闭所有已打开的组件 |
||||
|
- uni-swipe-action 新增 resize() 方法,在非微信小程序、h5、app-vue端出现不能滑动的问题的时候,重置组件 |
||||
|
- uni-swipe-action 修复 app 端偶尔出现类似 Page[x][-x,xx;-x,xx,x,x-x] 的问题 |
||||
|
- uni-swipe-action 优化 微信小程序、h5、app-vue 滑动逻辑,避免出现动态新增组件后不能滑动的问题 |
||||
|
|
||||
|
|
||||
|
## 3.2.3(2021-08-27) |
||||
|
- 优化 tabbar 页面移除 vuex 相关代码 |
||||
|
- 新增 适配 vue3 (app) |
||||
|
## 3.2.2(2021-08-10) |
||||
|
- 新增 适配快手小程序 |
||||
|
- 新增 同步 uni-ui |
||||
|
- uni-datetime-picker 新增 return-type 属性支持返回 date 日期对象 |
||||
|
- uni-file-picker 修复 fileExtname属性不指定值报错的Bug |
||||
|
- uni-file-picker 修复 在某种场景下图片不回显的Bug |
||||
|
- uni-link 支持自定义插槽 |
||||
|
- uni-calendar 修复 弹出层被 tabbar 遮盖 bug |
||||
|
- uni-dateformat 调整 默认时间不再是当前时间,而是显示'-'字符 |
||||
|
- uni-datetime-picker 新增 适配 vue3 |
||||
|
- uni-datetime-picker 新增 支持作为 uni-forms 子组件相关功能 |
||||
|
- uni-datetime-picker 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的 bug |
||||
|
- uni-datetime-picker 修复 type 属性动态赋值无效的 bug |
||||
|
- uni-datetime-picker 修复 ‘确认’按钮被 tabbar 遮盖 bug |
||||
|
- uni-datetime-picker 修复 组件未赋值时范围选左、右日历相同的 bug |
||||
|
- uni-datetime-picker 修复 范围选未正确显示当前值的 bug |
||||
|
- uni-datetime-picker 修复 h5 平台(移动端)报错 'cale' of undefined 的 bug |
||||
|
- uni-file-picker 修复 auto-upload 属性失效的Bug |
||||
|
## 3.2.1(2021-07-31) |
||||
|
- 新增 同步 uni-ui@1.3.8 |
||||
|
## 3.2.0(2021-07-30) |
||||
|
- 新增 同时兼容 vue2 & vue3 |
||||
|
## 3.1.20(2021-07-30) |
||||
|
- 新增 同时兼容 vue2 & vue3 |
||||
|
## 3.1.17(2021-05-26) |
||||
|
- 修复 3.1.16 依赖 sass 的问题 |
||||
|
- 条件编译 nuve 不支持 css 属性 |
||||
|
## 3.1.16(2021-05-26) |
||||
|
- 修复 uni-data-checkbox 不关联服务空间的情况下组件报错的 Bug |
||||
|
## 3.1.12(2021-05-07) |
||||
|
- hello-uniapp 发布插件市场 |
@ -0,0 +1,262 @@ |
|||||
|
export default { |
||||
|
"list": [{ |
||||
|
"letter": "A", |
||||
|
"data": [ |
||||
|
"阿克苏机场", |
||||
|
"阿拉山口机场", |
||||
|
"阿勒泰机场", |
||||
|
"阿里昆莎机场", |
||||
|
"安庆天柱山机场", |
||||
|
"澳门国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "B", |
||||
|
"data": [ |
||||
|
"保山机场", |
||||
|
"包头机场", |
||||
|
"北海福成机场", |
||||
|
"北京南苑机场", |
||||
|
"北京首都国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "C", |
||||
|
"data": [ |
||||
|
"长白山机场", |
||||
|
"长春龙嘉国际机场", |
||||
|
"常德桃花源机场", |
||||
|
"昌都邦达机场", |
||||
|
"长沙黄花国际机场", |
||||
|
"长治王村机场", |
||||
|
"常州奔牛机场", |
||||
|
"成都双流国际机场", |
||||
|
"赤峰机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "D", |
||||
|
"data": [ |
||||
|
"大理机场", |
||||
|
"大连周水子国际机场", |
||||
|
"大庆萨尔图机场", |
||||
|
"大同东王庄机场", |
||||
|
"达州河市机场", |
||||
|
"丹东浪头机场", |
||||
|
"德宏芒市机场", |
||||
|
"迪庆香格里拉机场", |
||||
|
"东营机场", |
||||
|
"敦煌机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "E", |
||||
|
"data": [ |
||||
|
"鄂尔多斯机场", |
||||
|
"恩施许家坪机场", |
||||
|
"二连浩特赛乌苏国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "F", |
||||
|
"data": [ |
||||
|
"阜阳西关机场", |
||||
|
"福州长乐国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "G", |
||||
|
"data": [ |
||||
|
"赣州黄金机场", |
||||
|
"格尔木机场", |
||||
|
"固原六盘山机场", |
||||
|
"广元盘龙机场", |
||||
|
"广州白云国际机场", |
||||
|
"桂林两江国际机场", |
||||
|
"贵阳龙洞堡国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "H", |
||||
|
"data": [ |
||||
|
"哈尔滨太平国际机场", |
||||
|
"哈密机场", |
||||
|
"海口美兰国际机场", |
||||
|
"海拉尔东山国际机场", |
||||
|
"邯郸机场", |
||||
|
"汉中机场", |
||||
|
"杭州萧山国际机场", |
||||
|
"合肥骆岗国际机场", |
||||
|
"和田机场", |
||||
|
"黑河机场", |
||||
|
"呼和浩特白塔国际机场", |
||||
|
"淮安涟水机场", |
||||
|
"黄山屯溪国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "I", |
||||
|
"data": [] |
||||
|
}, { |
||||
|
"letter": "J", |
||||
|
"data": [ |
||||
|
"济南遥墙国际机场", |
||||
|
"济宁曲阜机场", |
||||
|
"鸡西兴凯湖机场", |
||||
|
"佳木斯东郊机场", |
||||
|
"嘉峪关机场", |
||||
|
"锦州小岭子机场", |
||||
|
"景德镇机场", |
||||
|
"井冈山机场", |
||||
|
"九江庐山机场", |
||||
|
"九寨黄龙机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "K", |
||||
|
"data": [ |
||||
|
"喀什机场", |
||||
|
"克拉玛依机场", |
||||
|
"库车龟兹机场", |
||||
|
"库尔勒机场", |
||||
|
"昆明巫家坝国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "L", |
||||
|
"data": [ |
||||
|
"拉萨贡嘎机场", |
||||
|
"兰州中川机场", |
||||
|
"丽江三义机场", |
||||
|
"黎平机场", |
||||
|
"连云港白塔埠机场", |
||||
|
"临沧机场", |
||||
|
"临沂机场", |
||||
|
"林芝米林机场", |
||||
|
"柳州白莲机场", |
||||
|
"龙岩冠豸山机场", |
||||
|
"泸州蓝田机场", |
||||
|
"洛阳北郊机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "M", |
||||
|
"data": [ |
||||
|
"满洲里西郊机场", |
||||
|
"绵阳南郊机场", |
||||
|
"漠河古莲机场", |
||||
|
"牡丹江海浪机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "N", |
||||
|
"data": [ |
||||
|
"南昌昌北国际机场", |
||||
|
"南充高坪机场", |
||||
|
"南京禄口国际机场", |
||||
|
"南宁吴圩机场", |
||||
|
"南通兴东机场", |
||||
|
"南阳姜营机场", |
||||
|
"宁波栎社国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "O", |
||||
|
"data": [] |
||||
|
}, { |
||||
|
"letter": "P", |
||||
|
"data": [ |
||||
|
"普洱思茅机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "Q", |
||||
|
"data": [ |
||||
|
"齐齐哈尔三家子机场", |
||||
|
"秦皇岛山海关机场", |
||||
|
"青岛流亭国际机场", |
||||
|
"衢州机场", |
||||
|
"泉州晋江机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "R", |
||||
|
"data": [ |
||||
|
"日喀则和平机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "S", |
||||
|
"data": [ |
||||
|
"三亚凤凰国际机场", |
||||
|
"汕头外砂机场", |
||||
|
"上海虹桥国际机场", |
||||
|
"上海浦东国际机场", |
||||
|
"深圳宝安国际机场", |
||||
|
"沈阳桃仙国际机场", |
||||
|
"石家庄正定国际机场", |
||||
|
"苏南硕放国际机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "T", |
||||
|
"data": [ |
||||
|
"塔城机场", |
||||
|
"太原武宿国际机场", |
||||
|
"台州路桥机场 (黄岩机场)", |
||||
|
"唐山三女河机场", |
||||
|
"腾冲驼峰机场", |
||||
|
"天津滨海国际机场", |
||||
|
"通辽机场", |
||||
|
"铜仁凤凰机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "U", |
||||
|
"data": [] |
||||
|
}, { |
||||
|
"letter": "V", |
||||
|
"data": [] |
||||
|
}, { |
||||
|
"letter": "W", |
||||
|
"data": [ |
||||
|
"万州五桥机场", |
||||
|
"潍坊机场", |
||||
|
"威海大水泊机场", |
||||
|
"文山普者黑机场", |
||||
|
"温州永强国际机场", |
||||
|
"乌海机场", |
||||
|
"武汉天河国际机场", |
||||
|
"乌兰浩特机场", |
||||
|
"乌鲁木齐地窝堡国际机场", |
||||
|
"武夷山机场", |
||||
|
"梧州长洲岛机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "X", |
||||
|
"data": [ |
||||
|
"西安咸阳国际机场", |
||||
|
"西昌青山机场", |
||||
|
"锡林浩特机场", |
||||
|
"西宁曹家堡机场", |
||||
|
"西双版纳嘎洒机场", |
||||
|
"厦门高崎国际机场", |
||||
|
"香港国际机场", |
||||
|
"襄阳刘集机场", |
||||
|
"兴义机场", |
||||
|
"徐州观音机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "Y", |
||||
|
"data": [ |
||||
|
"延安二十里堡机场", |
||||
|
"盐城机场", |
||||
|
"延吉朝阳川机场", |
||||
|
"烟台莱山国际机场", |
||||
|
"宜宾菜坝机场", |
||||
|
"宜昌三峡机场", |
||||
|
"伊春林都机场", |
||||
|
"伊宁机场", |
||||
|
"义乌机场", |
||||
|
"银川河东机场", |
||||
|
"永州零陵机场", |
||||
|
"榆林榆阳机场", |
||||
|
"玉树巴塘机场", |
||||
|
"运城张孝机场" |
||||
|
] |
||||
|
}, { |
||||
|
"letter": "Z", |
||||
|
"data": [ |
||||
|
"湛江机场", |
||||
|
"昭通机场", |
||||
|
"郑州新郑国际机场", |
||||
|
"芷江机场", |
||||
|
"重庆江北国际机场", |
||||
|
"中卫香山机场", |
||||
|
"舟山朱家尖机场", |
||||
|
"珠海三灶机场" |
||||
|
] |
||||
|
}] |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
|
||||
|
function service(options = {}) { |
||||
|
let contentType = localStorage.token_type ? "application/json" : "application/x-www-form-urlencoded"; |
||||
|
// contentType ="application/x-www-form-urlencoded";
|
||||
|
contentType ="application/json"; |
||||
|
localStorage.setItem('token', "f6350745-d4ac-4e1a-82f2-7e1a6efd8a3f") |
||||
|
|
||||
|
let token= localStorage.getItem("token") |
||||
|
options.header = { |
||||
|
"content-type": contentType, |
||||
|
"Authorization": "Bearer "+token |
||||
|
// 'withCredentials': true,
|
||||
|
// 'Blade-Auth':'bearer '+store.state.token,
|
||||
|
// 'token_type': localStorage.token_type
|
||||
|
}; |
||||
|
return new Promise((resolve, reject) => { |
||||
|
options.success = (res) => { |
||||
|
if (res ) { |
||||
|
if(res.statusCode == 200){ |
||||
|
if(res.data.code==0){ |
||||
|
resolve(res.data); |
||||
|
}else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
|
||||
|
}else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
|
||||
|
} else { |
||||
|
reject(options.url + res.data.msg) |
||||
|
} |
||||
|
}; |
||||
|
options.fail = (err) => { |
||||
|
reject(err); |
||||
|
}; |
||||
|
uni.request(options); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default service; |
@ -0,0 +1,281 @@ |
|||||
|
// 详情和审批
|
||||
|
export function getDetailAndApproveOption() { |
||||
|
let option_detail = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '审批', |
||||
|
style: { |
||||
|
backgroundColor: '#00CC33' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail; |
||||
|
} |
||||
|
//详情、审批通过、审批驳回
|
||||
|
export function getDetailAndApprovePassAndApproveNoOption() { |
||||
|
let option_detail = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '审批\n通过', |
||||
|
style: { |
||||
|
backgroundColor: '#00CC33' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '审批\n驳回', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail; |
||||
|
} |
||||
|
//详情、处理、审批不通过
|
||||
|
export function getDetailAndHandleOption() { |
||||
|
let option_detail = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '处理', |
||||
|
style: { |
||||
|
backgroundColor: '#00CC33' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail; |
||||
|
} |
||||
|
//详情、关闭
|
||||
|
export function getDetailAndCloseOption() { |
||||
|
let option_detail = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '关闭', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail; |
||||
|
} |
||||
|
// 采购退货返回侧滑按钮 详情 、编辑、库位、移除
|
||||
|
export function getPurchaseReceiptOption(allowModifyQty,allowModifyLocation) { |
||||
|
var option = [] |
||||
|
option.push(...getDetailOption()) |
||||
|
if (allowModifyQty == "TRUE") { |
||||
|
option.push(...getEditOption()) |
||||
|
} |
||||
|
if (allowModifyLocation == "TRUE") { |
||||
|
option.push(...getLocationOption()) |
||||
|
} |
||||
|
option.push(...getRemoveOption()) |
||||
|
return option; |
||||
|
} |
||||
|
|
||||
|
//详情
|
||||
|
export function getDetailOption() { |
||||
|
let option_detail = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}]; |
||||
|
return option_detail; |
||||
|
} |
||||
|
|
||||
|
//详情移除(扫描后不允许修改数量)
|
||||
|
export function getDetailRemoveOption() { |
||||
|
let option_detail_edit_remove = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail_edit_remove; |
||||
|
} |
||||
|
|
||||
|
export function getRemoveOption() { |
||||
|
let option_detail_remove = [{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
}]; |
||||
|
return option_detail_remove; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
export function getEditOption() { |
||||
|
let option_detail_edit = [{ |
||||
|
text: '编辑', |
||||
|
style: { |
||||
|
backgroundColor: '#F1A532' |
||||
|
} |
||||
|
}]; |
||||
|
return option_detail_edit; |
||||
|
} |
||||
|
export function getLocationOption() { |
||||
|
let option_detail_location = [{ |
||||
|
text: '库位', |
||||
|
style: { |
||||
|
backgroundColor: '#00A3FF' |
||||
|
} |
||||
|
}]; |
||||
|
return option_detail_location; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//清空
|
||||
|
export function getClearOption() { |
||||
|
let option_detail_edit_remove = [{ |
||||
|
text: '清空', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
}]; |
||||
|
return option_detail_edit_remove; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//详情编辑移除
|
||||
|
export function getDetailEditRemoveOption() { |
||||
|
let option_detail_edit_remove = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '编辑', |
||||
|
style: { |
||||
|
backgroundColor: '#F1A532' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail_edit_remove; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//详情编辑放弃
|
||||
|
export function getDetailGiveupOption() { |
||||
|
let option_detail_giveup = [{ |
||||
|
text: '详情', |
||||
|
style: { |
||||
|
backgroundColor: '#3C9CFF' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '放弃', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_detail_giveup; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//详情编辑移除
|
||||
|
export function getEditRemoveOption() { |
||||
|
let option_edit_remove = [{ |
||||
|
text: '编辑', |
||||
|
style: { |
||||
|
backgroundColor: '#F1A532' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
return option_edit_remove; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 库存状态字典项
|
||||
|
export function getInventoryStatusArray() { |
||||
|
let array = [{ |
||||
|
text: '待检', |
||||
|
value: "kcztINSP" |
||||
|
}, { |
||||
|
text: '合格', |
||||
|
value: "kcztOK" |
||||
|
}, { |
||||
|
text: '不合格', |
||||
|
value: "kcztNOK" |
||||
|
}, { |
||||
|
text: '隔离', |
||||
|
value: "kcztHOLD" |
||||
|
}, { |
||||
|
text: '报废', |
||||
|
value: "kcztSCRAP" |
||||
|
}] |
||||
|
return array; |
||||
|
} |
||||
|
|
||||
|
// 业务类型字典项
|
||||
|
export function getBusinessTypeArray() { |
||||
|
let array = [{ |
||||
|
text: '供应商发货', |
||||
|
value: "SupplierDeliver" |
||||
|
}, { |
||||
|
text: '采购收货', |
||||
|
value: "PurchaseReceipt" |
||||
|
}, { |
||||
|
text: '采购退货', |
||||
|
value: "PurchaseReturn" |
||||
|
}, { |
||||
|
text: '采购上架', |
||||
|
value: "PurchasePutaway" |
||||
|
}] |
||||
|
return array; |
||||
|
} |
||||
|
|
||||
|
export function getLocationTypeArray(data) { |
||||
|
var list = [] |
||||
|
if (data == undefined || data == null || data == "") { |
||||
|
return list |
||||
|
} |
||||
|
|
||||
|
if (data.indexOf(',') < 0) { |
||||
|
list.push(data) |
||||
|
} else { |
||||
|
var arrayItems = data.split(',') |
||||
|
arrayItems.forEach(res => { |
||||
|
list.push(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
return list |
||||
|
} |
@ -0,0 +1,336 @@ |
|||||
|
|
||||
|
import { |
||||
|
getManagementPrecision, |
||||
|
getBalanceByFilter |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
/** |
||||
|
* "itemCode": [], |
||||
|
"locationCode":"INSPECT" |
||||
|
管理精度策略 |
||||
|
* @param {*} |
||||
|
* |
||||
|
*/ |
||||
|
export function getManagementPrecisions(itemCodes, locationCode, callback) { |
||||
|
// let jsonParem = JSON.stringify(param)
|
||||
|
let result = { |
||||
|
list: [], |
||||
|
success: true, |
||||
|
message: '' |
||||
|
}; |
||||
|
|
||||
|
var params = { |
||||
|
itemCodes: itemCodes, |
||||
|
locationCode: locationCode |
||||
|
} |
||||
|
getManagementPrecision(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false |
||||
|
result.message = '未查询到管理精度信息' |
||||
|
} else { |
||||
|
result.list = res.data; |
||||
|
} |
||||
|
callback(result); |
||||
|
}).catch(error => { |
||||
|
result.success = false; |
||||
|
result.message = error; |
||||
|
callback(result); |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getBalanceByManagementPrecision(label, locationCode, callback) { |
||||
|
let result = { |
||||
|
list: [], |
||||
|
success: true, |
||||
|
message: '' |
||||
|
}; |
||||
|
let params = { |
||||
|
itemCodes: [label.itemCode], |
||||
|
locationCode: locationCode |
||||
|
}; |
||||
|
// let jsonParem = JSON.stringify(param)
|
||||
|
getManagementPrecision(params).then(res => { |
||||
|
let managementPrecision = res.data[0].ManagementPrecision; |
||||
|
switch (managementPrecision) { |
||||
|
case 'BY_PACKAGING': |
||||
|
byPacking(label, locationCode, res => { |
||||
|
res.managementPrecision = managementPrecision; |
||||
|
callback(res); |
||||
|
}); |
||||
|
break; |
||||
|
case 'BY_BATCH': |
||||
|
byBatch(label, locationCode, res => { |
||||
|
res.managementPrecision = managementPrecision; |
||||
|
callback(res); |
||||
|
}); |
||||
|
break; |
||||
|
case 'BY_QUANTITY': |
||||
|
byQuantity(label, locationCode, res => { |
||||
|
res.managementPrecision = managementPrecision; |
||||
|
callback(res); |
||||
|
}); |
||||
|
break; |
||||
|
case 'BY_UNIQUEID': |
||||
|
byUniqueId(label, res => { |
||||
|
res.managementPrecision = managementPrecision; |
||||
|
callback(res); |
||||
|
}); |
||||
|
break; |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
let result = { |
||||
|
success: false, |
||||
|
message: error |
||||
|
}; |
||||
|
callback(result); |
||||
|
}) |
||||
|
} |
||||
|
/** 按包装管理查询库存 |
||||
|
* @param {Object} label |
||||
|
* @param {Object} locationCode |
||||
|
* @param {Object} callback |
||||
|
*/ |
||||
|
export function byPacking(label, locationCode, callback) { |
||||
|
let result = { |
||||
|
success: true, |
||||
|
message: '', |
||||
|
data: {} |
||||
|
}; |
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "packing_number", |
||||
|
action: "==", |
||||
|
value: label.packingNumber |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "item_code", |
||||
|
action: "==", |
||||
|
value: label.itemCode |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "batch", |
||||
|
action: "==", |
||||
|
value: label.batch |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "location_code", |
||||
|
action: "==", |
||||
|
value: locationCode |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
getBalanceByFilter(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false; |
||||
|
result.message = |
||||
|
"按包装管理查询、未查询到物料号[" + label.itemCode + "]" + |
||||
|
"到箱码[" + label.packingNumber + "]" + |
||||
|
"批次[" + label.batch + "]" + |
||||
|
"库位[" + label.locationCode + "]的信息" |
||||
|
} else { |
||||
|
result.success = true; |
||||
|
result.data = res.data; |
||||
|
} |
||||
|
|
||||
|
callback(result) |
||||
|
}).catch(err => { |
||||
|
result.success = false; |
||||
|
result.data = null; |
||||
|
result.message = err; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
||||
|
/** 按批次管理查询库存 |
||||
|
* @param {Object} label |
||||
|
* @param {Object} locationCode |
||||
|
* @param {Object} callback |
||||
|
*/ |
||||
|
export function byBatch(label, locationCode, callback) { |
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "item_code", |
||||
|
action: "==", |
||||
|
value: label.itemCode |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "batch", |
||||
|
action: "==", |
||||
|
value: label.batch |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "location_code", |
||||
|
action: "==", |
||||
|
value: locationCode |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
|
||||
|
let result = { |
||||
|
success: true, |
||||
|
message: '', |
||||
|
data: {} |
||||
|
}; |
||||
|
getBalanceByFilter(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false; |
||||
|
result.message = |
||||
|
"按批次管理查询、未查询到物料号[" + label.itemCode + "]" + |
||||
|
"批次[" + label.batch + "]" + |
||||
|
"库位[" + label.locationCode + "]的信息" |
||||
|
} else { |
||||
|
result.success = true; |
||||
|
result.data = res.data; |
||||
|
} |
||||
|
callback(result) |
||||
|
}).catch(err => { |
||||
|
result.success = false; |
||||
|
result.data = null; |
||||
|
result.message = err.message; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
||||
|
/** 按数量管理查询库存 |
||||
|
* @param {Object} label |
||||
|
* @param {Object} locationCode |
||||
|
* @param {Object} callback |
||||
|
*/ |
||||
|
export function byQuantity(label, locationCode, callback) { |
||||
|
let result = { |
||||
|
success: true, |
||||
|
message: '', |
||||
|
data: {} |
||||
|
}; |
||||
|
|
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "item_code", |
||||
|
action: "==", |
||||
|
value: label.itemCode |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "location_code", |
||||
|
action: "==", |
||||
|
value: locationCode |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
|
||||
|
getBalanceByFilter(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false; |
||||
|
result.message = |
||||
|
"按数量管理查询、未查询到物料号[" + label.itemCode + "]" + |
||||
|
"库位[" + label.locationCode + "]的信息" |
||||
|
} else { |
||||
|
result.success = true; |
||||
|
result.data = res.data; |
||||
|
} |
||||
|
callback(result) |
||||
|
}).catch(err => { |
||||
|
result.success = false; |
||||
|
result.data = null; |
||||
|
result.message = err.message; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
||||
|
/** 按唯一码管理查询库存 |
||||
|
* @param {Object} label |
||||
|
* @param {Object} locationCode |
||||
|
* @param {Object} callback |
||||
|
*/ |
||||
|
export function byUniqueId(label, locationCode, callback) { |
||||
|
let param = { |
||||
|
packingNumber: label.packingNumber |
||||
|
}; |
||||
|
let result = { |
||||
|
success: true, |
||||
|
message: '', |
||||
|
data: {} |
||||
|
}; |
||||
|
|
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "packing_number", |
||||
|
action: "==", |
||||
|
value: label.packingNumber |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
|
||||
|
getBalanceByFilter(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false; |
||||
|
result.message = |
||||
|
"按唯一码管理查询、未查询到箱码[" + label.packingNumber + "]" + |
||||
|
"的信息" |
||||
|
} else { |
||||
|
result.success = true; |
||||
|
result.data = res.data; |
||||
|
} |
||||
|
callback(result) |
||||
|
}).catch(err => { |
||||
|
result.success = false; |
||||
|
result.data = null; |
||||
|
result.message = err.message; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
||||
|
/** |
||||
|
* 查询指定库位下的库存 |
||||
|
* @param {*} param |
||||
|
* @param {*} callback |
||||
|
*/ |
||||
|
export function balanceByLocation(locationCode, callback) { |
||||
|
let result = { |
||||
|
success: true, |
||||
|
message: '', |
||||
|
data: {} |
||||
|
}; |
||||
|
|
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "location_code", |
||||
|
action: "==", |
||||
|
value: locationCode |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
|
||||
|
getBalanceByFilter(params).then(res => { |
||||
|
if (res.data == null) { |
||||
|
result.success = false; |
||||
|
result.message = |
||||
|
"按唯一码管理查询、未查询到库位[" + label.locationCode + "]" + |
||||
|
"的信息" |
||||
|
} else { |
||||
|
result.success = true; |
||||
|
result.data = res.data; |
||||
|
} |
||||
|
callback(result) |
||||
|
}).catch(err => { |
||||
|
result.success = false; |
||||
|
result.data = null; |
||||
|
result.message = err.message; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
@ -0,0 +1,871 @@ |
|||||
|
let maxPageSize = 1000; |
||||
|
export { |
||||
|
maxPageSize |
||||
|
} |
||||
|
|
||||
|
let jobStatusList = []; |
||||
|
let itemStatusList =[]; |
||||
|
let locationTypeList = []; |
||||
|
let uomList = []; |
||||
|
let inventoryStatusList = []; |
||||
|
let containerTypeList = []; |
||||
|
let packUnitList = []; |
||||
|
let requestStatusList = []; |
||||
|
let unplannedReceiptReasonList = []; |
||||
|
let unplannedIissueReason = []; |
||||
|
let scrapReasonList = []; |
||||
|
let inspectFailedReasonList = []; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//获取字典信息
|
||||
|
export function clearCacheData() { |
||||
|
jobStatusList = []; |
||||
|
itemStatusList = []; |
||||
|
locationTypeList = []; |
||||
|
uomList = []; |
||||
|
inventoryStatusList = []; |
||||
|
containerTypeList = []; |
||||
|
packUnitList = []; |
||||
|
requestStatusList = []; |
||||
|
unplannedReceiptReasonList = []; |
||||
|
unplannedIissueReason = []; |
||||
|
scrapReasonList = []; |
||||
|
inspectFailedReasonList = []; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//获取字典信息
|
||||
|
export function getDirectoryInfo(type) { |
||||
|
var result = []; |
||||
|
var list = uni.getStorageSync("dictionary") |
||||
|
if (list != undefined && list.length > 0) { |
||||
|
for (let item of list) { |
||||
|
if (item.type == type) { |
||||
|
result = item.subList |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return result |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//将字典项转为数组
|
||||
|
export function getDirectoryItemArray(data) { |
||||
|
var array = [] |
||||
|
if (data == undefined || data == null || data == "") { |
||||
|
return array |
||||
|
} |
||||
|
|
||||
|
if (data.indexOf(',') < 0) { |
||||
|
array.push(data) |
||||
|
} else { |
||||
|
var arrayItems = data.split(',') |
||||
|
arrayItems.forEach(res => { |
||||
|
array.push(res) |
||||
|
}) |
||||
|
} |
||||
|
return array |
||||
|
} |
||||
|
|
||||
|
//查询字典项是否在列表中
|
||||
|
export function checkDirectoryItemExist(list, type) { |
||||
|
let exist = false; |
||||
|
if (list == null || list.length == 0) { |
||||
|
exist = true; |
||||
|
} else { |
||||
|
var temp = list.filter(res => { |
||||
|
if (res == type) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (temp != undefined && temp.length > 0) { |
||||
|
exist = true |
||||
|
} |
||||
|
} |
||||
|
return exist |
||||
|
} |
||||
|
|
||||
|
//获取任务状态
|
||||
|
export function getJobStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (jobStatusList.length == 0) { |
||||
|
jobStatusList = getDirectoryInfo("job_status") |
||||
|
} |
||||
|
if (jobStatusList.length > 0) { |
||||
|
for (let item of jobStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取任务状态样式
|
||||
|
export function getJobStateStyle(value) { |
||||
|
let item = getJobStateInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
if (item.remark == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
return item.remark; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取库位描述
|
||||
|
export function getListLocationTypeDesc(lst) { |
||||
|
let desc = ''; |
||||
|
lst.forEach(res => { |
||||
|
desc += getLocationTypeInfo(res).label + "," |
||||
|
}) |
||||
|
desc = desc.slice(0, -1); |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
//获取物品状态
|
||||
|
export function getItemStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (itemStatusList.length == 0) { |
||||
|
itemStatusList = getDirectoryInfo("item_status") |
||||
|
} |
||||
|
if (itemStatusList.length > 0) { |
||||
|
for (let item of itemStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库位类型
|
||||
|
export function getLocationTypeInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (locationTypeList.length == 0) { |
||||
|
locationTypeList = getDirectoryInfo("location_type") |
||||
|
} |
||||
|
if (locationTypeList.length > 0) { |
||||
|
for (let item of locationTypeList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库位类型名称
|
||||
|
export function getLocationTypeName(value) { |
||||
|
let location = getLocationTypeInfo(value); |
||||
|
|
||||
|
return location == '' ? value : location.label; |
||||
|
} |
||||
|
|
||||
|
//获取计量单位
|
||||
|
export function getUnitInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (uomList.length == 0) { |
||||
|
uomList = getDirectoryInfo("uom") |
||||
|
} |
||||
|
if (uomList.length > 0) { |
||||
|
for (let item of uomList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取包装单位
|
||||
|
export function getStdPackUnitInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (packUnitList.length == 0) { |
||||
|
packUnitList = getDirectoryInfo("pack_unit") |
||||
|
} |
||||
|
if (packUnitList.length > 0) { |
||||
|
for (let item of packUnitList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取申请状态
|
||||
|
export function getRequestStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (requestStatusList.length == 0) { |
||||
|
requestStatusList = getDirectoryInfo("request_status") |
||||
|
} |
||||
|
if (requestStatusList.length > 0) { |
||||
|
for (let item of requestStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库存状态
|
||||
|
export function getInventoryStatusInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (inventoryStatusList.length == 0) { |
||||
|
inventoryStatusList = getDirectoryInfo("inventory_status") |
||||
|
} |
||||
|
if (inventoryStatusList.length > 0) { |
||||
|
for (let item of inventoryStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库存样式
|
||||
|
export function getInventoryStatusStyle(value) { |
||||
|
let item = getInventoryStatusInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
if (item.remark == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
return item.remark; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取库存状态
|
||||
|
export function getInventoryStatusName(value) { |
||||
|
let item = getInventoryStatusInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return value |
||||
|
} else { |
||||
|
if (item.label == '') { |
||||
|
return value |
||||
|
} else { |
||||
|
return item.label; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//获取状态描述
|
||||
|
export function getInventoryStatusDesc(lst) { |
||||
|
let desc = ''; |
||||
|
lst.forEach(res => { |
||||
|
desc += getInventoryStatusInfo(res).label + "," |
||||
|
}) |
||||
|
desc = desc.slice(0, -1); |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//获取器具状态
|
||||
|
export function getContainerStatusInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (containerTypeList.length == 0) { |
||||
|
containerTypeList = getDirectoryInfo("container_type") |
||||
|
} |
||||
|
if (containerTypeList.length > 0) { |
||||
|
for (let item of containerTypeList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取计划外入库原因
|
||||
|
export function getUnPlannedReceiptReasonList(value) { |
||||
|
if (unplannedReceiptReasonList.length == 0) { |
||||
|
unplannedReceiptReasonList = getDirectoryInfo("unplanned_receipt_reason") |
||||
|
} |
||||
|
unplannedReceiptReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return unplannedReceiptReasonList |
||||
|
} |
||||
|
|
||||
|
//获取计划外出库原因
|
||||
|
export function getUnPlannedIssuseReasonList(value) { |
||||
|
if (unplannedIissueReason.length == 0) { |
||||
|
unplannedIissueReason = getDirectoryInfo("unplanned_issue_reason") |
||||
|
} |
||||
|
unplannedIissueReason.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return unplannedIissueReason |
||||
|
} |
||||
|
|
||||
|
//获取报废出库原因
|
||||
|
export function getScarpReasonList(value) { |
||||
|
if (scrapReasonList.length == 0) { |
||||
|
scrapReasonList = getDirectoryInfo("scrap_reason") |
||||
|
} |
||||
|
scrapReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return scrapReasonList |
||||
|
} |
||||
|
|
||||
|
//获取检验不合格原因
|
||||
|
export function getInspectReasonList(value) { |
||||
|
if (inspectFailedReasonList.length == 0) { |
||||
|
inspectFailedReasonList = getDirectoryInfo("inspect_failed_reason") |
||||
|
} |
||||
|
inspectFailedReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return inspectFailedReasonList |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// //数量状态
|
||||
|
// export function getCoutJobStatuStyle(val) {
|
||||
|
// if (val == 1) return 'state_inspect'
|
||||
|
// else if (val == 2) return 'state_ok'
|
||||
|
// else if (val == 3) return 'state_nook'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
// export function getCountJobStatuDesc(val) {
|
||||
|
// if (val == 1) return '待检'
|
||||
|
// else if (val == 2) return '合格'
|
||||
|
// else if (val == 3) return '不合格'
|
||||
|
// else return "未知"
|
||||
|
// }
|
||||
|
|
||||
|
// export function getPartCodeState(val) {
|
||||
|
// if (val == 0) return '可用'
|
||||
|
// else if (val == 1) return '新增'
|
||||
|
// else if (val == 2) return '隔离'
|
||||
|
// else if (val == 3) return '未知'
|
||||
|
// else return '未知'
|
||||
|
// }
|
||||
|
|
||||
|
// export function getLocationState(val) {
|
||||
|
// if (val == 'kwlxINSP') return '待检库'
|
||||
|
// else if (val == 'kwlxRAW') return '原料库'
|
||||
|
// else if (val == 'kwlxSEMI') return '半成品库'
|
||||
|
// else if (val == 'kwlxFG') return '成品库'
|
||||
|
// else if (val == 'kwlxWIP') return '线边库'
|
||||
|
// else if (val == 'kwlxHOLD') return '隔离库'
|
||||
|
// else if (val == 'kwlxSCRAP') return '报废库'
|
||||
|
// else if (val == 'kwlxNOK') return '不合格品库'
|
||||
|
// else if (val == 'kwxOVERFLOW') return '溢出库'
|
||||
|
// else if (val == 'kwlxCUsT') return '客户寄售库'
|
||||
|
// else if (val == 'kwlxOUTSIDE') return '外库'
|
||||
|
// else if (val == 'kwlxDIFF') return '盘点差异库'
|
||||
|
// else if (val == 'kwxTRANSPORT') return '在途库'
|
||||
|
// else return '未知'
|
||||
|
|
||||
|
// }
|
||||
|
|
||||
|
// export function getLocationStyle(val) {
|
||||
|
// if (val == 'kwlxRAW') return 'state_raw'
|
||||
|
// else if (val == 'kwlxFG') return 'state_fg'
|
||||
|
// else if (val == 'kwlxSEMI') return 'state_semi'
|
||||
|
// else if (val == 'kwlxHOLD') return 'state_hold'
|
||||
|
// else if (val == 4) return 'state_unk'
|
||||
|
// }
|
||||
|
|
||||
|
// //任务状态
|
||||
|
// export function getJobStatuStyle(val) {
|
||||
|
// if (val == 'JOB_PENDING') return 'job_state_un-doing'
|
||||
|
// else if (val == '1') return 'job_state_doing'
|
||||
|
// else if (val == 'reztDONE') return 'job_state_completed'
|
||||
|
// else if (val == 'rwztCLOSED') return 'job_state_close'
|
||||
|
// else if (val == 'rwztCANCELLED') return 'job_state_cancelled'
|
||||
|
// else return 'unk'
|
||||
|
// }
|
||||
|
// //任务状态
|
||||
|
// //open pending completed close
|
||||
|
// export function getJobStatuDesc(val) {
|
||||
|
// if (val == 'JOB_PENDING') return '待处理'
|
||||
|
// else if (val == '1') return '执行中'
|
||||
|
// else if (val == 'reztDONE') return '完成'
|
||||
|
// else if (val == 'rwztCLOSED') return '关闭'
|
||||
|
// else if (val == 'rwztCANCELLED') return '作废'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //检验任务状态
|
||||
|
// export function getInspectTypeStyle(val) {
|
||||
|
// if (val == 0) return 'unk'
|
||||
|
// else if (val == 1) return 'exempt'
|
||||
|
// else if (val == 2) return 'full'
|
||||
|
// else if (val == 3) return 'sampling'
|
||||
|
// else if (val == 4) return 'pick'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
// //open pending completed close
|
||||
|
// export function getInspectTypeDesc(val) {
|
||||
|
// if (val == 0) return '未知'
|
||||
|
// else if (val == 1) return '免检'
|
||||
|
// else if (val == 2) return '全检'
|
||||
|
// else if (val == 3) return '抽检'
|
||||
|
// else if (val == 4) return '挑选'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// //库存状态
|
||||
|
// export function getInventoryStatusStyle(val) {
|
||||
|
// if (val == 'kcztUNK') return 'unk'
|
||||
|
// else if (val == 'kcztINSP') return 'inventory_status_insp'
|
||||
|
// else if (val == 'kcztOK') return 'inventory_status_ok'
|
||||
|
// else if (val == 'kcztNOK') return 'inventory_status_nok'
|
||||
|
// else if (val == 'kcztHOLD') return 'inventory_status_hold'
|
||||
|
// else if (val == 'kcztSCRAP') return 'inventory_status_scarp'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// //库存状态
|
||||
|
// export function getInventoryStatusDesc(val) {
|
||||
|
// if (val == 'kcztUNK') return '未知'
|
||||
|
// else if (val == 'kcztINSP') return '待检'
|
||||
|
// else if (val == 'kcztOK') return '合格'
|
||||
|
// else if (val == 'kcztNOK') return '不合格'
|
||||
|
// else if (val == 'kcztHOLD') return '隔离'
|
||||
|
// else if (val == 'kcztSCRAP') return '报废'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //库存状态
|
||||
|
// export function getInventoryStatusStyle(val) {
|
||||
|
// if (val == 0) return 'unk'
|
||||
|
// else if (val == 1) return 'insp'
|
||||
|
// else if (val == 2) return 'ok'
|
||||
|
// else if (val == 3) return 'nok'
|
||||
|
// else if (val == 4) return 'hold'
|
||||
|
// else if (val == 5) return 'scarp'
|
||||
|
// else if (val == 6) return 'frozen'
|
||||
|
// else if (val == 31) return 'nok'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// //库存状态kcztINSP
|
||||
|
// export function getInventoryStatusDesc(val) {
|
||||
|
// if (val == 0) return '未知'
|
||||
|
// else if (val == 1) return '待检'
|
||||
|
// else if (val == 2) return '合格'
|
||||
|
// else if (val == 3) return '不合格'
|
||||
|
// else if (val == 4) return '隔离'
|
||||
|
// else if (val == 5) return '报废'
|
||||
|
// else if (val == 6) return '冻结'
|
||||
|
// else if (val == 31) return '不合格'
|
||||
|
// // else if (val == 31) return '目检不合格'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //零件状态
|
||||
|
// export function getItemStatusStyle(val) {
|
||||
|
// if (val == "wpztUNK") return 'item_unk'
|
||||
|
// else if (val == "wpztENABLE") return 'item_active'
|
||||
|
// else if (val == "wpztHOLD") return 'item_hold'
|
||||
|
// else if (val == "wpztNEW") return 'item_new'
|
||||
|
// else if (val == "wpztPLAN") return 'item_plan'
|
||||
|
// else if (val == "wpztDISABLE") return 'item_disable'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
// export function getItemStatusStyle(val) {
|
||||
|
// if (val == 0) return 'unk_item'
|
||||
|
// else if (val == 1) return 'active_item'
|
||||
|
// else if (val == 2) return 'hold_item'
|
||||
|
// else if (val == 3) return 'new_item'
|
||||
|
// else if (val == 4) return 'plan_item'
|
||||
|
// else if (val == 5) return 'disable_item'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// //零件状态描述
|
||||
|
// export function getItemStatusDesc(val) {
|
||||
|
// if (val == "wpztUNK") return '未知'
|
||||
|
// else if (val == "wpztENABLE") return '可用'
|
||||
|
// else if (val == "wpztHOLD") return '隔离'
|
||||
|
// else if (val == "wpztNEW") return '新增'
|
||||
|
// else if (val == "wpztPLAN") return '规划'
|
||||
|
// else if (val == "wpztDISABLE") return '禁用'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //盘点状态
|
||||
|
// export function getCountStageTypeStyle(val) {
|
||||
|
// if (val == 0) return 'unk'
|
||||
|
// else if (val == 1) return 'initial'
|
||||
|
// else if (val == 2) return 'afresh'
|
||||
|
// else if (val == 3) return 'supervision'
|
||||
|
// else return 'other'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// //盘点状态
|
||||
|
// export function getCountStageDesc(val) {
|
||||
|
// if (val == 0) return '未知'
|
||||
|
// else if (val == 1) return '初盘'
|
||||
|
// else if (val == 2) return '重盘'
|
||||
|
// else if (val == 3) return '监盘'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //盘点计划类型
|
||||
|
// export function getCheckTypeDesc(val) {
|
||||
|
// if (val == 0) return '未知'
|
||||
|
// else if (val == 1) return '周期盘点'
|
||||
|
// else if (val == 2) return '物理盘点'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //盘点方式
|
||||
|
// export function getCountMethodDesc(val) {
|
||||
|
// if (val == 0) return '未知'
|
||||
|
// else if (val == 1) return '库位盘点'
|
||||
|
// else if (val == 2) return '物品盘点'
|
||||
|
// else if (val == 3) return '库位零件盘点'
|
||||
|
// else return '其他'
|
||||
|
// }
|
||||
|
|
||||
|
// //获取库位类型
|
||||
|
// export function getLocationType(val) {
|
||||
|
// if (val == 'kwlxINSP') return 'location_inspect'
|
||||
|
// else if (val == 'kwlxRAW') return 'location_raw'
|
||||
|
// else if (val == 'kwlxSEMI') return 'location_semi'
|
||||
|
// else if (val == 'kwlxFG') return 'location_fg'
|
||||
|
// else if (val == 'kwlxWIP') return 'location_wip'
|
||||
|
// else if (val == 'kwlxHOLD') return 'location_hold'
|
||||
|
// else if (val == 'kwlxSCRAP') return 'location_scrap'
|
||||
|
// else if (val == 'kwlxNOK') return 'location_nok'
|
||||
|
// else if (val == 'kwxOVERFLOW') return 'location_overflow'
|
||||
|
// else if (val == 'kwlxCUsT') return 'location_cust'
|
||||
|
// else if (val == 'kwlxOUTSIDE') return 'location_outside'
|
||||
|
// else if (val == 'kwlxDIFF') return 'location_diff'
|
||||
|
// else if (val == 'kwxTRANSPORT') return 'location_transport'
|
||||
|
// else return 'location_other'
|
||||
|
// }
|
||||
|
|
||||
|
// //获取库位类型描述
|
||||
|
// export function getLocationTypeDesc(val) {
|
||||
|
// if (val == 'kwlxINSP') return '待检库'
|
||||
|
// else if (val == 'kwlxRAW') return '原料库'
|
||||
|
// else if (val == 'kwlxSEMI') return '半成品库'
|
||||
|
// else if (val == 'kwlxFG') return '成品库'
|
||||
|
// else if (val == 'kwlxWIP') return '线边库'
|
||||
|
// else if (val == 'kwlxHOLD') return '隔离库'
|
||||
|
// else if (val == 'kwlxSCRAP') return '报废库'
|
||||
|
// else if (val == 'kwlxNOK') return '不合格品库'
|
||||
|
// else if (val == 'kwxOVERFLOW') return '溢出库'
|
||||
|
// else if (val == 'kwlxCUsT') return '客户寄售库'
|
||||
|
// else if (val == 'kwlxOUTSIDE') return '外库'
|
||||
|
// else if (val == 'kwlxDIFF') return '盘点差异库'
|
||||
|
// else if (val == 'kwxTRANSPORT') return '在途库'
|
||||
|
// else return '其他'
|
||||
|
|
||||
|
// }
|
||||
|
|
||||
|
// //获取任务类型描述
|
||||
|
// export function getJobType(val) {
|
||||
|
// if (val == 0) return 'uno'
|
||||
|
// else if (val == 1) return 'PurchaseReceiptJob' //采购收货
|
||||
|
// else if (val == 2) return 'PurchaseReturnJob' //采购退货任务
|
||||
|
// else if (val == 3) return 'InspectJob' //检验任务
|
||||
|
// else if (val == 4) return 'PutawayJob' //上架任务
|
||||
|
// else if (val == 5) return 'ProductReceiveJob' //完工收货任务
|
||||
|
// else if (val == 6) return 'IssueJob' //发料任务
|
||||
|
// else if (val == 7) return 'DeliverJob' //发货任务
|
||||
|
// else if (val == 8) return 'CheckJob' //校验任务
|
||||
|
// else if (val == 9) return 'CountJob' //盘点任务
|
||||
|
// else return 'Other'
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// 获取业务类型字典项
|
||||
|
export function getBusinessTypeDesc(type) { |
||||
|
if (type == "SupplierDeliver") { |
||||
|
return "供应商发货" |
||||
|
} else if (type = "PurchaseReceipt") { |
||||
|
return "采购收货"; |
||||
|
} else if (type = "PurchaseReturn") { |
||||
|
return "采购退货"; |
||||
|
} else if (type = "PurchasePutaway") { |
||||
|
return "采购上架"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function queryManageModel(managementList, itemCode) { |
||||
|
var result = managementList.filter(res => { |
||||
|
if (res.itemCode == itemCode) { |
||||
|
return res.ManagementPrecision |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
if (result != undefined) { |
||||
|
return result[0].ManagementPrecision |
||||
|
} else { |
||||
|
return "" |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function getPackingNumberAndBatch(managementList, itemCode,packingNumber,batch) { |
||||
|
var itemInfo = { |
||||
|
packingNumber: "", |
||||
|
batch: "" |
||||
|
} |
||||
|
|
||||
|
var manageType = queryManageModel(managementList, itemCode) |
||||
|
if (manageType == "BY_QUANTITY") { |
||||
|
itemInfo.packingNumber = "" |
||||
|
itemInfo.batch = "" |
||||
|
} else if (manageType == "BY_BATCH") { |
||||
|
itemInfo.packingNumber = "" |
||||
|
itemInfo.batch = batch |
||||
|
} else if (manageType == "BY_PACKAGING") { |
||||
|
itemInfo.packingNumber = packingNumber |
||||
|
itemInfo.batch = batch |
||||
|
} else if (manageType == "BY_UNIQUE_ID") { |
||||
|
itemInfo.packingNumber = packingNumber |
||||
|
itemInfo.batch = batch |
||||
|
} |
||||
|
return itemInfo; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// //提示是否消息
|
||||
|
// export function showConfirmMsg(content, callback) {
|
||||
|
// uni.showModal({
|
||||
|
// title: '提示',
|
||||
|
// cancelText: '否',
|
||||
|
// confirmText: '是',
|
||||
|
// content: content,
|
||||
|
// success: function(res) {
|
||||
|
// if (res.confirm) {
|
||||
|
// callback(true);
|
||||
|
// } else {
|
||||
|
// callback(false);
|
||||
|
// }
|
||||
|
// },
|
||||
|
// })
|
||||
|
// scanErrorAudio();
|
||||
|
// }
|
||||
|
|
||||
|
export function compare(key) { |
||||
|
return function(a, b) { |
||||
|
var val1 = a[key]; |
||||
|
var val2 = b[key]; |
||||
|
return val2 - val1; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function compareDesc(key) { |
||||
|
return function(a, b) { |
||||
|
var val1 = a[key]; |
||||
|
var val2 = b[key]; |
||||
|
return val1 - val2; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function goHome() { |
||||
|
uni.reLaunch({ |
||||
|
url: '/pages/index/index' |
||||
|
}).catch((e) => {}); |
||||
|
|
||||
|
} |
||||
|
/** |
||||
|
* 获取当天时间2023-11-07 00:00:00-->2023-11-07 23:59:59 |
||||
|
*/ |
||||
|
export function getTodayDate() { |
||||
|
var startTime = new Date(new Date().toLocaleDateString()).getTime(); |
||||
|
var endTime = startTime+24*60*60*1000-1 |
||||
|
console.log("获取时间",startTime+","+endTime) |
||||
|
return startTime+","+endTime; |
||||
|
} |
||||
|
|
||||
|
export function getCurrDate() { |
||||
|
var date = new Date(); |
||||
|
return getDate(date); |
||||
|
} |
||||
|
|
||||
|
export function getCurrDateTime() { |
||||
|
var date = new Date(); |
||||
|
return getDate(date) + " " + getTime(date); |
||||
|
} |
||||
|
|
||||
|
export function getISODateTime() { |
||||
|
var date = new Date(); |
||||
|
return getDate(date) + "T" + getTime(date) + "Z"; |
||||
|
} |
||||
|
|
||||
|
//格式化处理
|
||||
|
export function dateFormat(time) { |
||||
|
let date = new Date(time); |
||||
|
return getDate(date) + " " + getTime(date); |
||||
|
} |
||||
|
|
||||
|
//获取日期部分
|
||||
|
export function getDate(date) { |
||||
|
var year = date.getFullYear(); //年
|
||||
|
var month = date.getMonth() + 1; //月
|
||||
|
var day = date.getDate(); //日
|
||||
|
|
||||
|
month = month < 10 ? "0" + month : month; |
||||
|
day = day < 10 ? "0" + day : day; |
||||
|
return year + "-" + month + "-" + day; |
||||
|
} |
||||
|
|
||||
|
//获取时间部分
|
||||
|
export function getTime(date) { |
||||
|
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); |
||||
|
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); |
||||
|
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); |
||||
|
// 拼接
|
||||
|
return hours + ":" + minutes + ":" + seconds; |
||||
|
} |
||||
|
|
||||
|
//将20220713转成2022-07-13
|
||||
|
export function toYYYY_MM_DD(value) { |
||||
|
return value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6, 8) |
||||
|
} |
||||
|
|
||||
|
export function getRootFontSize() { |
||||
|
const self = this; |
||||
|
var fontSize = getApp().globalData.rootFontSize; |
||||
|
if (fontSize) { |
||||
|
return fontSize; |
||||
|
} else { |
||||
|
fontSize = uni.getStorageSync('root_font_size'); |
||||
|
if (fontSize) { |
||||
|
getApp().globalData.rootFontSize = fontSize; |
||||
|
} else { |
||||
|
fontSize = '20px'; //默认字体大小
|
||||
|
self.setRootFontSize(fontSize); |
||||
|
} |
||||
|
return fontSize; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function getRemoveOption() { |
||||
|
let options = [{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
}] |
||||
|
return options; |
||||
|
} |
||||
|
|
||||
|
export function setRootFontSize(fontSize) { |
||||
|
uni.setStorageSync('root_font_size', fontSize); |
||||
|
getApp().globalData.rootFontSize = fontSize; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function scanErrorAudio() { |
||||
|
var music = null; |
||||
|
music = uni.createInnerAudioContext(); //创建播放器对象
|
||||
|
music.src = "../../static/video/error.wav"; |
||||
|
music.volume = 1; |
||||
|
music.play(); //执行播放
|
||||
|
music.onEnded(() => { |
||||
|
//播放结束
|
||||
|
music = null; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function newMessageAudio() { |
||||
|
var music = null; |
||||
|
music = uni.createInnerAudioContext(); //创建播放器对象
|
||||
|
music.src = "../../static/video/error.wav"; |
||||
|
music.volume = 1; |
||||
|
music.play(); //执行播放
|
||||
|
music.onEnded(() => { |
||||
|
//播放结束
|
||||
|
music = null; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function vibrate() { |
||||
|
uni.vibrateLong({ |
||||
|
success: function() { |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function getDataSource(details) { |
||||
|
let items = []; |
||||
|
details.forEach(detail => { |
||||
|
var item = items.find(r => |
||||
|
r.itemCode == detail.itemCode) |
||||
|
if (item == undefined) { |
||||
|
item = createItemInfo(detail); |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.details.push(newDetail); |
||||
|
items.push(item) |
||||
|
} else { |
||||
|
item.qty += Number(detail.qty) |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.details.push(newDetail); |
||||
|
} |
||||
|
}) |
||||
|
return items; |
||||
|
} |
||||
|
|
||||
|
export function createItemInfo(res) { |
||||
|
let item = { |
||||
|
itemCode: res.itemCode, |
||||
|
itemName: res.itemName, |
||||
|
stdPackQty: Number(res.stdPackQty), |
||||
|
stdPackUnit: res.stdPackUnit, |
||||
|
qty: Number(res.qty), |
||||
|
handleQty: 0, |
||||
|
uom: res.uom, |
||||
|
details: [] |
||||
|
} |
||||
|
return item; |
||||
|
} |
||||
|
|
||||
|
export function createDetailInfo(data) { |
||||
|
data.scaned = false; |
||||
|
// data.record = {};
|
||||
|
let detail = data; |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
export function updateTitle(title) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: title |
||||
|
}) |
||||
|
} |
@ -0,0 +1,371 @@ |
|||||
|
export default [{ |
||||
|
"name": "库存查询", |
||||
|
"children": [{ |
||||
|
"name": "按零件查询库存", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "pages/query/item", |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "按库位查询库存", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/query/location", |
||||
|
"index": 2, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "按器具查询库存", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/query/container", |
||||
|
"index": 3, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "单据查询", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/query/number", |
||||
|
"index": 3, |
||||
|
} |
||||
|
|
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"name": "原料管理", |
||||
|
"children": [{ |
||||
|
"name": "采购收货任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/purchaseReceipt/job/receiptJob", |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "到货检验任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/inspect/job/inspectJob", |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "采购退货任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/purchaseReturn/job/returnJob", |
||||
|
"index": 2, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "采购退货记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/purchaseReturn/record/returnRecord", |
||||
|
"index": 3, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
"name": "原料上架任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/putaway/job/putawayJob", |
||||
|
"index": 3, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "原料上架记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/putaway/record/putawayRecord", |
||||
|
"index": 3, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "发料任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/issue/job/issueJob", |
||||
|
"index": 4, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "直接发料", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/issue/record/issueRecord", |
||||
|
"index": 5, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产收料任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReceipt/job/productionReceiptJob", |
||||
|
"index": 5, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产收料记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReceipt/record/productionReceiptRecord", |
||||
|
"index": 5, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产退料任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReturn/job/returnJob", |
||||
|
"index": 6, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产合格退料", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReturn/record/returnToStore", |
||||
|
"index": 7, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产隔离退料", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReturn/record/returnToHold", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
|
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"name": "库存管理", |
||||
|
"children": [{ |
||||
|
"name": "库存转移任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/inventoryMove/job/inventoryMoveJob", |
||||
|
"index": 8, |
||||
|
}, { |
||||
|
"name": "库存转移", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/inventoryMove/record/moveFree", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "合格转隔离", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/inventoryMove/record/moveOkToHold", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "隔离转合格", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/inventoryMove/record/moveHoldToOk", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
"name": "盘点任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/count/job/countJob", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "库位盘点", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/count/record/countRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外入库任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/job/receiptJob", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外出库任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/job/issueJob", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外入库记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/record/receiptRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外出库记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/record/issueRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "报废出库\n(记录)", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/scrap/record/scrapRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品管理", |
||||
|
"children": [{ |
||||
|
"name": "制品收货任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/productReceipt/job/productReceiptJob', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品收货记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/productReceipt/record/productReceiptRecord', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品上架任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/productPutaway/job/productPutawayJob', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品上架记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/productPutaway/record/productPutawayRecord', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品发货任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/deliver/job/deliverJob', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "制品发货记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/deliver/record/deliverRecord', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "客户退货任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/customerReturn/job/returnJob', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "客户退货记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": '/pages/customerReturn/record/returnRecord', |
||||
|
"index": 1, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "调拨接收任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/transfer/job/receiptJob", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "调拨接收记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/transfer/record/receiptRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "调拨发出任务", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/transfer/job/issueJob", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "调拨发出记录", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/transfer/record/issueRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
|
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"name": "器具管理", |
||||
|
"children": [{ |
||||
|
"name": "托盘绑定", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/pallet/record/bindPalletRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "托盘解绑", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/pallet/record/unBindPalletRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "拆包", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/package/record/splitPackageRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "合包", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/package/record/mergePackageRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "翻包", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/package/record/overPackageRecord", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"name": "申请(原料)", |
||||
|
"children": [{ |
||||
|
"name": "发料申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/issue/request/issueRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "采购退货申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/purchaseReturn/request/returnRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "原料上架申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/putaway/request/putawayRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产退料合格申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReturn/request/returnToStoreRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "生产退料隔离申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productionReturn/request/returnToHoldRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
"name": "制品上架申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/productPutaway/request/putawayRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "成品发货申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/deliver/request/deliverRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "客户退货申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/customerReturn/request/customerReturnRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外入库申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/request/receiptRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "计划外出库申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/unPlanned/request/issueRequest", |
||||
|
"index": 8, |
||||
|
}, |
||||
|
{ |
||||
|
"name": "报废出库申请", |
||||
|
"icon": "/static/menus/dy_menu/menu_search_lj.svg", |
||||
|
"url": "/pages/scrap/request/scrapRrequest", |
||||
|
"index": 8, |
||||
|
} |
||||
|
|
||||
|
|
||||
|
] |
||||
|
} |
||||
|
|
||||
|
] |
@ -0,0 +1,42 @@ |
|||||
|
import utils from '@/common/utils.js'; |
||||
|
export default { |
||||
|
commitTask(scanCount,total){ |
||||
|
var isCommit=false; |
||||
|
if(scanCount==0){ |
||||
|
isCommit = false; |
||||
|
// this.openScanPopup();
|
||||
|
uni.showToast({ |
||||
|
title: "请先扫描" |
||||
|
}) |
||||
|
return isCommit; |
||||
|
} |
||||
|
if (this.scanCount==total) { |
||||
|
//提交
|
||||
|
isCommit =true; |
||||
|
// uni.showToast({
|
||||
|
// title: "可以提交"
|
||||
|
// })
|
||||
|
|
||||
|
} else { |
||||
|
//判断是否可以部分提交,可以提交,提交数据,
|
||||
|
let receipt_isPartCommit = getApp().globalData.recepit_configList.filter( |
||||
|
res => { |
||||
|
if (res.name == 'receipt_isPartCommit') { |
||||
|
return res; |
||||
|
} |
||||
|
}); |
||||
|
if (receipt_isPartCommit[0].value) { |
||||
|
isCommit = true; |
||||
|
uni.showToast({ |
||||
|
title: "可以部分提交" |
||||
|
}) |
||||
|
//提交
|
||||
|
} else { |
||||
|
isCommit = false; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return isCommit; |
||||
|
} |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
export default { |
||||
|
created() { |
||||
|
const self = this; |
||||
|
|
||||
|
}, |
||||
|
mounted() { |
||||
|
const self = this; |
||||
|
}, |
||||
|
methods: { |
||||
|
//设置字体
|
||||
|
getRootFontSize(){ |
||||
|
const self = this; |
||||
|
var fontSize = getApp().globalData.rootFontSize; |
||||
|
if(fontSize){ |
||||
|
return fontSize; |
||||
|
}else{ |
||||
|
fontSize = uni.getStorageSync('root_font_size'); |
||||
|
if(fontSize){ |
||||
|
getApp().globalData.rootFontSize=fontSize; |
||||
|
}else{ |
||||
|
fontSize='20px';//默认字体大小
|
||||
|
self.setRootFontSize(fontSize); |
||||
|
} |
||||
|
return fontSize; |
||||
|
} |
||||
|
}, |
||||
|
setRootFontSize(fontSize){ |
||||
|
uni.setStorageSync('root_font_size',fontSize); |
||||
|
getApp().globalData.rootFontSize=fontSize; |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
let url_config = "" |
||||
|
|
||||
|
let jsApiList = [ |
||||
|
'biz.cspace.saveFile', //钉盘保存文件
|
||||
|
'biz.map.search', //位置搜索
|
||||
|
'device.geolocation.get', //定位
|
||||
|
'biz.ding.create', //创建ding消息
|
||||
|
'device.base.getUUID', //uuid
|
||||
|
'biz.contact.choose', //联系人
|
||||
|
'biz.contact.complexPicker', //选人和部门
|
||||
|
'biz.contact.departmentsPicker', //选部门
|
||||
|
'biz.chat.chooseConversationByCorpId', //会话选择
|
||||
|
"biz.contact.chooseMobileContacts", //手机联系人
|
||||
|
]; |
||||
|
|
||||
|
let option = { |
||||
|
corpId: '', //企业ID
|
||||
|
agentId: '', //微应用ID
|
||||
|
serverPath: url_config, //接口基础地址
|
||||
|
jsApiList: jsApiList, //鉴权列表
|
||||
|
isDebug: false //判断是否alert
|
||||
|
}; |
||||
|
export default { |
||||
|
url_config, |
||||
|
option |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
export function getDataSource(details) { |
||||
|
let items = []; |
||||
|
details.forEach(detail => { |
||||
|
var item = items.find(r => |
||||
|
r.itemCode == detail.itemCode) |
||||
|
if (item == undefined) { |
||||
|
item = createItemInfo(detail); |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.details.push(newDetail); |
||||
|
items.push(item) |
||||
|
} else { |
||||
|
item.qty += detail.qty |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.details.push(newDetail); |
||||
|
} |
||||
|
}) |
||||
|
return items; |
||||
|
} |
||||
|
|
||||
|
export function createItemInfo(detail) { |
||||
|
let item = { |
||||
|
itemCode: detail.itemCode, |
||||
|
itemName: detail.itemName, |
||||
|
stdPackQty: Number(detail.stdPackQty)||undefined, |
||||
|
stdPackUnit: detail.stdPackUnit, |
||||
|
qty: Number(detail.qty), |
||||
|
handleQty: 0, |
||||
|
uom: detail.uom, |
||||
|
details: [] |
||||
|
} |
||||
|
return item; |
||||
|
} |
||||
|
|
||||
|
export function createDetailInfo(data) { |
||||
|
data.scaned = false; |
||||
|
// data.record = {};
|
||||
|
let detail = data; |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
//根据明细创建记录
|
||||
|
export function createRecordInfo(detail, balance) { |
||||
|
var record = {} |
||||
|
// let record = JSON.parse(JSON.stringify(detail));
|
||||
|
//克隆对象,深度克隆,防止双向绑定同一个变量
|
||||
|
Object.assign(record, detail) |
||||
|
detail.scaned = true; |
||||
|
detail.balance = balance; |
||||
|
detail.recommendInventoryStatus = detail.inventoryStatus; |
||||
|
detail.inventoryStatus = balance.inventoryStatus; |
||||
|
record.qty = Number(balance.qty); |
||||
|
return record; |
||||
|
} |
||||
|
|
||||
|
//计算实际数量
|
||||
|
export function calcHandleQty(detailSource) { |
||||
|
for (let item of detailSource) { |
||||
|
item.handleTotalQty = 0; |
||||
|
for (let detail of item.details) { |
||||
|
if (detail != undefined && detail.scaned) { |
||||
|
item.handleTotalQty += Number(detail.handleQty) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function getScanCount(detailList) { |
||||
|
let items = detailList.filter(r => { |
||||
|
if (r.scaned) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
let scanCount = items != null ? items.length : 0; |
||||
|
return scanCount; |
||||
|
} |
@ -0,0 +1,388 @@ |
|||||
|
|
||||
|
|
||||
|
let jobStatusList = []; |
||||
|
let itemStatusList =[]; |
||||
|
let locationTypeList = []; |
||||
|
let uomList = []; |
||||
|
let inventoryStatusList = []; |
||||
|
let containerTypeList = []; |
||||
|
let packUnitList = []; |
||||
|
let requestStatusList = []; |
||||
|
let unplannedReceiptReasonList = []; |
||||
|
let unplannedIissueReason = []; |
||||
|
let scrapReasonList = []; |
||||
|
let inspectFailedReasonList = []; |
||||
|
let nextActionList = []; |
||||
|
let inspectTypeList = []; |
||||
|
|
||||
|
|
||||
|
// 获取业务类型字典项
|
||||
|
export function getBusinessTypeDesc(type) { |
||||
|
if (type == "SupplierDeliver") { |
||||
|
return "供应商发货" |
||||
|
} else if (type = "PurchaseReceipt") { |
||||
|
return "采购收货"; |
||||
|
} else if (type = "PurchaseReturn") { |
||||
|
return "采购退货"; |
||||
|
} else if (type = "PurchasePutaway") { |
||||
|
return "采购上架"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取字典信息
|
||||
|
export function clearCacheData() { |
||||
|
jobStatusList = []; |
||||
|
itemStatusList =[]; |
||||
|
locationTypeList = []; |
||||
|
uomList = []; |
||||
|
inventoryStatusList = []; |
||||
|
containerTypeList = []; |
||||
|
packUnitList = []; |
||||
|
requestStatusList = []; |
||||
|
unplannedReceiptReasonList = []; |
||||
|
unplannedIissueReason = []; |
||||
|
scrapReasonList = []; |
||||
|
inspectFailedReasonList = []; |
||||
|
nextActionList = []; |
||||
|
inspectTypeList = []; |
||||
|
} |
||||
|
|
||||
|
//获取字典信息
|
||||
|
export function getDirectoryInfo(type) { |
||||
|
|
||||
|
var result = []; |
||||
|
var list = uni.getStorageSync("dictionary") |
||||
|
if (list != undefined && list.length > 0) { |
||||
|
for (let item of list) { |
||||
|
if (item.type == type) { |
||||
|
result = item.subList |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return result |
||||
|
} |
||||
|
|
||||
|
//将字典项转为数组
|
||||
|
export function getDirectoryItemArray(data) { |
||||
|
var array = [] |
||||
|
if (data == undefined || data == null || data == "") { |
||||
|
return array |
||||
|
} |
||||
|
|
||||
|
if (data.indexOf(',') < 0) { |
||||
|
array.push(data) |
||||
|
} else { |
||||
|
var arrayItems = data.split(',') |
||||
|
arrayItems.forEach(res => { |
||||
|
array.push(res) |
||||
|
}) |
||||
|
} |
||||
|
return array |
||||
|
} |
||||
|
|
||||
|
//查询字典项是否在列表中
|
||||
|
export function checkDirectoryItemExist(list, type) { |
||||
|
let exist = false; |
||||
|
if (list == null || list.length == 0) { |
||||
|
exist = true; |
||||
|
} else { |
||||
|
var temp = list.filter(res => { |
||||
|
if (res == type) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (temp != undefined && temp.length > 0) { |
||||
|
exist = true |
||||
|
} |
||||
|
} |
||||
|
return exist |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//获取任务状态
|
||||
|
export function getJobStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (jobStatusList.length == 0) { |
||||
|
jobStatusList = getDirectoryInfo("job_status") |
||||
|
} |
||||
|
if (jobStatusList.length > 0) { |
||||
|
for (let item of jobStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取任务状态样式
|
||||
|
export function getJobStateStyle(value) { |
||||
|
let item = getJobStateInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
if (item.remark == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
return item.remark; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取库位描述
|
||||
|
export function getListLocationTypeDesc(lst) { |
||||
|
let desc = ''; |
||||
|
lst.forEach(res => { |
||||
|
desc += getLocationTypeInfo(res).label + "," |
||||
|
}) |
||||
|
desc = desc.slice(0, -1); |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
//获取物品状态
|
||||
|
export function getItemStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (itemStatusList.length == 0) { |
||||
|
itemStatusList = getDirectoryInfo("item_status") |
||||
|
} |
||||
|
if (itemStatusList.length > 0) { |
||||
|
for (let item of itemStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库位类型
|
||||
|
export function getLocationTypeInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (locationTypeList.length == 0) { |
||||
|
locationTypeList = getDirectoryInfo("location_type") |
||||
|
} |
||||
|
if (locationTypeList.length > 0) { |
||||
|
for (let item of locationTypeList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库位类型名称
|
||||
|
export function getLocationTypeName(value) { |
||||
|
let location = getLocationTypeInfo(value); |
||||
|
|
||||
|
return location == '' ? value : location.label; |
||||
|
} |
||||
|
|
||||
|
//获取计量单位
|
||||
|
export function getUnitInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (uomList.length == 0) { |
||||
|
uomList = getDirectoryInfo("uom") |
||||
|
} |
||||
|
if (uomList.length > 0) { |
||||
|
for (let item of uomList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取包装单位
|
||||
|
export function getStdPackUnitInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (packUnitList.length == 0) { |
||||
|
packUnitList = getDirectoryInfo("pack_unit") |
||||
|
} |
||||
|
if (packUnitList.length > 0) { |
||||
|
for (let item of packUnitList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取申请状态
|
||||
|
export function getRequestStateInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (requestStatusList.length == 0) { |
||||
|
requestStatusList = getDirectoryInfo("request_status") |
||||
|
} |
||||
|
if (requestStatusList.length > 0) { |
||||
|
for (let item of requestStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//获取库存状态
|
||||
|
export function getInventoryStatusInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (inventoryStatusList.length == 0) { |
||||
|
inventoryStatusList = getDirectoryInfo("inventory_status") |
||||
|
} |
||||
|
if (inventoryStatusList.length > 0) { |
||||
|
for (let item of inventoryStatusList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取库存样式
|
||||
|
export function getInventoryStatusStyle(value) { |
||||
|
let item = getInventoryStatusInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
if (item.remark == '') { |
||||
|
return 'other' |
||||
|
} else { |
||||
|
return item.remark; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取库存样式
|
||||
|
export function getInventoryStatusName(value) { |
||||
|
let item = getInventoryStatusInfo(value); |
||||
|
if (item == null || item == '') { |
||||
|
return value |
||||
|
} else { |
||||
|
if (item.label == '') { |
||||
|
return value |
||||
|
} else { |
||||
|
return item.label; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取状态描述
|
||||
|
export function getInventoryStatusDesc(lst) { |
||||
|
let desc = ''; |
||||
|
lst.forEach(res => { |
||||
|
desc += getInventoryStatusInfo(res).label + "," |
||||
|
}) |
||||
|
desc = desc.slice(0, -1); |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
//获取器具状态
|
||||
|
export function getContainerStatusInfo(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (containerTypeList.length == 0) { |
||||
|
containerTypeList = getDirectoryInfo("container_type") |
||||
|
} |
||||
|
if (containerTypeList.length > 0) { |
||||
|
for (let item of containerTypeList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
||||
|
//获取计划外入库原因
|
||||
|
export function getUnPlannedReceiptReasonList(value) { |
||||
|
if (unplannedReceiptReasonList.length == 0) { |
||||
|
unplannedReceiptReasonList = getDirectoryInfo("unplanned_receipt_reason") |
||||
|
} |
||||
|
unplannedReceiptReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return unplannedReceiptReasonList |
||||
|
} |
||||
|
|
||||
|
//获取计划外出库原因
|
||||
|
export function getUnPlannedIssuseReasonList(value) { |
||||
|
if (unplannedIssueReasonList.length == 0) { |
||||
|
unplannedIssueReasonList = getDirectoryInfo("unplanned_issue_reason") |
||||
|
} |
||||
|
unplannedIssueReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return unplannedIssueReasonList |
||||
|
} |
||||
|
|
||||
|
//获取报废出库原因
|
||||
|
export function getScarpReasonList(value) { |
||||
|
if (scrapReasonList.length == 0) { |
||||
|
scrapReasonList = getDirectoryInfo("scrap_reason") |
||||
|
} |
||||
|
scrapReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.code |
||||
|
}) |
||||
|
return scrapReasonList |
||||
|
} |
||||
|
|
||||
|
//获取检验失败原因
|
||||
|
export function getInspectFailedReasonList(value) { |
||||
|
if (inspectFailedReasonList.length == 0) { |
||||
|
inspectFailedReasonList = getDirectoryInfo("inspect_failed_reason") |
||||
|
} |
||||
|
inspectFailedReasonList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.value |
||||
|
}) |
||||
|
return inspectFailedReasonList |
||||
|
} |
||||
|
|
||||
|
//获取下一步动作
|
||||
|
export function getNextActionList(value) { |
||||
|
if (nextActionList.length == 0) { |
||||
|
nextActionList = getDirectoryInfo("next_action") |
||||
|
} |
||||
|
nextActionList.forEach(res => { |
||||
|
res.text = res.label; |
||||
|
res.value = res.value |
||||
|
}) |
||||
|
return nextActionList |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//获取检验类型
|
||||
|
export function getInspectType(value) { |
||||
|
var resultInfo = ""; |
||||
|
if (inspectTypeList.length == 0) { |
||||
|
inspectTypeList = getDirectoryInfo("inspect_type") |
||||
|
} |
||||
|
if (inspectTypeList.length > 0) { |
||||
|
for (let item of inspectTypeList) { |
||||
|
if (item.value == value) { |
||||
|
resultInfo = item.label |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return resultInfo |
||||
|
} |
||||
|
|
@ -0,0 +1,97 @@ |
|||||
|
/** |
||||
|
数据验证(表单验证) |
||||
|
来自 grace.hcoder.net |
||||
|
作者 hcoder 深海 |
||||
|
*/ |
||||
|
export default { |
||||
|
error:'', |
||||
|
check : function (data, rule){ |
||||
|
for(var i = 0; i < rule.length; i++){ |
||||
|
if (!rule[i].checkType){return true;} |
||||
|
if (!rule[i].name) {return true;} |
||||
|
if (!rule[i].errorMsg) {return true;} |
||||
|
if (!data[rule[i].name]) {this.error = rule[i].errorMsg; return false;} |
||||
|
switch (rule[i].checkType){ |
||||
|
case 'string': |
||||
|
var reg = new RegExp('^.{' + rule[i].checkRule + '}$'); |
||||
|
if(!reg.test(data[rule[i].name])) {this.error = rule[i].errorMsg; return false;} |
||||
|
break; |
||||
|
case 'int': |
||||
|
var reg = new RegExp('^(-[1-9]|[1-9])[0-9]{' + rule[i].checkRule + '}$'); |
||||
|
if(!reg.test(data[rule[i].name])) {this.error = rule[i].errorMsg; return false;} |
||||
|
break; |
||||
|
break; |
||||
|
case 'between': |
||||
|
if (!this.isNumber(data[rule[i].name])){ |
||||
|
this.error = rule[i].errorMsg; |
||||
|
return false; |
||||
|
} |
||||
|
var minMax = rule[i].checkRule.split(','); |
||||
|
minMax[0] = Number(minMax[0]); |
||||
|
minMax[1] = Number(minMax[1]); |
||||
|
if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) { |
||||
|
this.error = rule[i].errorMsg; |
||||
|
return false; |
||||
|
} |
||||
|
break; |
||||
|
case 'betweenD': |
||||
|
var reg = /^-?[1-9][0-9]?$/; |
||||
|
if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; } |
||||
|
var minMax = rule[i].checkRule.split(','); |
||||
|
minMax[0] = Number(minMax[0]); |
||||
|
minMax[1] = Number(minMax[1]); |
||||
|
if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) { |
||||
|
this.error = rule[i].errorMsg; |
||||
|
return false; |
||||
|
} |
||||
|
break; |
||||
|
case 'betweenF': |
||||
|
var reg = /^-?[0-9][0-9]?.+[0-9]+$/; |
||||
|
if (!reg.test(data[rule[i].name])){this.error = rule[i].errorMsg; return false;} |
||||
|
var minMax = rule[i].checkRule.split(','); |
||||
|
minMax[0] = Number(minMax[0]); |
||||
|
minMax[1] = Number(minMax[1]); |
||||
|
if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) { |
||||
|
this.error = rule[i].errorMsg; |
||||
|
return false; |
||||
|
} |
||||
|
break; |
||||
|
case 'same': |
||||
|
if (data[rule[i].name] != rule[i].checkRule) { this.error = rule[i].errorMsg; return false;} |
||||
|
break; |
||||
|
case 'notsame': |
||||
|
if (data[rule[i].name] == rule[i].checkRule) { this.error = rule[i].errorMsg; return false; } |
||||
|
break; |
||||
|
case 'email': |
||||
|
var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; |
||||
|
if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; } |
||||
|
break; |
||||
|
case 'phoneno': |
||||
|
var reg = /^1[0-9]{10,10}$/; |
||||
|
if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; } |
||||
|
break; |
||||
|
case 'zipcode': |
||||
|
var reg = /^[0-9]{6}$/; |
||||
|
if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; } |
||||
|
break; |
||||
|
case 'reg': |
||||
|
var reg = new RegExp(rule[i].checkRule); |
||||
|
if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; } |
||||
|
break; |
||||
|
case 'in': |
||||
|
if(rule[i].checkRule.indexOf(data[rule[i].name]) == -1){ |
||||
|
this.error = rule[i].errorMsg; return false; |
||||
|
} |
||||
|
break; |
||||
|
case 'notnull': |
||||
|
if(data[rule[i].name] == null || data[rule[i].name].length < 1){this.error = rule[i].errorMsg; return false;} |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
return true; |
||||
|
}, |
||||
|
isNumber : function (checkVal){ |
||||
|
var reg = /^-?[1-9][0-9]?.?[0-9]*$/; |
||||
|
return reg.test(checkVal); |
||||
|
} |
||||
|
} |
@ -0,0 +1,352 @@ |
|||||
|
/* |
||||
|
* HTML5 Parser By Sam Blowes |
||||
|
* |
||||
|
* Designed for HTML5 documents |
||||
|
* |
||||
|
* Original code by John Resig (ejohn.org) |
||||
|
* http://ejohn.org/blog/pure-javascript-html-parser/
|
||||
|
* Original code by Erik Arvidsson, Mozilla Public License |
||||
|
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
|
||||
|
* |
||||
|
* ---------------------------------------------------------------------------- |
||||
|
* License |
||||
|
* ---------------------------------------------------------------------------- |
||||
|
* |
||||
|
* This code is triple licensed using Apache Software License 2.0, |
||||
|
* Mozilla Public License or GNU Public License |
||||
|
* |
||||
|
* ////////////////////////////////////////////////////////////////////////////
|
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||
|
* use this file except in compliance with the License. You may obtain a copy |
||||
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* ////////////////////////////////////////////////////////////////////////////
|
||||
|
* |
||||
|
* The contents of this file are subject to the Mozilla Public License |
||||
|
* Version 1.1 (the "License"); you may not use this file except in |
||||
|
* compliance with the License. You may obtain a copy of the License at |
||||
|
* http://www.mozilla.org/MPL/
|
||||
|
* |
||||
|
* Software distributed under the License is distributed on an "AS IS" |
||||
|
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
||||
|
* License for the specific language governing rights and limitations |
||||
|
* under the License. |
||||
|
* |
||||
|
* The Original Code is Simple HTML Parser. |
||||
|
* |
||||
|
* The Initial Developer of the Original Code is Erik Arvidsson. |
||||
|
* Portions created by Erik Arvidssson are Copyright (C) 2004. All Rights |
||||
|
* Reserved. |
||||
|
* |
||||
|
* ////////////////////////////////////////////////////////////////////////////
|
||||
|
* |
||||
|
* This program is free software; you can redistribute it and/or |
||||
|
* modify it under the terms of the GNU General Public License |
||||
|
* as published by the Free Software Foundation; either version 2 |
||||
|
* of the License, or (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program; if not, write to the Free Software |
||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
* |
||||
|
* ---------------------------------------------------------------------------- |
||||
|
* Usage |
||||
|
* ---------------------------------------------------------------------------- |
||||
|
* |
||||
|
* // Use like so:
|
||||
|
* HTMLParser(htmlString, { |
||||
|
* start: function(tag, attrs, unary) {}, |
||||
|
* end: function(tag) {}, |
||||
|
* chars: function(text) {}, |
||||
|
* comment: function(text) {} |
||||
|
* }); |
||||
|
* |
||||
|
* // or to get an XML string:
|
||||
|
* HTMLtoXML(htmlString); |
||||
|
* |
||||
|
* // or to get an XML DOM Document
|
||||
|
* HTMLtoDOM(htmlString); |
||||
|
* |
||||
|
* // or to inject into an existing document/DOM node
|
||||
|
* HTMLtoDOM(htmlString, document); |
||||
|
* HTMLtoDOM(htmlString, document.body); |
||||
|
* |
||||
|
*/ |
||||
|
// Regular Expressions for parsing tags and attributes
|
||||
|
var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/; |
||||
|
var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; |
||||
|
var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5
|
||||
|
|
||||
|
var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5
|
||||
|
// fixed by xxx 将 ins 标签从块级名单中移除
|
||||
|
|
||||
|
var block = makeMap('a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); // Inline Elements - HTML 5
|
||||
|
|
||||
|
var inline = makeMap('abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); // Elements that you can, intentionally, leave open
|
||||
|
// (and which close themselves)
|
||||
|
|
||||
|
var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled"
|
||||
|
|
||||
|
var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything)
|
||||
|
|
||||
|
var special = makeMap('script,style'); |
||||
|
function HTMLParser(html, handler) { |
||||
|
var index; |
||||
|
var chars; |
||||
|
var match; |
||||
|
var stack = []; |
||||
|
var last = html; |
||||
|
|
||||
|
stack.last = function () { |
||||
|
return this[this.length - 1]; |
||||
|
}; |
||||
|
|
||||
|
while (html) { |
||||
|
chars = true; // Make sure we're not in a script or style element
|
||||
|
|
||||
|
if (!stack.last() || !special[stack.last()]) { |
||||
|
// Comment
|
||||
|
if (html.indexOf('<!--') == 0) { |
||||
|
index = html.indexOf('-->'); |
||||
|
|
||||
|
if (index >= 0) { |
||||
|
if (handler.comment) { |
||||
|
handler.comment(html.substring(4, index)); |
||||
|
} |
||||
|
|
||||
|
html = html.substring(index + 3); |
||||
|
chars = false; |
||||
|
} // end tag
|
||||
|
|
||||
|
} else if (html.indexOf('</') == 0) { |
||||
|
match = html.match(endTag); |
||||
|
|
||||
|
if (match) { |
||||
|
html = html.substring(match[0].length); |
||||
|
match[0].replace(endTag, parseEndTag); |
||||
|
chars = false; |
||||
|
} // start tag
|
||||
|
|
||||
|
} else if (html.indexOf('<') == 0) { |
||||
|
match = html.match(startTag); |
||||
|
|
||||
|
if (match) { |
||||
|
html = html.substring(match[0].length); |
||||
|
match[0].replace(startTag, parseStartTag); |
||||
|
chars = false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (chars) { |
||||
|
index = html.indexOf('<'); |
||||
|
var text = index < 0 ? html : html.substring(0, index); |
||||
|
html = index < 0 ? '' : html.substring(index); |
||||
|
|
||||
|
if (handler.chars) { |
||||
|
handler.chars(text); |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
html = html.replace(new RegExp('([\\s\\S]*?)<\/' + stack.last() + '[^>]*>'), function (all, text) { |
||||
|
text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, '$1$2'); |
||||
|
|
||||
|
if (handler.chars) { |
||||
|
handler.chars(text); |
||||
|
} |
||||
|
|
||||
|
return ''; |
||||
|
}); |
||||
|
parseEndTag('', stack.last()); |
||||
|
} |
||||
|
|
||||
|
if (html == last) { |
||||
|
throw 'Parse Error: ' + html; |
||||
|
} |
||||
|
|
||||
|
last = html; |
||||
|
} // Clean up any remaining tags
|
||||
|
|
||||
|
|
||||
|
parseEndTag(); |
||||
|
|
||||
|
function parseStartTag(tag, tagName, rest, unary) { |
||||
|
tagName = tagName.toLowerCase(); |
||||
|
|
||||
|
if (block[tagName]) { |
||||
|
while (stack.last() && inline[stack.last()]) { |
||||
|
parseEndTag('', stack.last()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (closeSelf[tagName] && stack.last() == tagName) { |
||||
|
parseEndTag('', tagName); |
||||
|
} |
||||
|
|
||||
|
unary = empty[tagName] || !!unary; |
||||
|
|
||||
|
if (!unary) { |
||||
|
stack.push(tagName); |
||||
|
} |
||||
|
|
||||
|
if (handler.start) { |
||||
|
var attrs = []; |
||||
|
rest.replace(attr, function (match, name) { |
||||
|
var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : ''; |
||||
|
attrs.push({ |
||||
|
name: name, |
||||
|
value: value, |
||||
|
escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // "
|
||||
|
|
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
if (handler.start) { |
||||
|
handler.start(tagName, attrs, unary); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function parseEndTag(tag, tagName) { |
||||
|
// If no tag name is provided, clean shop
|
||||
|
if (!tagName) { |
||||
|
var pos = 0; |
||||
|
} // Find the closest opened tag of the same type
|
||||
|
else { |
||||
|
for (var pos = stack.length - 1; pos >= 0; pos--) { |
||||
|
if (stack[pos] == tagName) { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (pos >= 0) { |
||||
|
// Close all the open elements, up the stack
|
||||
|
for (var i = stack.length - 1; i >= pos; i--) { |
||||
|
if (handler.end) { |
||||
|
handler.end(stack[i]); |
||||
|
} |
||||
|
} // Remove the open elements from the stack
|
||||
|
|
||||
|
|
||||
|
stack.length = pos; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function makeMap(str) { |
||||
|
var obj = {}; |
||||
|
var items = str.split(','); |
||||
|
|
||||
|
for (var i = 0; i < items.length; i++) { |
||||
|
obj[items[i]] = true; |
||||
|
} |
||||
|
|
||||
|
return obj; |
||||
|
} |
||||
|
|
||||
|
function removeDOCTYPE(html) { |
||||
|
return html.replace(/<\?xml.*\?>\n/, '').replace(/<!doctype.*>\n/, '').replace(/<!DOCTYPE.*>\n/, ''); |
||||
|
} |
||||
|
|
||||
|
function parseAttrs(attrs) { |
||||
|
return attrs.reduce(function (pre, attr) { |
||||
|
var value = attr.value; |
||||
|
var name = attr.name; |
||||
|
|
||||
|
if (pre[name]) { |
||||
|
pre[name] = pre[name] + " " + value; |
||||
|
} else { |
||||
|
pre[name] = value; |
||||
|
} |
||||
|
|
||||
|
return pre; |
||||
|
}, {}); |
||||
|
} |
||||
|
|
||||
|
function parseHtml(html) { |
||||
|
html = removeDOCTYPE(html); |
||||
|
var stacks = []; |
||||
|
var results = { |
||||
|
node: 'root', |
||||
|
children: [] |
||||
|
}; |
||||
|
HTMLParser(html, { |
||||
|
start: function start(tag, attrs, unary) { |
||||
|
var node = { |
||||
|
name: tag |
||||
|
}; |
||||
|
|
||||
|
if (attrs.length !== 0) { |
||||
|
node.attrs = parseAttrs(attrs); |
||||
|
} |
||||
|
|
||||
|
if (unary) { |
||||
|
var parent = stacks[0] || results; |
||||
|
|
||||
|
if (!parent.children) { |
||||
|
parent.children = []; |
||||
|
} |
||||
|
|
||||
|
parent.children.push(node); |
||||
|
} else { |
||||
|
stacks.unshift(node); |
||||
|
} |
||||
|
}, |
||||
|
end: function end(tag) { |
||||
|
var node = stacks.shift(); |
||||
|
if (node.name !== tag) console.error('invalid state: mismatch end tag'); |
||||
|
|
||||
|
if (stacks.length === 0) { |
||||
|
results.children.push(node); |
||||
|
} else { |
||||
|
var parent = stacks[0]; |
||||
|
|
||||
|
if (!parent.children) { |
||||
|
parent.children = []; |
||||
|
} |
||||
|
|
||||
|
parent.children.push(node); |
||||
|
} |
||||
|
}, |
||||
|
chars: function chars(text) { |
||||
|
var node = { |
||||
|
type: 'text', |
||||
|
text: text |
||||
|
}; |
||||
|
|
||||
|
if (stacks.length === 0) { |
||||
|
results.children.push(node); |
||||
|
} else { |
||||
|
var parent = stacks[0]; |
||||
|
|
||||
|
if (!parent.children) { |
||||
|
parent.children = []; |
||||
|
} |
||||
|
|
||||
|
parent.children.push(node); |
||||
|
} |
||||
|
}, |
||||
|
comment: function comment(text) { |
||||
|
var node = { |
||||
|
node: 'comment', |
||||
|
text: text |
||||
|
}; |
||||
|
var parent = stacks[0]; |
||||
|
|
||||
|
if (!parent.children) { |
||||
|
parent.children = []; |
||||
|
} |
||||
|
|
||||
|
parent.children.push(node); |
||||
|
} |
||||
|
}); |
||||
|
return results.children; |
||||
|
} |
||||
|
|
||||
|
export default parseHtml; |
@ -0,0 +1,58 @@ |
|||||
|
import Vuex from 'vuex' |
||||
|
// 自定义弹窗
|
||||
|
export default function initModal(v) { |
||||
|
// 挂在store到全局Vue原型上
|
||||
|
v.prototype.$modalStore = new Vuex.Store({ |
||||
|
state: { |
||||
|
show: false, |
||||
|
title: "标题", |
||||
|
content: '内容', |
||||
|
showCancel: true, |
||||
|
cancelText: "取消", |
||||
|
cancelColor: "#333333", |
||||
|
cancelBackgroundColor: "rgba(236, 236, 236, 0.39)", |
||||
|
confirmText: "确定", |
||||
|
confirmColor: "#333333", |
||||
|
confirmBackgroundColor: "#FFBB24", |
||||
|
success: null, |
||||
|
}, |
||||
|
mutations: { |
||||
|
hideModal(state) { |
||||
|
// 小程序导航条页面控制
|
||||
|
// #ifndef H5
|
||||
|
if (state.hideTabBar) { |
||||
|
wx.showTabBar(); |
||||
|
} |
||||
|
// #endif
|
||||
|
state.show = false |
||||
|
}, |
||||
|
showModal(state, data) { |
||||
|
state = Object.assign(state, data) |
||||
|
console.log(state); |
||||
|
state.show = true |
||||
|
}, |
||||
|
success(state, res) { |
||||
|
let cb = state.success |
||||
|
let resObj = { |
||||
|
cancel: false, |
||||
|
confirm: false |
||||
|
} |
||||
|
res == "confirm" ? resObj.confirm = true : resObj.cancel = true |
||||
|
cb && cb(resObj) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
v.prototype.$showModal = function(option) { |
||||
|
if (typeof option === 'object') { |
||||
|
// #ifndef H5
|
||||
|
if (option.hideTabBar) { |
||||
|
wx.hideTabBar(); |
||||
|
} |
||||
|
// #endif
|
||||
|
|
||||
|
v.prototype.$modalStore.commit('showModal', option) |
||||
|
} else { |
||||
|
throw "配置项必须为对象传入的值为:" + typeof option; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,160 @@ |
|||||
|
let labelDic = []; |
||||
|
|
||||
|
import { |
||||
|
getLabelByHeader, |
||||
|
getPackageByNumber |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
|
||||
|
export function getLabelInfo(scanMsg, callBack) { |
||||
|
console.log('扫描信息:', scanMsg); |
||||
|
if (scanMsg.length == 0) { |
||||
|
return null |
||||
|
} |
||||
|
let items = scanMsg.split(';'); |
||||
|
let header = items[0]; |
||||
|
let version = items[1]; |
||||
|
if (header != '' && version != '') { |
||||
|
//解析扫描的是一维码还是二维码
|
||||
|
let type = header.substring(header.length - 1, header.length); |
||||
|
if (type == 'Q') //qrcode
|
||||
|
{ |
||||
|
getQRCodeInfo(header, version, scanMsg, callBack); |
||||
|
} else if (type == 'B') //barcode
|
||||
|
{ |
||||
|
getBarCodeInfo(header, version, items[2], callBack); |
||||
|
} else { //直接输入文本
|
||||
|
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function getQRCodeInfo(header, version, scanMsg, callBack) { |
||||
|
//获取包装信息
|
||||
|
let labelItem = labelDic.find(r => r.header == header && r.version == version); |
||||
|
if (labelItem == undefined) { |
||||
|
let labelResult = { |
||||
|
label: { |
||||
|
barType: 'QRCode', |
||||
|
}, |
||||
|
package: {}, |
||||
|
sucess: true, |
||||
|
message: '' |
||||
|
} |
||||
|
getLabelByHeader(header, version).then(res => { |
||||
|
if (res.data==null) { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = '未查找到标签头为[' + header + ']的标签类型'; |
||||
|
callBack(labelResult); |
||||
|
} else { |
||||
|
let newItem = { |
||||
|
header: header, |
||||
|
version: version, |
||||
|
label: res.data, |
||||
|
}; |
||||
|
|
||||
|
labelDic.push(newItem); |
||||
|
getLabelItems(newItem, scanMsg, callBack); |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = err; |
||||
|
callBack(err); |
||||
|
}) |
||||
|
} else { |
||||
|
getLabelItems(labelItem, scanMsg, callBack); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function getLabelItems(labelItem, scanMsg, callBack) { |
||||
|
let labelResult = analysisQRCodeLabel(labelItem, scanMsg); |
||||
|
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { |
||||
|
//查询包装信息
|
||||
|
let packingNumber = labelResult.label.packingNumber |
||||
|
if (packingNumber != undefined) { |
||||
|
getPackageByNumber(packingNumber).then(pack => { |
||||
|
if (pack.data.list.length == 0) { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; |
||||
|
} else { |
||||
|
labelResult.package = pack.data.list[0]; |
||||
|
console.log('包装信息', JSON.stringify(labelResult.package)) |
||||
|
} |
||||
|
callBack(labelResult); |
||||
|
}).catch(err => { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = err; |
||||
|
callBack(labelResult); |
||||
|
}) |
||||
|
} else { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = '在条码中未解析到箱码'; |
||||
|
callBack(labelResult); |
||||
|
} |
||||
|
} else { |
||||
|
callBack(labelResult); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function analysisQRCodeLabel(labelItem, scanMsg) { |
||||
|
let labelResult = { |
||||
|
label: { |
||||
|
labelType: labelItem.label.labelType, |
||||
|
barType: 'QRCode', |
||||
|
}, |
||||
|
package: {}, |
||||
|
sucess: true, |
||||
|
message: '' |
||||
|
} |
||||
|
|
||||
|
let separators = labelItem.label.separators; |
||||
|
if (separators == undefined || separators == null) { |
||||
|
labelResult.message = "未读取到分隔符"; |
||||
|
} else { |
||||
|
if (scanMsg.indexOf(separators) < 0) { |
||||
|
labelResult.sucess = false; |
||||
|
labelResult.message = "标签格式不正确"; |
||||
|
} else { |
||||
|
try { |
||||
|
let scanItems = scanMsg.split(separators); |
||||
|
if (scanItems.length > 0) { |
||||
|
scanItems.forEach((item, index) => { |
||||
|
let type = item.substring(0, 1); |
||||
|
let value = item.substring(1, item.length); |
||||
|
if (type == 'H') { |
||||
|
labelResult.label.header = item; |
||||
|
} else if (type == 'V') { |
||||
|
labelResult.label.version = item; |
||||
|
} else { |
||||
|
let barcode = labelItem.label.subList.find(code => code.prefixChar.toUpperCase() == |
||||
|
type |
||||
|
.toUpperCase()); |
||||
|
if (barcode != undefined) { |
||||
|
labelResult.label[barcode.code] = value; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} catch (e) { |
||||
|
labelResult.message = e.message; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
// console.log('标签', labelResult.label)
|
||||
|
return labelResult; |
||||
|
} |
||||
|
|
||||
|
export function getBarCodeInfo(header, version, value, callBack) { |
||||
|
let labelResult = { |
||||
|
label: { |
||||
|
labelType: header, |
||||
|
barType: 'BarCode', |
||||
|
code:value |
||||
|
}, |
||||
|
package: null, |
||||
|
sucess: true, |
||||
|
message: '', |
||||
|
} |
||||
|
callBack(labelResult); |
||||
|
} |
@ -0,0 +1,112 @@ |
|||||
|
import * as dd from 'dingtalk-jsapi'; |
||||
|
import store from '@/store/index' |
||||
|
|
||||
|
let showAlert=true |
||||
|
|
||||
|
let message = { |
||||
|
error: function (msg) { //进入项目初始化配置
|
||||
|
uni.showToast({ |
||||
|
title: msg, |
||||
|
icon: "none" |
||||
|
}); |
||||
|
}, |
||||
|
alert:function (message) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
if (showAlert){ |
||||
|
dd.device.notification.alert({ |
||||
|
message: message, |
||||
|
title: "提示", |
||||
|
buttonName: "收到", |
||||
|
onSuccess : function(res) { |
||||
|
// 调用成功时回调
|
||||
|
console.log(res) |
||||
|
}, |
||||
|
onFail : function(err) { |
||||
|
// 调用失败时回调
|
||||
|
console.log(err) |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
let selectD = { |
||||
|
selectPeo: function (option) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
dd.biz.contact.complexPicker({ |
||||
|
title: option.title ? option.title : "选择人员", //标题
|
||||
|
corpId: store.state.corpId, //企业的corpId
|
||||
|
multiple: option.multiple ? option.multiple : true, //是否多选
|
||||
|
limitTips: option.limitTips ? option.limitTips : "超出了", //超过限定人数返回提示
|
||||
|
maxUsers: option.maxUsers ? option.maxUsers : 100, //最大可选人数
|
||||
|
pickedUsers: option.pickedUsers ? option.pickedUsers : [], //已选用户
|
||||
|
pickedDepartments: option.pickedDepartments ? option.pickedDepartments :[], //已选部门
|
||||
|
disabledUsers: option.disabledUsers ? option.disabledUsers :[], //不可选用户
|
||||
|
disabledDepartments: option.disabledDepartments ? option.disabledDepartments :[], //不可选部门
|
||||
|
requiredUsers: option.requiredUsers ? option.requiredUsers :[], //必选用户(不可取消选中状态)
|
||||
|
requiredDepartments: option.requiredDepartments ? option.requiredDepartments :[], //必选部门(不可取消选中状态)
|
||||
|
appId: store.state.agentId, //微应用Id,企业内部应用查看AgentId
|
||||
|
permissionType: "GLOBAL", //可添加权限校验,选人权限,目前只有GLOBAL这个参数
|
||||
|
responseUserOnly: true, //返回人,或者返回人和部门
|
||||
|
startWithDepartmentId: 0, //仅支持0和-1
|
||||
|
onSuccess: function (result) { |
||||
|
// alert(JSON.stringify(result))
|
||||
|
resolve(result); |
||||
|
/** |
||||
|
{ |
||||
|
selectedCount:1, //选择人数
|
||||
|
users:[{"name":"","avatar":"","emplId ":""}],//返回选人的列表,列表中的对象包含name(用户名),avatar(用户头像),emplId(用户工号)三个字段
|
||||
|
departments:[{"id":,"name":"","number":}]//返回已选部门列表,列表中每个对象包含id(部门id)、name(部门名称)、number(部门人数)
|
||||
|
} |
||||
|
*/ |
||||
|
}, |
||||
|
onFail: function (err) { |
||||
|
alert("唤起联系人失败"); |
||||
|
reject(err) |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
selectDept: function (option) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
dd.biz.contact.departmentsPicker({ |
||||
|
title: option.title ? option.title : "选择部门", //标题
|
||||
|
corpId: store.state.corpId, //企业的corpId
|
||||
|
multiple: option.multiple ? option.multiple : true, //是否多选
|
||||
|
limitTips: option.limitTips ? option.limitTips : "超出了", //超过限定人数返回提示
|
||||
|
maxDepartments: option.maxDepartments ? option.maxDepartments : 100, //最大可选部门
|
||||
|
pickedDepartments: option.pickedDepartments ? option.pickedDepartments :[], //已选部门
|
||||
|
disabledDepartments: option.disabledDepartments ? option.disabledDepartments :[], //不可选部门
|
||||
|
requiredDepartments: option.requiredDepartments ? option.requiredDepartments :[], //必选部门(不可取消选中状态)
|
||||
|
appId: store.state.agentId, //微应用Id,企业内部应用查看AgentId
|
||||
|
permissionType: "GLOBAL", //可添加权限校验,选人权限,目前只有GLOBAL这个参数
|
||||
|
onSuccess: function (result) { |
||||
|
|
||||
|
resolve(result); |
||||
|
/** |
||||
|
{ |
||||
|
"userCount":10, //选择人数。
|
||||
|
"departments":[ |
||||
|
{ |
||||
|
"number":10, |
||||
|
"name":"班车2", |
||||
|
"id":405921063 |
||||
|
} |
||||
|
], //返回已选部门列表,列表中每个对象包含id (部门id)、name (部门名称)、number (部门人数)。
|
||||
|
"departmentsCount":1 //选择的部门数。
|
||||
|
} |
||||
|
*/ |
||||
|
}, |
||||
|
onFail: function (err) { |
||||
|
alert("唤起部门失败"); |
||||
|
reject(err) |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
message, |
||||
|
selectD |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
let maxPageSize = 10; |
||||
|
|
||||
|
export default{ |
||||
|
maxPageSize |
||||
|
} |
@ -0,0 +1,245 @@ |
|||||
|
/// null = 未请求,1 = 已允许,0 = 拒绝|受限, 2 = 系统未开启
|
||||
|
|
||||
|
var isIOS |
||||
|
|
||||
|
function album() { |
||||
|
var result = 0; |
||||
|
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary"); |
||||
|
var authStatus = PHPhotoLibrary.authorizationStatus(); |
||||
|
if (authStatus === 0) { |
||||
|
result = null; |
||||
|
} else if (authStatus == 3) { |
||||
|
result = 1; |
||||
|
} else { |
||||
|
result = 0; |
||||
|
} |
||||
|
plus.ios.deleteObject(PHPhotoLibrary); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function camera() { |
||||
|
var result = 0; |
||||
|
var AVCaptureDevice = plus.ios.import("AVCaptureDevice"); |
||||
|
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide'); |
||||
|
if (authStatus === 0) { |
||||
|
result = null; |
||||
|
} else if (authStatus == 3) { |
||||
|
result = 1; |
||||
|
} else { |
||||
|
result = 0; |
||||
|
} |
||||
|
plus.ios.deleteObject(AVCaptureDevice); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function location() { |
||||
|
var result = 0; |
||||
|
var cllocationManger = plus.ios.import("CLLocationManager"); |
||||
|
var enable = cllocationManger.locationServicesEnabled(); |
||||
|
var status = cllocationManger.authorizationStatus(); |
||||
|
if (!enable) { |
||||
|
result = 2; |
||||
|
} else if (status === 0) { |
||||
|
result = null; |
||||
|
} else if (status === 3 || status === 4) { |
||||
|
result = 1; |
||||
|
} else { |
||||
|
result = 0; |
||||
|
} |
||||
|
plus.ios.deleteObject(cllocationManger); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function push() { |
||||
|
var result = 0; |
||||
|
var UIApplication = plus.ios.import("UIApplication"); |
||||
|
var app = UIApplication.sharedApplication(); |
||||
|
var enabledTypes = 0; |
||||
|
if (app.currentUserNotificationSettings) { |
||||
|
var settings = app.currentUserNotificationSettings(); |
||||
|
enabledTypes = settings.plusGetAttribute("types"); |
||||
|
if (enabledTypes == 0) { |
||||
|
result = 0; |
||||
|
console.log("推送权限没有开启"); |
||||
|
} else { |
||||
|
result = 1; |
||||
|
console.log("已经开启推送功能!") |
||||
|
} |
||||
|
plus.ios.deleteObject(settings); |
||||
|
} else { |
||||
|
enabledTypes = app.enabledRemoteNotificationTypes(); |
||||
|
if (enabledTypes == 0) { |
||||
|
result = 3; |
||||
|
console.log("推送权限没有开启!"); |
||||
|
} else { |
||||
|
result = 4; |
||||
|
console.log("已经开启推送功能!") |
||||
|
} |
||||
|
} |
||||
|
plus.ios.deleteObject(app); |
||||
|
plus.ios.deleteObject(UIApplication); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function contact() { |
||||
|
var result = 0; |
||||
|
var CNContactStore = plus.ios.import("CNContactStore"); |
||||
|
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0); |
||||
|
if (cnAuthStatus === 0) { |
||||
|
result = null; |
||||
|
} else if (cnAuthStatus == 3) { |
||||
|
result = 1; |
||||
|
} else { |
||||
|
result = 0; |
||||
|
} |
||||
|
plus.ios.deleteObject(CNContactStore); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function record() { |
||||
|
var result = null; |
||||
|
var avaudiosession = plus.ios.import("AVAudioSession"); |
||||
|
var avaudio = avaudiosession.sharedInstance(); |
||||
|
var status = avaudio.recordPermission(); |
||||
|
console.log("permissionStatus:" + status); |
||||
|
if (status === 1970168948) { |
||||
|
result = null; |
||||
|
} else if (status === 1735552628) { |
||||
|
result = 1; |
||||
|
} else { |
||||
|
result = 0; |
||||
|
} |
||||
|
plus.ios.deleteObject(avaudiosession); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function calendar() { |
||||
|
var result = null; |
||||
|
var EKEventStore = plus.ios.import("EKEventStore"); |
||||
|
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0); |
||||
|
if (ekAuthStatus == 3) { |
||||
|
result = 1; |
||||
|
console.log("日历权限已经开启"); |
||||
|
} else { |
||||
|
console.log("日历权限没有开启"); |
||||
|
} |
||||
|
plus.ios.deleteObject(EKEventStore); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
function memo() { |
||||
|
var result = null; |
||||
|
var EKEventStore = plus.ios.import("EKEventStore"); |
||||
|
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1); |
||||
|
if (ekAuthStatus == 3) { |
||||
|
result = 1; |
||||
|
console.log("备忘录权限已经开启"); |
||||
|
} else { |
||||
|
console.log("备忘录权限没有开启"); |
||||
|
} |
||||
|
plus.ios.deleteObject(EKEventStore); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
function requestIOS(permissionID) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
switch (permissionID) { |
||||
|
case "push": |
||||
|
resolve(push()); |
||||
|
break; |
||||
|
case "location": |
||||
|
resolve(location()); |
||||
|
break; |
||||
|
case "record": |
||||
|
resolve(record()); |
||||
|
break; |
||||
|
case "camera": |
||||
|
resolve(camera()); |
||||
|
break; |
||||
|
case "album": |
||||
|
resolve(album()); |
||||
|
break; |
||||
|
case "contact": |
||||
|
resolve(contact()); |
||||
|
break; |
||||
|
case "calendar": |
||||
|
resolve(calendar()); |
||||
|
break; |
||||
|
case "memo": |
||||
|
resolve(memo()); |
||||
|
break; |
||||
|
default: |
||||
|
resolve(0); |
||||
|
break; |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function requestAndroid(permissionID) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
plus.android.requestPermissions( |
||||
|
[permissionID], |
||||
|
function(resultObj) { |
||||
|
var result = 0; |
||||
|
for (var i = 0; i < resultObj.granted.length; i++) { |
||||
|
var grantedPermission = resultObj.granted[i]; |
||||
|
console.log('已获取的权限:' + grantedPermission); |
||||
|
result = 1 |
||||
|
} |
||||
|
for (var i = 0; i < resultObj.deniedPresent.length; i++) { |
||||
|
var deniedPresentPermission = resultObj.deniedPresent[i]; |
||||
|
console.log('拒绝本次申请的权限:' + deniedPresentPermission); |
||||
|
result = 0 |
||||
|
} |
||||
|
for (var i = 0; i < resultObj.deniedAlways.length; i++) { |
||||
|
var deniedAlwaysPermission = resultObj.deniedAlways[i]; |
||||
|
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission); |
||||
|
result = -1 |
||||
|
} |
||||
|
resolve(result); |
||||
|
}, |
||||
|
function(error) { |
||||
|
console.log('result error: ' + error.message) |
||||
|
resolve({ |
||||
|
code: error.code, |
||||
|
message: error.message |
||||
|
}); |
||||
|
} |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function gotoAppPermissionSetting() { |
||||
|
if (permission.isIOS) { |
||||
|
var UIApplication = plus.ios.import("UIApplication"); |
||||
|
var application2 = UIApplication.sharedApplication(); |
||||
|
var NSURL2 = plus.ios.import("NSURL"); |
||||
|
var setting2 = NSURL2.URLWithString("app-settings:"); |
||||
|
application2.openURL(setting2); |
||||
|
plus.ios.deleteObject(setting2); |
||||
|
plus.ios.deleteObject(NSURL2); |
||||
|
plus.ios.deleteObject(application2); |
||||
|
} else { |
||||
|
var Intent = plus.android.importClass("android.content.Intent"); |
||||
|
var Settings = plus.android.importClass("android.provider.Settings"); |
||||
|
var Uri = plus.android.importClass("android.net.Uri"); |
||||
|
var mainActivity = plus.android.runtimeMainActivity(); |
||||
|
var intent = new Intent(); |
||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); |
||||
|
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null); |
||||
|
intent.setData(uri); |
||||
|
mainActivity.startActivity(intent); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
const permission = { |
||||
|
get isIOS(){ |
||||
|
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios') |
||||
|
}, |
||||
|
requestIOS: requestIOS, |
||||
|
requestAndroid: requestAndroid, |
||||
|
gotoAppSetting: gotoAppPermissionSetting |
||||
|
} |
||||
|
|
||||
|
export default permission |
@ -0,0 +1,26 @@ |
|||||
|
import urlConfig from './config.js' |
||||
|
const promise = {} |
||||
|
|
||||
|
promise.asyncRequest = (url, options = {}, power) => { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
uni.request({ |
||||
|
url: url, |
||||
|
...options, //data,method...
|
||||
|
header: { |
||||
|
"content-type": "application/json", |
||||
|
'withCredentials': true, |
||||
|
'Authorization': localStorage.token_type, |
||||
|
// 'Authorization': localStorage.token_type,
|
||||
|
...options.header, |
||||
|
}, |
||||
|
success: (res) => { |
||||
|
resolve(res.data); |
||||
|
}, |
||||
|
fail: (err) => { |
||||
|
reject(err) |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default promise.asyncRequest |
@ -0,0 +1,68 @@ |
|||||
|
import { |
||||
|
getBusinesstypeByCode |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
getDirectoryItemArray, |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
export function createItemInfo(balance, pack) { |
||||
|
let item = { |
||||
|
itemCode: pack.itemCode, |
||||
|
itemName: pack.itemName, |
||||
|
stdPackQty: pack.stdPackQty, |
||||
|
stdPackUnit: pack.stdPackUnit, |
||||
|
qty: Number(balance.qty), |
||||
|
handleQty: 0, |
||||
|
uom: pack.uom, |
||||
|
details: [] |
||||
|
} |
||||
|
return item; |
||||
|
} |
||||
|
export function createDetailInfo(data, pack) { |
||||
|
data.scaned = true; |
||||
|
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
|
||||
|
let detail = {}; |
||||
|
Object.assign(detail, data) |
||||
|
detail.balanceQty = Number(detail.qty) |
||||
|
detail.package = pack; |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
//计算实际数量
|
||||
|
export function calcHandleQty(detailSource) { |
||||
|
for (let item of detailSource) { |
||||
|
item.qty = 0; |
||||
|
for (let detail of item.details) { |
||||
|
if (detail != undefined && detail.scaned) { |
||||
|
item.qty = item.qty + Number(detail.qty) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export function getBusinessType(typeCode, callback) { |
||||
|
let result = { |
||||
|
success: true, |
||||
|
businessType: '', |
||||
|
fromlocationTypeList: '', |
||||
|
tolocationTypeList: '', |
||||
|
message: '' |
||||
|
}; |
||||
|
getBusinesstypeByCode(typeCode).then(res => { |
||||
|
if (res.data.total > 0) { |
||||
|
result.businessType = res.data.list[0]; |
||||
|
result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) |
||||
|
result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) |
||||
|
callback(result) |
||||
|
} else { |
||||
|
result.success = false; |
||||
|
result.message = '业务类型[' + typeCode + ']获取失败'; |
||||
|
callback(result) |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
result.success = false; |
||||
|
result.message = error; |
||||
|
callback(result) |
||||
|
}) |
||||
|
} |
@ -0,0 +1,123 @@ |
|||||
|
import urlConfig from './config.js' |
||||
|
// import store from '@/store/index'
|
||||
|
const request = {} |
||||
|
|
||||
|
request.globalRequest = (url, options = {}, power) => { |
||||
|
/* 权限判断 因为有的接口请求头可能需要添加的参数不一样,所以这里做了区分 |
||||
|
1 == 不通过access_token校验的接口 |
||||
|
2 == 文件下载接口列表 |
||||
|
3 == 验证码登录 */ |
||||
|
|
||||
|
let contentType = localStorage.token_type ? "application/json" : "application/x-www-form-urlencoded"; |
||||
|
|
||||
|
return new Promise((resolve, reject) => { |
||||
|
uni.request({ |
||||
|
url: url, |
||||
|
...options, //data,method...
|
||||
|
header: { |
||||
|
"content-type": contentType, |
||||
|
"Authorization": localStorage.token_type, |
||||
|
'withCredentials': true, |
||||
|
// 'Blade-Auth':'bearer '+store.state.token,
|
||||
|
'token_type': localStorage.token_type, |
||||
|
...options.header, |
||||
|
}, |
||||
|
success: (res) => { |
||||
|
if (res != null) { |
||||
|
if (res.statusCode != null) { |
||||
|
let statusCode = res.statusCode.toString(); |
||||
|
// 状态码类型 2开头的全是成功
|
||||
|
let code = statusCode.substring(0, 1); |
||||
|
if (statusCode == '200') { |
||||
|
resolve(res.data); |
||||
|
} else if (statusCode == '204') { |
||||
|
if (options.method == 'get') { |
||||
|
reject("没查到") |
||||
|
} else { |
||||
|
resolve(res.data) |
||||
|
} |
||||
|
} else if (statusCode == '400') { |
||||
|
if (res.data.error) { |
||||
|
if (res.data.error.message) { |
||||
|
reject(res.data.error.message); |
||||
|
} |
||||
|
} else if (res.data.errors) { |
||||
|
let errors = res.data.errors; |
||||
|
let errorMsg = '请求参数错误:\n'; |
||||
|
let keys = Object.keys(errors); |
||||
|
for (var i = 0; i < keys.length; i++) { |
||||
|
let key = keys[i]; |
||||
|
let value = errors[key]; |
||||
|
errorMsg += i + 1 + ':' + value + '\n'; |
||||
|
} |
||||
|
reject(errorMsg); |
||||
|
} |
||||
|
} else if (statusCode == '404') { |
||||
|
if (res.data === '') { |
||||
|
reject('未找到接口'); |
||||
|
} else { |
||||
|
reject(res.data); |
||||
|
} |
||||
|
} else if (statusCode == '403') { |
||||
|
let message = res.data.error.message; |
||||
|
if (message) { |
||||
|
let temp; |
||||
|
try { |
||||
|
temp = JSON.parse(message) |
||||
|
} catch (err) { |
||||
|
reject(message); |
||||
|
} |
||||
|
if (temp) { |
||||
|
var hintError = temp.error; |
||||
|
var hintErrorDes = temp.error_description; |
||||
|
if (hintError == 'invalid_grant') { |
||||
|
if (hintErrorDes.includes( |
||||
|
'Invalid username or password!')) { |
||||
|
reject('用户名或密码错误'); |
||||
|
} else if (hintErrorDes.includes( |
||||
|
'The user account has been locked out due to invalid login attempts' |
||||
|
)) { |
||||
|
reject("账号已被锁定,请稍后再试"); |
||||
|
} |
||||
|
} else { |
||||
|
reject(message) |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
reject(res.statusCode + "错误") |
||||
|
} |
||||
|
} else { |
||||
|
let message = res.data.error.message; |
||||
|
if (message != undefined) { |
||||
|
reject(res.data.error.message) |
||||
|
} else { |
||||
|
reject(res.statusCode + "错误") |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
reject('options.url' + "返回的状态码类型为空") |
||||
|
} |
||||
|
} else { |
||||
|
reject('options.url' + "返回的res为空") |
||||
|
} |
||||
|
}, |
||||
|
fail: (eror) => { |
||||
|
reject(eror) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
// .catch(params => {
|
||||
|
// reject(params);
|
||||
|
// })
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
export default request.globalRequest |
||||
|
|
||||
|
// 最终发送给服务器的数据是 String 类型,如果传入的 data 不是 String 类型,会被转换成 String。转换规则如下:
|
||||
|
|
||||
|
// 对于 GET 方法,会将数据转换为 query string。例如 { name: 'name', age: 18 } 转换后的结果是 name=name&age=18。
|
||||
|
// 对于 POST 方法且 header['content-type'] 为 application/json 的数据,会进行 JSON 序列化。
|
||||
|
// 对于 POST 方法且 header['content-type'] 为 application/x-www-form-urlencoded 的数据,会将数据转换为 query string。
|
@ -0,0 +1,103 @@ |
|||||
|
import urlConfig from './config.js' |
||||
|
// import store from '@/store/index'
|
||||
|
|
||||
|
function service(options = {}) { |
||||
|
let contentType = localStorage.token_type ? "application/json" : "application/x-www-form-urlencoded"; |
||||
|
options.header = { |
||||
|
"content-type": contentType, |
||||
|
"Authorization": localStorage.token_type, |
||||
|
'withCredentials': true, |
||||
|
// 'Blade-Auth':'bearer '+store.state.token,
|
||||
|
'token_type': localStorage.token_type |
||||
|
}; |
||||
|
return new Promise((resolve, reject) => { |
||||
|
options.success = (res) => { |
||||
|
console.log("请求成功", res); |
||||
|
// 如果请求回来的状态码不是200则执行以下操作
|
||||
|
if (res != null ) { |
||||
|
if (res.statusCode != null) { |
||||
|
let statusCode = res.statusCode.toString(); |
||||
|
// 状态码类型 2开头的全是成功
|
||||
|
let code = statusCode.substring(0, 1); |
||||
|
if (statusCode == '200') { |
||||
|
resolve(res.data); |
||||
|
} else if (statusCode == '204') { |
||||
|
if (options.method == 'get') { |
||||
|
return null; |
||||
|
} else { |
||||
|
reject(res.data) |
||||
|
} |
||||
|
} else if (statusCode == '400') { |
||||
|
if (res.data.error) { |
||||
|
if (res.data.error.message) { |
||||
|
reject(res.data.error.message); |
||||
|
} |
||||
|
} else if (res.data.errors) { |
||||
|
let errors = res.data.errors; |
||||
|
let errorMsg = '请求参数错误:\n'; |
||||
|
let keys = Object.keys(errors); |
||||
|
for (var i = 0; i < keys.length; i++) { |
||||
|
let key = keys[i]; |
||||
|
let value = errors[key]; |
||||
|
errorMsg += i + 1 + ':' + value + '\n'; |
||||
|
} |
||||
|
reject(errorMsg); |
||||
|
} |
||||
|
} else if (statusCode == '404') { |
||||
|
if (res.data === '') { |
||||
|
reject('未找到接口'); |
||||
|
} else { |
||||
|
reject(res.data); |
||||
|
} |
||||
|
} |
||||
|
else if (statusCode == '403') { |
||||
|
let message = res.data.error.message; |
||||
|
if (message) { |
||||
|
let temp; |
||||
|
try { |
||||
|
temp = JSON.parse(message) |
||||
|
} catch (err) { |
||||
|
reject(message) ; |
||||
|
} |
||||
|
if (temp) { |
||||
|
var hintError = temp.error; |
||||
|
var hintErrorDes = temp.error_description; |
||||
|
if (hintError == 'invalid_grant') { |
||||
|
if (hintErrorDes.includes('Invalid username or password!')) { |
||||
|
reject('用户名或密码错误'); |
||||
|
} else if (hintErrorDes.includes( |
||||
|
'The user account has been locked out due to invalid login attempts' |
||||
|
)) { |
||||
|
reject("账号已被锁定,请稍后再试"); |
||||
|
} |
||||
|
} else { |
||||
|
reject(message) |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
reject(res.statusCode + "错误") |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
let message = res.data.error.message; |
||||
|
if (message != undefined) { |
||||
|
reject(res.data.error.message) |
||||
|
} else { |
||||
|
reject(res.statusCode + "错误") |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
reject('options.url' + "返回的状态码类型为空") |
||||
|
} |
||||
|
} else { |
||||
|
reject('options.url' + "返回的res为空") |
||||
|
} |
||||
|
}; |
||||
|
options.fail = (err) => { |
||||
|
reject(err); |
||||
|
}; |
||||
|
uni.request(options); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default service; |
@ -0,0 +1,309 @@ |
|||||
|
//解析扫描信息
|
||||
|
//P2251076NAA;L220325;Q2000;N0205183222000006;SS0000066;V02051832;OPO1072;C15;
|
||||
|
//解析规则
|
||||
|
//P:itemCode 物料号
|
||||
|
//L:lot批次
|
||||
|
//Q:qty 数量
|
||||
|
//N:asn 供应商商发货单 ASN
|
||||
|
//S:packingCode 箱码
|
||||
|
//T:containerCode托盘
|
||||
|
//V:supplierCode 供应商代码
|
||||
|
//O: order订单号
|
||||
|
//C: poLine订单行
|
||||
|
//B:supplierBatch 供应商批次
|
||||
|
|
||||
|
//返回结果
|
||||
|
//sucess true:成功 false:失败
|
||||
|
//scanType barcode:条码 qrcode:二维码
|
||||
|
//isPack true:箱码 false:托码
|
||||
|
export function analyseScanInfo(scanMsg) { |
||||
|
let scanResult = { |
||||
|
sucess: false, |
||||
|
message: "", |
||||
|
data: { |
||||
|
isPack: null, |
||||
|
scanType: null, |
||||
|
itemCode: null, |
||||
|
batch: null, |
||||
|
qty: null, |
||||
|
asn: null, |
||||
|
packingNumber: null, |
||||
|
supplierBatch: null, |
||||
|
order: null, |
||||
|
poLine: null, |
||||
|
code: null, |
||||
|
} |
||||
|
}; |
||||
|
if (scanMsg === "") { |
||||
|
scanResult.message = "扫描到的内容为空"; |
||||
|
} else { |
||||
|
try { |
||||
|
console.log('1.扫描到的内容:', scanMsg); |
||||
|
//条码
|
||||
|
if (scanMsg.indexOf(';') < 0) { |
||||
|
scanResult.sucess = true; |
||||
|
scanResult.data.code = scanMsg; |
||||
|
scanResult.data.scanType = 'barcode'; //条码
|
||||
|
} else { |
||||
|
let arrayItems = scanMsg.split(';'); |
||||
|
if (arrayItems.length > 0) { |
||||
|
scanResult.data.scanType = 'qrcode'; //二维码
|
||||
|
scanResult.data["test"] = 'test'; |
||||
|
arrayItems.forEach((item, index) => { |
||||
|
if (item != "") { |
||||
|
let type = item.substring(0, 1); |
||||
|
let value = item.substring(1, item.length); |
||||
|
if (type != "") { |
||||
|
scanResult.data.scanType = 'qrcode'; |
||||
|
switch (type) { |
||||
|
case "P": //物料号
|
||||
|
case "p": |
||||
|
scanResult.data.itemCode = value; |
||||
|
break; |
||||
|
case "L": //批次
|
||||
|
case "l": |
||||
|
scanResult.data.lot = value; |
||||
|
break; |
||||
|
case "Q": //数量
|
||||
|
case "q": |
||||
|
scanResult.data.qty = value; |
||||
|
break; |
||||
|
case "N": //供应商商发货单 ASN
|
||||
|
case "n": |
||||
|
scanResult.data.asn = value; |
||||
|
break; |
||||
|
case "S": //箱码
|
||||
|
case "s": |
||||
|
scanResult.data.packingNumber = value; |
||||
|
scanResult.data.isPack = true; |
||||
|
break; |
||||
|
case "T": //托盘
|
||||
|
case "t": |
||||
|
scanResult.data.containerCode = value; |
||||
|
scanResult.data.isPack = false; |
||||
|
break; |
||||
|
case "V": //供应商批次
|
||||
|
case "v": |
||||
|
scanResult.data.supplierCode = value; |
||||
|
break; |
||||
|
case "O": //订单号
|
||||
|
case "o": |
||||
|
scanResult.data.order = value; |
||||
|
break; |
||||
|
case "C": //订单行
|
||||
|
case "c": |
||||
|
scanResult.data.poLine = value; |
||||
|
break; |
||||
|
case "B": //供应商批次
|
||||
|
case "b": |
||||
|
scanResult.data.supplierBatch = value; |
||||
|
break; |
||||
|
// default: //条码
|
||||
|
// scanResult.data.code = item;
|
||||
|
// scanResult.data.scanType = 'barcode';
|
||||
|
// break;
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
scanResult.sucess = true; |
||||
|
} else { //扫描的是条码,直接返回接收到的内容
|
||||
|
scanResult.sucess = true; |
||||
|
scanResult.data.code = scanMsg; |
||||
|
scanResult.data.scanType = 'barcode'; |
||||
|
} |
||||
|
} |
||||
|
} catch (ex) { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "解析遇到异常" + ex.message; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return scanResult; |
||||
|
} |
||||
|
|
||||
|
//解析完工收货标签
|
||||
|
//P2250229RAA;L220408;Q100;N62840610;SB0000107;UEA;DU571LS;FA;E2022-4-8
|
||||
|
//P零件号,L批次,Q数量,N生产计划号,S箱码,U计量单位,D生产线,F班次,E日期,M零件名称(待添加)
|
||||
|
//解析规则
|
||||
|
//P:itemCode 物料号
|
||||
|
//L:lot批次
|
||||
|
//Q:qty 数量
|
||||
|
//N:pnumber productionPlanNumber生产计划号
|
||||
|
//S:packingCode 箱码
|
||||
|
//U:uom 计量单位
|
||||
|
//D:prodLine 生产线
|
||||
|
//F:shift 班次
|
||||
|
//E:produceDate日期
|
||||
|
|
||||
|
//返回结果
|
||||
|
//sucess true:成功 false:失败
|
||||
|
//scanType barcode:条码 qrcode:二维码
|
||||
|
//isPack true:箱码 false:托码
|
||||
|
export function analyseProductLabelInfo(scanMsg) { |
||||
|
let scanResult = { |
||||
|
sucess: false, |
||||
|
message: "", |
||||
|
data: { |
||||
|
itemCode: null, |
||||
|
lot: null, |
||||
|
qty: null, |
||||
|
pnumber: null, |
||||
|
packingCode: null, |
||||
|
uom: null, |
||||
|
prodLine: null, |
||||
|
shift: null, |
||||
|
produceDate: null |
||||
|
} |
||||
|
}; |
||||
|
if (scanMsg == "") { |
||||
|
scanResult.message = "扫描到的内容为空"; |
||||
|
} else { |
||||
|
try { |
||||
|
//条码
|
||||
|
if (scanMsg.indexOf(';') < 0) { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签格式不正确"; |
||||
|
} else { |
||||
|
let arrayItems = scanMsg.split(';'); |
||||
|
if (arrayItems.length > 0) { |
||||
|
arrayItems.forEach((item, index) => { |
||||
|
if (item != "") { |
||||
|
let type = item.substring(0, 1); |
||||
|
let value = item.substring(1, item.length); |
||||
|
if (type != "") { |
||||
|
switch (type) { |
||||
|
case "P": //物料号
|
||||
|
case "p": |
||||
|
scanResult.data.itemCode = value; |
||||
|
break; |
||||
|
case "L": //批次
|
||||
|
case "l": |
||||
|
scanResult.data.lot = value; |
||||
|
break; |
||||
|
case "Q": //数量
|
||||
|
case "q": |
||||
|
scanResult.data.qty = value; |
||||
|
break; |
||||
|
case "N": //生产计划号 ASN
|
||||
|
case "n": |
||||
|
scanResult.data.pnumber = value; |
||||
|
break; |
||||
|
case "S": //箱码
|
||||
|
case "s": |
||||
|
scanResult.data.packingCode = value; |
||||
|
break; |
||||
|
case "U": //计量单位
|
||||
|
case "u": |
||||
|
scanResult.data.uom = value; |
||||
|
break; |
||||
|
case "D": //生产线
|
||||
|
case "d": |
||||
|
scanResult.data.prodLine = value; |
||||
|
break; |
||||
|
case "F": //班次
|
||||
|
case "f": |
||||
|
scanResult.data.shift = value; |
||||
|
break; |
||||
|
case "E": //日期
|
||||
|
case "e": |
||||
|
scanResult.data.produceDate = value; |
||||
|
break; |
||||
|
default: |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "无法识别的前缀" + type; |
||||
|
break; |
||||
|
} |
||||
|
scanResult.sucess = true; |
||||
|
} else { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签信息不能为空" + type; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
} else { //扫描的是条码,直接返回接收到的内容
|
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签分隔符错误"; |
||||
|
} |
||||
|
} |
||||
|
} catch (ex) { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "解析遇到异常" + ex.message; |
||||
|
} |
||||
|
} |
||||
|
return scanResult; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//解析天津mes标签
|
||||
|
//1#2546319FL#254FL003#202207110009:
|
||||
|
//1.序号1,2.生产号2546311FL,3.零件号254FL004,4.批序号202207110009
|
||||
|
export function analyseTJMesQRCode(scanMsg) { |
||||
|
let scanResult = { |
||||
|
sucess: false, |
||||
|
message: "", |
||||
|
items: [] |
||||
|
}; |
||||
|
if (scanMsg == "") { |
||||
|
scanResult.message = "扫描到的内容为空"; |
||||
|
} else { |
||||
|
try { |
||||
|
if (scanMsg.indexOf(':') < 0) { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签格式不正确"; |
||||
|
} else { |
||||
|
let arrayItems = scanMsg.split(':'); |
||||
|
if (arrayItems.length > 0) { |
||||
|
arrayItems.forEach((item, index) => { |
||||
|
if (item != "") { |
||||
|
if (item.includes('#')) { |
||||
|
let datas = item.split('#'); |
||||
|
//为空时是:2N
|
||||
|
if (datas.length > 1) { |
||||
|
let itemCode = datas[2]; |
||||
|
let location = itemCode.substring(3, 5); |
||||
|
let data = { |
||||
|
seq: datas[0], //序号
|
||||
|
produceNo: datas[1], //生产号
|
||||
|
// projectNo: datas[2], //项目号
|
||||
|
itemCode: itemCode, //配置码(零件号)
|
||||
|
lot: datas[3], //批次
|
||||
|
position: location //上层、下层
|
||||
|
} |
||||
|
scanResult.items.push(data) |
||||
|
} |
||||
|
} else { |
||||
|
if (item.includes('N')) { |
||||
|
let seq = item.substring(0, item.length - 1); |
||||
|
let data = { |
||||
|
seq: seq, //序号
|
||||
|
produceNo: 'N', //生产号
|
||||
|
projectNo: 'N', //项目号
|
||||
|
itemCode: 'N', //配置码(零件号)
|
||||
|
lot: 'N', //批次
|
||||
|
position: '' |
||||
|
} |
||||
|
scanResult.items.push(data) |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签信息不能为空"; |
||||
|
} |
||||
|
}) |
||||
|
scanResult.sucess = true; |
||||
|
} else { //扫描的是条码,直接返回接收到的内容
|
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "标签分隔符错误"; |
||||
|
} |
||||
|
} |
||||
|
} catch (ex) { |
||||
|
scanResult.sucess = false; |
||||
|
scanResult.message = "解析遇到异常" + ex.message; |
||||
|
} |
||||
|
} |
||||
|
return scanResult; |
||||
|
} |
@ -0,0 +1,221 @@ |
|||||
|
|
||||
|
@media screen and (min-width:400px) { |
||||
|
uni-app, uni-page-head{ |
||||
|
height: 60px; |
||||
|
} |
||||
|
uni-page-head .uni-page-head{ |
||||
|
height: 60px !important; |
||||
|
} |
||||
|
uni-page-head[uni-page-head-type=default]~uni-page-wrapper{ |
||||
|
height: calc(100% - 70px) !important; |
||||
|
} |
||||
|
uni-page-head .uni-page-head__title{ |
||||
|
font-size: 1.125rem !important; |
||||
|
line-height: 40px !important; |
||||
|
font-weight: normal !important; |
||||
|
} |
||||
|
uni-page-head .uni-btn-icon{ |
||||
|
font-size: 1.725rem !important; |
||||
|
} |
||||
|
.font_xs{ |
||||
|
font-size: 0.825rem !important; |
||||
|
} |
||||
|
.font_xl{ |
||||
|
font-size: 1.325rem !important; |
||||
|
} |
||||
|
.mini-type-style{ |
||||
|
font-size: 0.8rem !important; |
||||
|
} |
||||
|
.cen_card .label_box .label_info uni-text{ |
||||
|
line-height: 1.725 !important; |
||||
|
/* font-size: 1rem !important; */ |
||||
|
color: #333; |
||||
|
} |
||||
|
.cen_card .label_box .label_info{ |
||||
|
background-color: #eee !important; |
||||
|
} |
||||
|
.popup_box .detail-list{ |
||||
|
box-shadow: none !important; |
||||
|
} |
||||
|
.detail-list,.device-detail{ |
||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15) !important; |
||||
|
} |
||||
|
.list_form .uni-table-tr{ |
||||
|
background-color: #f0f0f0 !important; |
||||
|
} |
||||
|
.list_form .uni-table-th{ |
||||
|
border-bottom: 1px solid #cfcfcf !important; |
||||
|
} |
||||
|
/* yuanswitch |
||||
|
.require_wrap{ |
||||
|
padding-top: 0 !important; |
||||
|
} |
||||
|
.require_wrap .require_cell{ |
||||
|
line-height: 1.75 !important; |
||||
|
} |
||||
|
.ljh_box .tit_ljh{ |
||||
|
font-size: 1.25rem !important; |
||||
|
} |
||||
|
.cen_card .label_box .label_info { |
||||
|
background-color: #eee !important; |
||||
|
} |
||||
|
.cen_card .label_box .label_info uni-image{ |
||||
|
width: 48rpx !important; |
||||
|
height: 48rpx !important; |
||||
|
} |
||||
|
|
||||
|
.cen_card .label_box .label_info uni-text{ |
||||
|
line-height: 1.5 !important; |
||||
|
font-size: 1rem !important; |
||||
|
color: #333; |
||||
|
} |
||||
|
.ljh_box .tit_ljh .state-style, .top_card .state-style{ |
||||
|
font-size: 0.8rem !important; |
||||
|
} |
||||
|
.card_task .ljh_box{ |
||||
|
margin-bottom: 0 !important; |
||||
|
} |
||||
|
.task_num uni-image{ |
||||
|
width: 56rpx !important; |
||||
|
height: 56rpx !important; |
||||
|
} |
||||
|
.task_num uni-text{ |
||||
|
font-size: 1rem !important; |
||||
|
} |
||||
|
.pda_receipt_label .label_order uni-text{ |
||||
|
font-size: 1rem; |
||||
|
color: #434556; |
||||
|
} |
||||
|
.pda_receipt_label .icon_normal{ |
||||
|
width: 56rpx; |
||||
|
height: 56rpx; |
||||
|
} |
||||
|
.pda_receipt_bot .icon_normal{ |
||||
|
width: 56rpx; |
||||
|
height: 56rpx; |
||||
|
float: left; |
||||
|
} |
||||
|
.pda_receipt_bot .text_darkblue{ |
||||
|
float: left; |
||||
|
font-size: 1rem; |
||||
|
margin-top: 8rpx; |
||||
|
display: inline-block; |
||||
|
}*/ |
||||
|
.top_card .text_lightblue{ |
||||
|
font-size: 1rem !important; |
||||
|
} |
||||
|
.top_card .cell_box .cell_info{ |
||||
|
margin-bottom: 0; |
||||
|
} |
||||
|
.uni-tab-item-title{ |
||||
|
font-size: 1.125rem !important; |
||||
|
} |
||||
|
.cell_box .cell_info uni-view{ |
||||
|
font-size: 1rem !important; |
||||
|
color: #101010 !important; |
||||
|
} |
||||
|
.cell_box .cell_info .text_lightblue{ |
||||
|
font-size: 0.875rem !important; |
||||
|
color: #6A6E7A !important; |
||||
|
} |
||||
|
.cell_box .cell_info .text_black{ |
||||
|
font-size: 1.125rem !important; |
||||
|
|
||||
|
} |
||||
|
.scan_float uni-image{ |
||||
|
margin-top: 18rpx !important; |
||||
|
} |
||||
|
.scan_float uni-view{ |
||||
|
font-size: 0.875rem !important; |
||||
|
letter-spacing: 1px; |
||||
|
} |
||||
|
.new_btn_bot .new_save_btn,.popup_box .pop_title uni-text{ |
||||
|
font-size: 1rem !important; |
||||
|
} |
||||
|
.bot_card{ |
||||
|
background-color: #eee !important; |
||||
|
} |
||||
|
.bot_card_item uni-text{ |
||||
|
font-size: 0.8rem !important; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.summary_state .state_point{ |
||||
|
font-size: 1rem !important; |
||||
|
} |
||||
|
.summary_item label{ |
||||
|
float: left; |
||||
|
} |
||||
|
.summary_item uni-text{ |
||||
|
font-size: 1.125rem !important; |
||||
|
font-weight: normal !important; |
||||
|
float: left; |
||||
|
} |
||||
|
/* popup */ |
||||
|
.popup_box{ |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.popup_box .uni-steps{ |
||||
|
width:100%; |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
.popup_box .uni-steps__row-line-item{ |
||||
|
height: 60rpx !important; |
||||
|
} |
||||
|
.popup_box .uni-steps__row-text-container{ |
||||
|
margin-top: 0 !important; |
||||
|
} |
||||
|
.popup_box,.uni-popup .uni-scroll-view-content{ |
||||
|
border-top-left-radius:30rpx !important; |
||||
|
border-top-right-radius:30rpx !important; |
||||
|
} |
||||
|
.popup_box .pop_title{ |
||||
|
font-size: 1.125rem !important; |
||||
|
letter-spacing: 1px; |
||||
|
} |
||||
|
.popup_box .pop_tab .tab_tit{ |
||||
|
font-size: 0.875rem !important; |
||||
|
} |
||||
|
.popup_box .pop_tab .tab_tit_active{ |
||||
|
font-size: 1rem !important; |
||||
|
} |
||||
|
.popup_box .pop_tab .tab_info{ |
||||
|
min-height: 200rpx !important; |
||||
|
} |
||||
|
.popup_box .pop_tab .tab_info uni-textarea{ |
||||
|
height: 200rpx; |
||||
|
} |
||||
|
.popup_box .pop_tab .tab_info uni-button{ |
||||
|
font-size: 0.875rem !important; |
||||
|
letter-spacing: 1px; |
||||
|
} |
||||
|
/*底部按钮*/ |
||||
|
.new_btn_bot .new_save_btn{ |
||||
|
background-color: #E4EAFF !important; |
||||
|
height: 50px; |
||||
|
line-height: 50px; |
||||
|
} |
||||
|
.new_btn_bot .new_clear_btn{ |
||||
|
font-size: 1rem !important; |
||||
|
line-height: 50px; |
||||
|
} |
||||
|
.scroll-detail{ |
||||
|
padding-bottom: 70px !important; |
||||
|
} |
||||
|
.count_shadow,.device-detail{ |
||||
|
box-shadow: 0 0 20rpx rgba(0,0,0,0.2); |
||||
|
} |
||||
|
.list_info { |
||||
|
padding: 0 20rpx 20rpx; |
||||
|
margin-top: 0; |
||||
|
} |
||||
|
.uni-scroll-view-content .creattp_list{ |
||||
|
width: 100% !important; |
||||
|
} |
||||
|
.creattp_list .uni-list .list_cell uni-text{ |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.popup_box .scan_scroll{ |
||||
|
max-height: 44vh !important; |
||||
|
|
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,739 @@ |
|||||
|
/* |
||||
|
.pda-list { |
||||
|
padding: 10rpx 10rpx; |
||||
|
box-sizing: border-box; |
||||
|
display: flex; |
||||
|
width: 100%; |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
*/ |
||||
|
|
||||
|
/* 列表 */ |
||||
|
.pda-list { |
||||
|
padding: 0 20rpx; |
||||
|
box-sizing: border-box; |
||||
|
background-color: #FFFFFF; |
||||
|
position: relative; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
border-radius: 16rpx; |
||||
|
margin-bottom: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.pda-list:after { |
||||
|
position: absolute; |
||||
|
z-index: 10; |
||||
|
/* right: 0; */ |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
height: 1px; |
||||
|
content: ''; |
||||
|
-webkit-transform: scaleY(.5); |
||||
|
transform: scaleY(.5); |
||||
|
background-color: #c8c7cc; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell { |
||||
|
position: relative; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
padding: 10rpx 0; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell:last-child { |
||||
|
border-bottom: 0; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell-left { |
||||
|
white-space: nowrap; |
||||
|
/* padding: 0 10rpx; */ |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell-db, |
||||
|
.pda-list-cell-right { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell .pda-list-cell-db .uni-input-input { |
||||
|
font-size: .875rem; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell .uni-easyinput__content-input, |
||||
|
.pda-list-cell .uni-input-placeholder { |
||||
|
height: 2rem; |
||||
|
line-height: 2rem; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell .placeholder { |
||||
|
color: #999 !important; |
||||
|
font-size: 0.875rem; |
||||
|
padding-left: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.pda-list-cell .uni-label { |
||||
|
color: #434556; |
||||
|
} |
||||
|
|
||||
|
.list_locode .uni-collapse-item__title-box { |
||||
|
font-weight: bold !important; |
||||
|
} |
||||
|
|
||||
|
.display-flex { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.list-body { |
||||
|
/* height: 84rpx; */ |
||||
|
display: flex; |
||||
|
flex: 1; |
||||
|
flex-direction: column; |
||||
|
justify-content: space-between; |
||||
|
align-items: flex-start; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.list-text-top { |
||||
|
width: 100%; |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
/* line-height: 36rpx; */ |
||||
|
/* font-size: 30rpx; */ |
||||
|
} |
||||
|
|
||||
|
.list-text-bottom { |
||||
|
/* line-height: 30rpx; */ |
||||
|
/* font-size: 26rpx; */ |
||||
|
color: #8f8f94; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* 改为detail-content */ |
||||
|
/* margin-bottom: 20rpx; */ |
||||
|
.device-detail { |
||||
|
padding: 10rpx !important; |
||||
|
margin: 10rpx; |
||||
|
border-radius: 16rpx; |
||||
|
background-color: #fff; |
||||
|
color: #666666; |
||||
|
line-height: 1.5; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.list-style { |
||||
|
margin-bottom: 0rpx; |
||||
|
border-radius: 16rpx; |
||||
|
background-color: #FFFFFF; |
||||
|
color: #666666; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
|
||||
|
.border-font { |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
} |
||||
|
|
||||
|
.space-between { |
||||
|
-webkit-justify-content: space-between; |
||||
|
justify-content: space-between; |
||||
|
} |
||||
|
|
||||
|
.accept-button { |
||||
|
width: 30%; |
||||
|
font-size: 16px; |
||||
|
background-color: #7ac756; |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
.bigsave-button { |
||||
|
width: 80%; |
||||
|
font-size: 16px; |
||||
|
background-color: #007AFF; |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
.save-button { |
||||
|
width: 30%; |
||||
|
font-size: 16px; |
||||
|
background-color: #007AFF; |
||||
|
color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
.scroll-detail { |
||||
|
overflow: hidden; |
||||
|
padding-bottom: 60px; |
||||
|
height: 480px; |
||||
|
/* 没有高度不可以回到顶部 */ |
||||
|
/* background-color: #ffffff; */ |
||||
|
} |
||||
|
|
||||
|
.scrollView { |
||||
|
overflow: hidden; |
||||
|
padding-bottom: 50px |
||||
|
} |
||||
|
|
||||
|
.scroll-Y { |
||||
|
/* height: 70ux; */ |
||||
|
padding-bottom: 50px |
||||
|
} |
||||
|
|
||||
|
.bottom1 { |
||||
|
position: fixed; |
||||
|
width: 100%; |
||||
|
/* padding: 10rpx 10rpx; */ |
||||
|
left: 0; |
||||
|
/* right: 0; */ |
||||
|
bottom: 0; |
||||
|
background-color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
.bottom { |
||||
|
position: fixed; |
||||
|
display: flex; |
||||
|
width: 100%; |
||||
|
padding: 10rpx 10rpx; |
||||
|
left: 0; |
||||
|
/* right: 0; */ |
||||
|
bottom: 0; |
||||
|
background-color: #ffffff; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.pars-num { |
||||
|
/* font-size: 26rpx; */ |
||||
|
} |
||||
|
|
||||
|
.right-width { |
||||
|
text-align: center; |
||||
|
width: 100rpx; |
||||
|
} |
||||
|
|
||||
|
.state-style { |
||||
|
float: left; |
||||
|
margin-top: 10rpx; |
||||
|
/* border-radius: 16rpx; |
||||
|
padding: 0rpx 10rpx; */ |
||||
|
/* line-height: 50rpx; |
||||
|
height: 50rpx; */ |
||||
|
/* width: 120rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; */ |
||||
|
/* 垂直居中 */ |
||||
|
} |
||||
|
|
||||
|
.uni-popup-view { |
||||
|
background-color: #fff; |
||||
|
border-radius: 10px; |
||||
|
} |
||||
|
|
||||
|
.uni-popup-button-box { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
padding: 10px 15px; |
||||
|
} |
||||
|
|
||||
|
.uni-popup-button { |
||||
|
flex: 1; |
||||
|
/* // border-radius: 50px; |
||||
|
// color: #666; */ |
||||
|
/* font-size: 16px; */ |
||||
|
} |
||||
|
|
||||
|
/* 任务状态 */ |
||||
|
/* 打开 */ |
||||
|
.open { |
||||
|
font-size: 28rpx; |
||||
|
background: rgba(95, 203, 148, 0.2); |
||||
|
color: #22AF68; |
||||
|
padding: 10rpx 20rpx 10rpx 20rpx; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
/* 进行中 */ |
||||
|
.pending { |
||||
|
font-size: 28rpx; |
||||
|
background: rgba(236, 156, 0, 0.2); |
||||
|
color: #EC9C00; |
||||
|
padding: 10rpx 20rpx 10rpx 20rpx; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
/* 完成 */ |
||||
|
.completed { |
||||
|
background-color: #E6A23C; |
||||
|
color: #FFFFFF; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
/* 关闭 */ |
||||
|
.close { |
||||
|
background-color: #F56C6C; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* 关闭 */ |
||||
|
.other { |
||||
|
background-color: #808080; |
||||
|
color: #FFFFFF; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
/* 其他 */ |
||||
|
.unk { |
||||
|
background-color: #ececec; |
||||
|
color: #666; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
/* 检验任务状态 */ |
||||
|
/* 免检 */ |
||||
|
.exempt { |
||||
|
background-color: #409EFF; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
/* 全检 */ |
||||
|
.full { |
||||
|
background-color: #67C23A; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
/* 抽检 */ |
||||
|
.sampling { |
||||
|
background-color: #E6A23C; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
/* 挑检 */ |
||||
|
.pick { |
||||
|
background-color: #F56C6C; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
/* 库存状态 */ |
||||
|
|
||||
|
.uni-link { |
||||
|
background-color: #BD2C00; |
||||
|
color: #BD2C00 !important; |
||||
|
} |
||||
|
|
||||
|
.inventory_status_insp { |
||||
|
color: #F9AE3D; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.inventory_status_ok { |
||||
|
color: #67C23A; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.inventory_status_nok { |
||||
|
color: #FF2424; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.inventory_status_hold { |
||||
|
color: #EC9C00; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.inventory_status_scarp { |
||||
|
color: #999; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.frozen { |
||||
|
color: #FF581D; |
||||
|
margin-right: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.pass { |
||||
|
color: #67C23A !important; |
||||
|
} |
||||
|
|
||||
|
.unPass { |
||||
|
color: #FF2424 !important; |
||||
|
} |
||||
|
|
||||
|
.location_inspect { |
||||
|
background-color: #F6CB61; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_raw { |
||||
|
background-color: #2DA8D8; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_semi { |
||||
|
background-color: #EDAE50; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_fg { |
||||
|
background-color: #078343; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_wip { |
||||
|
background-color: #FC85FE; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_scrap { |
||||
|
background-color: #E30016; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_noc { |
||||
|
background-color: #C31223; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_overflow { |
||||
|
background-color: #7D1EDC; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.location_customer { |
||||
|
background-color: #5A7CF3; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* //零件状态 |
||||
|
export function getItemTypeStyle(val) { |
||||
|
if (val == 0) return 'active' |
||||
|
else if (val == 1) return 'hold' |
||||
|
else if (val == 2) return 'new' |
||||
|
else if (val == 3) return 'plan' |
||||
|
else if (val == 4) return 'disable' |
||||
|
else return 'other' |
||||
|
} |
||||
|
*/ |
||||
|
|
||||
|
/* 零件状态 */ |
||||
|
.active { |
||||
|
background-color: #5FCB94; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.hold_item { |
||||
|
background-color: #FF4206; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.new { |
||||
|
background-color: #E6A23C; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.plan { |
||||
|
background-color: #2677F9; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.disable { |
||||
|
background-color: #666; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
/* 任务编号字体 */ |
||||
|
.text-number { |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
} |
||||
|
|
||||
|
/* 零件编号字体 */ |
||||
|
.text-itemcode { |
||||
|
/* font-size: 26rpx; */ |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
} |
||||
|
|
||||
|
.text-desc { |
||||
|
color: #8f8f91; |
||||
|
/* font-size: 22rpx; */ |
||||
|
} |
||||
|
|
||||
|
/* 零件编号字体 */ |
||||
|
.text-bolder { |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
} |
||||
|
|
||||
|
.detail-list { |
||||
|
background-color: #fff; |
||||
|
/* padding: 10rpx; */ |
||||
|
/* margin: 20rpx; */ |
||||
|
/* border-radius: 16rpx; */ |
||||
|
/* overflow: hidden; */ |
||||
|
} |
||||
|
|
||||
|
.detail-content { |
||||
|
position: relative; |
||||
|
flex: 1; |
||||
|
/* font-size: 26rpx; */ |
||||
|
color: #101010; |
||||
|
} |
||||
|
|
||||
|
.example-body { |
||||
|
background-color: #FFFFFF; |
||||
|
} |
||||
|
|
||||
|
.result-box { |
||||
|
text-align: center; |
||||
|
padding: 20px 0px; |
||||
|
/* font-size: 16px; */ |
||||
|
} |
||||
|
|
||||
|
.toptext { |
||||
|
padding-left: 20upx; |
||||
|
line-height: 80upx; |
||||
|
} |
||||
|
|
||||
|
.numberstyle { |
||||
|
display: flex; |
||||
|
/* flex-direction: row-reverse; */ |
||||
|
border-bottom: 10upx solid #EEEEEE; |
||||
|
width: 200upx; |
||||
|
padding-bottom: 20upx; |
||||
|
} |
||||
|
|
||||
|
.input { |
||||
|
height: 20rpx; |
||||
|
padding: 0rpx 8rpx; |
||||
|
line-height: 50rpx; |
||||
|
/* font-size: 25rpx; */ |
||||
|
background: #FFF; |
||||
|
border-radius: 4rpx; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.mini-type-style { |
||||
|
vertical-align: middle; |
||||
|
font-size: 0.725rem; |
||||
|
margin-right: 6rpx; |
||||
|
border-radius: 4rpx; |
||||
|
padding: 4rpx 8rpx; |
||||
|
/* width: 80rpx; */ |
||||
|
/* height: 46rpx; |
||||
|
min-width: 80rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; */ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.text-color { |
||||
|
color: #000; |
||||
|
font-weight: bolder; |
||||
|
} |
||||
|
|
||||
|
.tabs { |
||||
|
flex: 1; |
||||
|
flex-direction: column; |
||||
|
overflow: hidden; |
||||
|
/* background-color: #ffffff; */ |
||||
|
} |
||||
|
|
||||
|
/* .scroll-h { |
||||
|
touch-action: none; |
||||
|
width: 100%; |
||||
|
height: 100rpx; |
||||
|
flex-direction: row; |
||||
|
white-space: nowrap; |
||||
|
justify-content: center; |
||||
|
} */ |
||||
|
|
||||
|
.line-h { |
||||
|
height: 1rpx; |
||||
|
background-color: #cccccc; |
||||
|
} |
||||
|
|
||||
|
.uni-tab-item { |
||||
|
/* #ifndef APP-PLUS */ |
||||
|
display: inline-block; |
||||
|
/* #endif */ |
||||
|
flex-wrap: nowrap; |
||||
|
padding: 0 30rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-tab-item-title { |
||||
|
position: relative; |
||||
|
color: #555; |
||||
|
/* font-size: 24rpx; */ |
||||
|
height: 100rpx; |
||||
|
line-height: 100rpx; |
||||
|
flex-wrap: nowrap; |
||||
|
/* #ifndef APP-PLUS */ |
||||
|
white-space: nowrap; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
.uni-tab-item-title-active { |
||||
|
color: #101010; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
.uni-tab-item-title-active:after { |
||||
|
left: 50%; |
||||
|
transform: translateX(-50%); |
||||
|
position: absolute; |
||||
|
bottom: -20rpx; |
||||
|
display: inline-block; |
||||
|
content: ""; |
||||
|
width: 40rpx; |
||||
|
height: 8rpx; |
||||
|
background-color: #5a7cf3; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
|
||||
|
/* .blece { |
||||
|
padding: 10upx; |
||||
|
color: #111111; |
||||
|
border-bottom: 2px solid #f5f5f5; |
||||
|
display: flex; |
||||
|
flex-wrap: wrap; |
||||
|
} */ |
||||
|
|
||||
|
.conbox { |
||||
|
/* padding: 10rpx 0; */ |
||||
|
padding-left: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.myinput { |
||||
|
display: flex; |
||||
|
box-sizing: border-box; |
||||
|
overflow: hidden; |
||||
|
position: relative; |
||||
|
flex: 1; |
||||
|
justify-content: center; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
height: 88rpx; |
||||
|
padding: 20rpx 0; |
||||
|
/* border-width: 0.5px; |
||||
|
border-style: solid; |
||||
|
border-color: #e5e5e5; |
||||
|
border-radius: 5px; |
||||
|
background-color: rgb(248, 248, 248); |
||||
|
font-size: 18px;*/ |
||||
|
font-size: .825rem; |
||||
|
} |
||||
|
|
||||
|
.qtyinput { |
||||
|
height: 50px; |
||||
|
padding: 10px 0px; |
||||
|
font-size: 20px; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.count-input { |
||||
|
padding: 5rpx 3rpx; |
||||
|
width: 95%; |
||||
|
font-size: 18px; |
||||
|
} |
||||
|
|
||||
|
.pda-data-picker { |
||||
|
padding: 5rpx 3rpx; |
||||
|
width: 95%; |
||||
|
font-size: 18px; |
||||
|
} |
||||
|
|
||||
|
.inputPlaceholderStyle { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.inputfocus { |
||||
|
border-color: #007AFF; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.txt-16 { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.txt-18 { |
||||
|
font-size: 18px; |
||||
|
} |
||||
|
|
||||
|
.txt-20 { |
||||
|
font-size: 20px; |
||||
|
} |
||||
|
|
||||
|
.pda-label { |
||||
|
width: 210rpx; |
||||
|
word-wrap: break-word; |
||||
|
word-break: break-all; |
||||
|
text-indent: 20rpx; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.fontsize-16 { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.fontsize-18 { |
||||
|
font-size: 18px; |
||||
|
} |
||||
|
|
||||
|
.fontsize-20 { |
||||
|
font-size: 20px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .uni-collapse-item__title-text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/deep/ .input-value { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .uni-input-input { |
||||
|
font-size: 18px; |
||||
|
} |
||||
|
|
||||
|
page { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
/* background-color: #fff; */ |
||||
|
} |
||||
|
|
||||
|
.page-wraper { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.page-main { |
||||
|
flex: 1; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.page-main-scroll { |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
} |
||||
|
|
||||
|
.page-main-list { |
||||
|
/* height: 80rpx; |
||||
|
line-height: 80rpx; */ |
||||
|
text-align: center; |
||||
|
background: #e0e0e0; |
||||
|
|
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,136 @@ |
|||||
|
/* #ifndef APP-PLUS-NVUE */ |
||||
|
page { |
||||
|
min-height: 100%; |
||||
|
height: auto; |
||||
|
} |
||||
|
/* #endif */ |
||||
|
|
||||
|
/* 解决头条小程序字体图标不显示问题,因为头条运行时自动插入了span标签,且有全局字体 */ |
||||
|
/* #ifdef MP-TOUTIAO */ |
||||
|
/* text :not(view) { |
||||
|
font-family: uniicons; |
||||
|
} */ |
||||
|
/* #endif */ |
||||
|
|
||||
|
.uni-icon { |
||||
|
font-family: uniicons; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
|
||||
|
.uni-container { |
||||
|
padding: 15px; |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
|
||||
|
.uni-header-logo { |
||||
|
/* #ifdef H5 */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
padding: 15px 15px; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
margin-top: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-header-image { |
||||
|
width: 80px; |
||||
|
height: 80px; |
||||
|
} |
||||
|
|
||||
|
.uni-hello-text { |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.hello-text { |
||||
|
color: #7A7E83; |
||||
|
font-size: 14px; |
||||
|
line-height: 20px; |
||||
|
} |
||||
|
|
||||
|
.hello-link { |
||||
|
color: #7A7E83; |
||||
|
font-size: 14px; |
||||
|
line-height: 20px; |
||||
|
} |
||||
|
|
||||
|
.uni-panel { |
||||
|
margin-bottom: 12px; |
||||
|
} |
||||
|
|
||||
|
.uni-panel-h { |
||||
|
/* #ifdef H5 */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
background-color: #ffffff; |
||||
|
flex-direction: row !important; |
||||
|
/* justify-content: space-between !important; */ |
||||
|
align-items: center !important; |
||||
|
padding: 12px; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
/* |
||||
|
.uni-panel-h:active { |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
*/ |
||||
|
.uni-panel-h-on { |
||||
|
background-color: #f0f0f0; |
||||
|
} |
||||
|
|
||||
|
.uni-panel-text { |
||||
|
flex: 1; |
||||
|
color: #000000; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
|
||||
|
.uni-panel-icon { |
||||
|
margin-left: 15px; |
||||
|
color: #999999; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
transform: rotate(0deg); |
||||
|
transition-duration: 0s; |
||||
|
transition-property: transform; |
||||
|
} |
||||
|
|
||||
|
.uni-panel-icon-on { |
||||
|
transform: rotate(180deg); |
||||
|
} |
||||
|
|
||||
|
.uni-navigate-item { |
||||
|
/* #ifdef H5 */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
background-color: #FFFFFF; |
||||
|
border-top-style: solid; |
||||
|
border-top-color: #f0f0f0; |
||||
|
border-top-width: 1px; |
||||
|
padding: 12px; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
.uni-navigate-item:active { |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
|
||||
|
.uni-navigate-text { |
||||
|
flex: 1; |
||||
|
color: #000000; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
|
||||
|
.uni-navigate-icon { |
||||
|
margin-left: 15px; |
||||
|
color: #999999; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
// 获取本地存储对应key
|
||||
|
const getStorage = (key)=>{ |
||||
|
return uni.getStorageSync( key ); |
||||
|
} |
||||
|
|
||||
|
// 设置本地存储对应key
|
||||
|
const setStorage = (key,value)=>{ |
||||
|
return uni.setStorageSync( key,value ); |
||||
|
} |
||||
|
|
||||
|
// 清除全部本地存储
|
||||
|
const clearStorage = ()=>{ |
||||
|
uni.clearStorageSync(); |
||||
|
} |
||||
|
|
||||
|
// 清除指定key本地存储
|
||||
|
const removeStorage = ( key )=>{ |
||||
|
uni.removeStorageSync( key ); |
||||
|
} |
||||
|
|
||||
|
const constant = { |
||||
|
id:"id", |
||||
|
token:"token", |
||||
|
avatar: 'avatar', |
||||
|
name: 'name', |
||||
|
roles: 'roles', |
||||
|
permissions: 'permissions' |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
getStorage, |
||||
|
setStorage, |
||||
|
clearStorage, |
||||
|
removeStorage, |
||||
|
constant |
||||
|
} |
@ -0,0 +1,181 @@ |
|||||
|
import amap from '@/components/amap-wx/lib/amap-wx.js'; |
||||
|
// 地铁颜色图
|
||||
|
const line = { |
||||
|
'1号线': '#C43B33', |
||||
|
'2号线': '#016299', |
||||
|
'4号线/大兴线': '#008E9C', |
||||
|
'5号线': '#A42380', |
||||
|
'6号线': '#D09900', |
||||
|
'7号线': '#F2C172', |
||||
|
'8号线': '#009D6A', |
||||
|
'9号线': '#8FC41E', |
||||
|
'10号线': '#009DBE', |
||||
|
'13号线': '#F9E701', |
||||
|
'14号线东段': '#D4A7A2', |
||||
|
'14号线西段': '#D4A7A2', |
||||
|
'15号线': '#5D2D69', |
||||
|
'八通线': '#C33A32', |
||||
|
'昌平线': '#DE82B1', |
||||
|
'亦庄线': '#E40177', |
||||
|
'房山线': '#E66021', |
||||
|
'机场线': '#A29BBC', |
||||
|
} |
||||
|
|
||||
|
// 150500:地铁站 ,150700:公交站 , 190700:地名地址
|
||||
|
const typecode = [{ |
||||
|
id: '150500', |
||||
|
icon: 'icon-ditie' |
||||
|
}, { |
||||
|
id: '150700', |
||||
|
icon: 'icon-gongjiao' |
||||
|
}, { |
||||
|
id: '190700', |
||||
|
icon: 'icon-gonglu' |
||||
|
}]; |
||||
|
|
||||
|
const util = { |
||||
|
key:'b526b09b86cd2996e7732be8ab8c4430', |
||||
|
/** |
||||
|
* 初始化高德地图api |
||||
|
*/ |
||||
|
mapInit() { |
||||
|
return new amap.AMapWX({ |
||||
|
key: this.key |
||||
|
}); |
||||
|
}, |
||||
|
// 服务状态吗
|
||||
|
typecode, |
||||
|
/** |
||||
|
* 获取地图颜色 |
||||
|
*/ |
||||
|
lineColor(name) { |
||||
|
if (line[name]) { |
||||
|
return line[name]; |
||||
|
} else { |
||||
|
return '#ccc'; |
||||
|
} |
||||
|
}, |
||||
|
/** |
||||
|
* 关键字颜色变化 |
||||
|
*/ |
||||
|
serachNmme(val, name) { |
||||
|
let namestr = new RegExp(val); |
||||
|
let nameresult = |
||||
|
`<div style="font-size: 14px;color: #333;line-height: 1.5;">
|
||||
|
${name.replace(namestr, "<span style='color:#66ccff;'>" + val + '</span>')} |
||||
|
</div>` |
||||
|
.trim(); |
||||
|
|
||||
|
return nameresult; |
||||
|
}, |
||||
|
/** |
||||
|
* 地址转地铁线路 |
||||
|
*/ |
||||
|
addressToLine(address, type) { |
||||
|
let addr = address.split(';'); |
||||
|
let dt = ''; |
||||
|
addr.forEach(elm => { |
||||
|
let color = '#cccccc'; |
||||
|
if (type === typecode[0].id) { |
||||
|
color = this.lineColor(elm) |
||||
|
} else if (type === typecode[1].id) { |
||||
|
color = '#4075cb' |
||||
|
} |
||||
|
let style = 'margin:5px 0;margin-right:5px;padding:0 5px;background:' + color + |
||||
|
';font-size:12px;color:#fff;border-radius:3px;'; |
||||
|
dt += `<div style=\'${style}\'>${elm}</div>`; |
||||
|
|
||||
|
}); |
||||
|
return `<div style="display:flex;flex-wrap: wrap;">${dt}</div>`; |
||||
|
}, |
||||
|
/** |
||||
|
* 数据处理 |
||||
|
*/ |
||||
|
dataHandle(item, val) { |
||||
|
// 改变字体颜色
|
||||
|
if (val) { |
||||
|
item.nameNodes = util.serachNmme(val, item.name); |
||||
|
} else { |
||||
|
item.nameNodes = `<div style="font-size: 14px;color: #333;line-height: 1.5;">${item.name}</div>`; |
||||
|
|
||||
|
} |
||||
|
// 地址解析 地铁
|
||||
|
if ( |
||||
|
item.typecode === util.typecode[0].id || |
||||
|
item.typecode === util.typecode[1].id |
||||
|
) { |
||||
|
item.addressNodes = util.addressToLine(item.address, item.typecode); |
||||
|
if (item.typecode === util.typecode[0].id) { |
||||
|
item.icon = util.typecode[0].icon; |
||||
|
} else if (item.typecode === util.typecode[1].id) { |
||||
|
item.icon = util.typecode[1].icon; |
||||
|
} |
||||
|
} else { |
||||
|
item.addressNodes = `<span>${item.district}${ |
||||
|
item.address.length > 0 ? '·' + item.address : '' |
||||
|
}</span>`.trim(); |
||||
|
item.icon = 'icon-weizhi'; |
||||
|
} |
||||
|
|
||||
|
if (item.location && item.location.length === 0) { |
||||
|
item.icon = 'icon-sousuo'; |
||||
|
} |
||||
|
|
||||
|
return item; |
||||
|
}, |
||||
|
/** |
||||
|
* 存储历史数据 |
||||
|
* val [string | object]需要存储的内容 |
||||
|
*/ |
||||
|
setHistory(val) { |
||||
|
let searchHistory = uni.getStorageSync('search:history'); |
||||
|
if (!searchHistory) searchHistory = []; |
||||
|
let serachData = {}; |
||||
|
if (typeof(val) === 'string') { |
||||
|
serachData = { |
||||
|
adcode: [], |
||||
|
address: [], |
||||
|
city: [], |
||||
|
district: [], |
||||
|
id: [], |
||||
|
location: [], |
||||
|
name: val, |
||||
|
typecode: [] |
||||
|
}; |
||||
|
} else { |
||||
|
serachData = val |
||||
|
} |
||||
|
|
||||
|
// 判断数组是否存在,如果存在,那么将放到最前面
|
||||
|
for (var i = 0; i < searchHistory.length; i++) { |
||||
|
if (searchHistory[i].name === serachData.name) { |
||||
|
searchHistory.splice(i, 1); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
searchHistory.unshift(util.dataHandle(serachData)); |
||||
|
uni.setStorage({ |
||||
|
key: 'search:history', |
||||
|
data: searchHistory, |
||||
|
success: function() { |
||||
|
// console.log('success');
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
getHistory() { |
||||
|
|
||||
|
}, |
||||
|
removeHistory() { |
||||
|
uni.removeStorage({ |
||||
|
key: 'search:history', |
||||
|
success: function(res) { |
||||
|
console.log('success'); |
||||
|
} |
||||
|
}); |
||||
|
return [] |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
export default util; |
File diff suppressed because one or more lines are too long
@ -0,0 +1,156 @@ |
|||||
|
<template> |
||||
|
<view class="uni-padding-wrap"> |
||||
|
<page-head :title="title"></page-head> |
||||
|
<button class="button" @click="setTabBarBadge">{{ !hasSetTabBarBadge ? '设置tab徽标' : '移除tab徽标' }}</button> |
||||
|
<button class="button" @click="showTabBarRedDot">{{ !hasShownTabBarRedDot ? '显示红点' : '移除红点'}}</button> |
||||
|
<button class="button" @click="customStyle">{{ !hasCustomedStyle ? '自定义Tab样式' : '移除自定义样式'}}</button> |
||||
|
<button class="button" @click="customItem">{{ !hasCustomedItem ? '自定义Tab信息' : '移除自定义信息' }}</button> |
||||
|
<button class="button" @click="hideTabBar">{{ !hasHiddenTabBar ? '隐藏TabBar' : '显示TabBar' }}</button> |
||||
|
<view class="btn-area"> |
||||
|
<button class="button" type="primary" @click="navigateBack">返回上一级</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
title: 'tababr', |
||||
|
hasSetTabBarBadge: false, |
||||
|
hasShownTabBarRedDot: false, |
||||
|
hasCustomedStyle: false, |
||||
|
hasCustomedItem: false, |
||||
|
hasHiddenTabBar: false |
||||
|
} |
||||
|
}, |
||||
|
destroyed() { |
||||
|
if (this.hasSetTabBarBadge) { |
||||
|
uni.removeTabBarBadge({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
} |
||||
|
if (this.hasShownTabBarRedDot) { |
||||
|
uni.hideTabBarRedDot({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
} |
||||
|
if (this.hasHiddenTabBar) { |
||||
|
uni.showTabBar() |
||||
|
} |
||||
|
if (this.hasCustomedStyle) { |
||||
|
uni.setTabBarStyle({ |
||||
|
color: '#7A7E83', |
||||
|
selectedColor: '#007AFF', |
||||
|
backgroundColor: '#F8F8F8', |
||||
|
borderStyle: 'black' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
if (this.hasCustomedItem) { |
||||
|
let tabBarOptions = { |
||||
|
index: 1, |
||||
|
text: '接口', |
||||
|
iconPath: '/static/api.png', |
||||
|
selectedIconPath: '/static/apiHL.png' |
||||
|
} |
||||
|
uni.setTabBarItem(tabBarOptions) |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
navigateBack() { |
||||
|
this.$emit('unmount') |
||||
|
}, |
||||
|
setTabBarBadge() { |
||||
|
if(this.hasShownTabBarRedDot){ |
||||
|
uni.hideTabBarRedDot({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
this.hasShownTabBarRedDot = !this.hasShownTabBarRedDot |
||||
|
} |
||||
|
if (!this.hasSetTabBarBadge) { |
||||
|
uni.setTabBarBadge({ |
||||
|
index: 1, |
||||
|
text: '1' |
||||
|
}) |
||||
|
} else { |
||||
|
uni.removeTabBarBadge({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
} |
||||
|
this.hasSetTabBarBadge = !this.hasSetTabBarBadge |
||||
|
}, |
||||
|
showTabBarRedDot() { |
||||
|
if(this.hasSetTabBarBadge) { |
||||
|
uni.removeTabBarBadge({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
this.hasSetTabBarBadge = !this.hasSetTabBarBadge |
||||
|
} |
||||
|
if (!this.hasShownTabBarRedDot) { |
||||
|
uni.showTabBarRedDot({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
} else { |
||||
|
uni.hideTabBarRedDot({ |
||||
|
index: 1 |
||||
|
}) |
||||
|
} |
||||
|
this.hasShownTabBarRedDot = !this.hasShownTabBarRedDot |
||||
|
}, |
||||
|
hideTabBar() { |
||||
|
if (!this.hasHiddenTabBar) { |
||||
|
uni.hideTabBar() |
||||
|
} else { |
||||
|
uni.showTabBar() |
||||
|
} |
||||
|
this.hasHiddenTabBar = !this.hasHiddenTabBar |
||||
|
}, |
||||
|
customStyle() { |
||||
|
if (this.hasCustomedStyle) { |
||||
|
uni.setTabBarStyle({ |
||||
|
color: '#7A7E83', |
||||
|
selectedColor: '#007AFF', |
||||
|
backgroundColor: '#F8F8F8', |
||||
|
borderStyle: 'black' |
||||
|
}) |
||||
|
} else { |
||||
|
uni.setTabBarStyle({ |
||||
|
color: '#FFF', |
||||
|
selectedColor: '#007AFF', |
||||
|
backgroundColor: '#000000', |
||||
|
borderStyle: 'black' |
||||
|
}) |
||||
|
} |
||||
|
this.hasCustomedStyle = !this.hasCustomedStyle |
||||
|
}, |
||||
|
customItem() { |
||||
|
let tabBarOptions = { |
||||
|
index: 1, |
||||
|
text: '接口', |
||||
|
iconPath: '/static/api.png', |
||||
|
selectedIconPath: '/static/apiHL.png' |
||||
|
} |
||||
|
if (this.hasCustomedItem) { |
||||
|
uni.setTabBarItem(tabBarOptions) |
||||
|
} else { |
||||
|
tabBarOptions.text = 'API' |
||||
|
uni.setTabBarItem(tabBarOptions) |
||||
|
} |
||||
|
this.hasCustomedItem = !this.hasCustomedItem |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.button { |
||||
|
margin-top: 30rpx; |
||||
|
margin-left: 0; |
||||
|
margin-right: 0; |
||||
|
} |
||||
|
|
||||
|
.btn-area { |
||||
|
padding-top: 30rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,39 @@ |
|||||
|
<!-- z-paging自定义的没有更多数据view --> |
||||
|
<template> |
||||
|
<view class="nomore"> |
||||
|
<!-- 这里的图片请换成自己项目的图片 --> |
||||
|
<image class="nomore-image" mode="aspectFit" src="@/static/no_more.png"></image> |
||||
|
<text class="nomore-text">已经到达宇宙尽头啦~</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.nomore{ |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
padding: 20rpx 0px; |
||||
|
} |
||||
|
.nomore-image{ |
||||
|
width: 200rpx; |
||||
|
height: 130rpx; |
||||
|
} |
||||
|
.nomore-text{ |
||||
|
margin-top: 10rpx; |
||||
|
font-size: 24rpx; |
||||
|
color: #222963; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,58 @@ |
|||||
|
<!-- z-paging自定义的下拉刷新view --> |
||||
|
<template> |
||||
|
<view class="refresher-container"> |
||||
|
<!-- 这里的图片请换成自己项目的图片 --> |
||||
|
<image class="refresher-image" mode="aspectFit" src="@/static/refresher_loading.gif"></image> |
||||
|
<text class="refresher-text">{{statusText}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
statusText() { |
||||
|
// 这里可以做i18n国际化相关操作,可以通过uni.getLocale()获取当前语言(具体操作见i18n-demo.vue); |
||||
|
// 获取到当前语言之后,就可以自定义不同语言下的展示内容了 |
||||
|
const statusTextArr = ['哎呀,用点力继续下拉!', '拉疼我啦,松手刷新~~', '正在努力刷新中...', '刷新成功啦~']; |
||||
|
return statusTextArr[this.status]; |
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
status: { |
||||
|
type: Number, |
||||
|
default: function() { |
||||
|
return 0; |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.refresher-container { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
height: 150rpx; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
|
||||
|
.refresher-image { |
||||
|
margin-top: 10rpx; |
||||
|
height: 45px; |
||||
|
width: 45px; |
||||
|
} |
||||
|
|
||||
|
.refresher-text { |
||||
|
margin-top: 10rpx; |
||||
|
font-size: 24rpx; |
||||
|
color: #666666; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,110 @@ |
|||||
|
<template> |
||||
|
<div class="invite-box"> |
||||
|
<view class="center-box"> |
||||
|
<!-- <image class="logo" src="/static/invite-logo.png"></image> --> |
||||
|
<!-- <image class="close" src="/static/close.png" v-on:click="$closeInvite"></image> --> |
||||
|
<view class="title">邀请函</view> |
||||
|
<view class="content">您好!您的朋友xxx邀请您对<text>“为什么小朋友到了一定年龄需要打疫苗?”</text>进行专家答疑,您是否接受?</view> |
||||
|
<view class="btn-group"> |
||||
|
<view class="invite-specia">邀请专家</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
export default { |
||||
|
name: 'invite', |
||||
|
|
||||
|
props: { |
||||
|
_specia: String |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
console.log('this.specia', this._specia); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang='scss'> |
||||
|
.invite-box { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
background: rgba(0,0,0,0.5); |
||||
|
z-index: 9999; |
||||
|
|
||||
|
.center-box { |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
transform: translate(-50%, -50%); |
||||
|
width: 622rpx; |
||||
|
padding: 32rpx; |
||||
|
border-radius: 16rpx; |
||||
|
opacity: 1; |
||||
|
background: rgba(255,255,255,1); |
||||
|
|
||||
|
.logo { |
||||
|
position: absolute; |
||||
|
top: -48rpx; |
||||
|
left: 50%; |
||||
|
transform: translateX(-50%); |
||||
|
width: 136rpx; |
||||
|
height: 144rpx; |
||||
|
} |
||||
|
.close { |
||||
|
position: absolute; |
||||
|
top: 24rpx; |
||||
|
right: 24rpx; |
||||
|
width: 48rpx; |
||||
|
height: 48rpx; |
||||
|
} |
||||
|
|
||||
|
.title { |
||||
|
margin-top: 66rpx; |
||||
|
text-align: center; |
||||
|
color: rgba(0,0,0,1); |
||||
|
font-size: 36rpx; |
||||
|
font-weight: 500; |
||||
|
font-family: "PingFang SC"; |
||||
|
letter-spacing: 0.6rpx; |
||||
|
} |
||||
|
|
||||
|
.content { |
||||
|
margin: 40rpx 0; |
||||
|
font-size: 26rpx; |
||||
|
font-family: "PingFang SC"; |
||||
|
letter-spacing: 0.6rpx; |
||||
|
color: #343434; |
||||
|
text { |
||||
|
font-size: 32rpx; |
||||
|
letter-spacing: 0.6rpx; |
||||
|
color: rgba(69,108,255,1); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.btn-group { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
padding: 0 16rpx; |
||||
|
.invite-specia { |
||||
|
width: 526rpx; |
||||
|
height: 88rpx; |
||||
|
line-height: 88rpx; |
||||
|
border-radius: 16rpx; |
||||
|
text-align: center; |
||||
|
background: linear-gradient(-46.8deg, rgba(63,101,255,1) 0%, rgba(97,141,255,1) 100%); |
||||
|
color: #fff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1 @@ |
|||||
|
export default './lib/marked' |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,139 @@ |
|||||
|
/* eslint-disable */ |
||||
|
var provinceData = [{ |
||||
|
"label": "北京市", |
||||
|
"value": "11" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "天津市", |
||||
|
"value": "12" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "河北省", |
||||
|
"value": "13" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "山西省", |
||||
|
"value": "14" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "内蒙古自治区", |
||||
|
"value": "15" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "辽宁省", |
||||
|
"value": "21" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "吉林省", |
||||
|
"value": "22" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "黑龙江省", |
||||
|
"value": "23" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "上海市", |
||||
|
"value": "31" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "江苏省", |
||||
|
"value": "32" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "浙江省", |
||||
|
"value": "33" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "安徽省", |
||||
|
"value": "34" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "福建省", |
||||
|
"value": "35" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "江西省", |
||||
|
"value": "36" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "山东省", |
||||
|
"value": "37" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "河南省", |
||||
|
"value": "41" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "湖北省", |
||||
|
"value": "42" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "湖南省", |
||||
|
"value": "43" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "广东省", |
||||
|
"value": "44" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "广西壮族自治区", |
||||
|
"value": "45" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "海南省", |
||||
|
"value": "46" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "重庆市", |
||||
|
"value": "50" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "四川省", |
||||
|
"value": "51" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "贵州省", |
||||
|
"value": "52" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "云南省", |
||||
|
"value": "53" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "西藏自治区", |
||||
|
"value": "54" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "陕西省", |
||||
|
"value": "61" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "甘肃省", |
||||
|
"value": "62" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "青海省", |
||||
|
"value": "63" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "宁夏回族自治区", |
||||
|
"value": "64" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "新疆维吾尔自治区", |
||||
|
"value": "65" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "台湾", |
||||
|
"value": "66" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "香港", |
||||
|
"value": "67" |
||||
|
}, |
||||
|
{ |
||||
|
"label": "澳门", |
||||
|
"value": "68" |
||||
|
} |
||||
|
] |
||||
|
export default provinceData; |
@ -0,0 +1,230 @@ |
|||||
|
<template> |
||||
|
<div class="mpvue-picker"> |
||||
|
<div :class="{'pickerMask':showPicker}" @click="maskClick" catchtouchmove="true"></div> |
||||
|
<div class="mpvue-picker-content " :class="{'mpvue-picker-view-show':showPicker}"> |
||||
|
<div class="mpvue-picker__hd" catchtouchmove="true"> |
||||
|
<div class="mpvue-picker__action" @click="pickerCancel">取消</div> |
||||
|
<div class="mpvue-picker__action" :style="{color:themeColor}" @click="pickerConfirm">确定</div> |
||||
|
</div> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" @change="pickerChange"> |
||||
|
<block> |
||||
|
<picker-view-column> |
||||
|
<div class="picker-item" v-for="(item,index) in provinceDataList" :key="index">{{item.label}}</div> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<div class="picker-item" v-for="(item,index) in cityDataList" :key="index">{{item.label}}</div> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<div class="picker-item" v-for="(item,index) in areaDataList" :key="index">{{item.label}}</div> |
||||
|
</picker-view-column> |
||||
|
</block> |
||||
|
</picker-view> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import provinceData from './city-data/province.js'; |
||||
|
import cityData from './city-data/city.js'; |
||||
|
import areaData from './city-data/area.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
pickerValue: [0, 0, 0], |
||||
|
provinceDataList: provinceData, |
||||
|
cityDataList: cityData[0], |
||||
|
areaDataList: areaData[0][0], |
||||
|
/* 是否显示控件 */ |
||||
|
showPicker: false, |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.init() |
||||
|
}, |
||||
|
props: { |
||||
|
/* 默认值 */ |
||||
|
pickerValueDefault: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [0, 0, 0] |
||||
|
} |
||||
|
}, |
||||
|
/* 主题色 */ |
||||
|
themeColor: String |
||||
|
}, |
||||
|
watch: { |
||||
|
pickerValueDefault() { |
||||
|
this.init(); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init() { |
||||
|
this.handPickValueDefault(); // 对 pickerValueDefault 做兼容处理 |
||||
|
|
||||
|
const pickerValueDefault = this.pickerValueDefault |
||||
|
|
||||
|
this.cityDataList = cityData[pickerValueDefault[0]]; |
||||
|
this.areaDataList = areaData[pickerValueDefault[0]][pickerValueDefault[1]]; |
||||
|
this.pickerValue = pickerValueDefault; |
||||
|
}, |
||||
|
show() { |
||||
|
setTimeout(() => { |
||||
|
this.showPicker = true; |
||||
|
}, 0); |
||||
|
}, |
||||
|
maskClick() { |
||||
|
this.pickerCancel(); |
||||
|
}, |
||||
|
pickerCancel() { |
||||
|
this.showPicker = false; |
||||
|
this._$emit('onCancel'); |
||||
|
}, |
||||
|
pickerConfirm(e) { |
||||
|
this.showPicker = false; |
||||
|
this._$emit('onConfirm'); |
||||
|
}, |
||||
|
showPickerView() { |
||||
|
this.showPicker = true; |
||||
|
}, |
||||
|
handPickValueDefault() { |
||||
|
const pickerValueDefault = this.pickerValueDefault |
||||
|
|
||||
|
let provinceIndex = pickerValueDefault[0] |
||||
|
let cityIndex = pickerValueDefault[1] |
||||
|
const areaIndex = pickerValueDefault[2] |
||||
|
if ( |
||||
|
provinceIndex !== 0 || |
||||
|
cityIndex !== 0 || |
||||
|
areaIndex !== 0 |
||||
|
) { |
||||
|
if (provinceIndex > provinceData.length - 1) { |
||||
|
this.pickerValueDefault[0] = provinceIndex = provinceData.length - 1; |
||||
|
} |
||||
|
if (cityIndex > cityData[provinceIndex].length - 1) { |
||||
|
this.pickerValueDefault[1] = cityIndex = cityData[provinceIndex].length - 1; |
||||
|
} |
||||
|
if (areaIndex > areaData[provinceIndex][cityIndex].length - 1) { |
||||
|
this.pickerValueDefault[2] = areaData[provinceIndex][cityIndex].length - 1; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
pickerChange(e) { |
||||
|
let changePickerValue = e.mp.detail.value; |
||||
|
if (this.pickerValue[0] !== changePickerValue[0]) { |
||||
|
// 第一级发生滚动 |
||||
|
this.cityDataList = cityData[changePickerValue[0]]; |
||||
|
this.areaDataList = areaData[changePickerValue[0]][0]; |
||||
|
changePickerValue[1] = 0; |
||||
|
changePickerValue[2] = 0; |
||||
|
} else if (this.pickerValue[1] !== changePickerValue[1]) { |
||||
|
// 第二级滚动 |
||||
|
this.areaDataList = |
||||
|
areaData[changePickerValue[0]][changePickerValue[1]]; |
||||
|
changePickerValue[2] = 0; |
||||
|
} |
||||
|
this.pickerValue = changePickerValue; |
||||
|
this._$emit('onChange'); |
||||
|
}, |
||||
|
_$emit(emitName) { |
||||
|
let pickObj = { |
||||
|
label: this._getLabel(), |
||||
|
value: this.pickerValue, |
||||
|
cityCode: this._getCityCode() |
||||
|
}; |
||||
|
this.$emit(emitName, pickObj); |
||||
|
}, |
||||
|
_getLabel() { |
||||
|
let pcikerLabel = |
||||
|
this.provinceDataList[this.pickerValue[0]].label + |
||||
|
'-' + |
||||
|
this.cityDataList[this.pickerValue[1]].label + |
||||
|
'-' + |
||||
|
this.areaDataList[this.pickerValue[2]].label; |
||||
|
return pcikerLabel; |
||||
|
}, |
||||
|
_getCityCode() { |
||||
|
return this.areaDataList[this.pickerValue[2]].value; |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.pickerMask { |
||||
|
position: fixed; |
||||
|
z-index: 1000; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
background: rgba(0, 0, 0, 0.6); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-content { |
||||
|
position: fixed; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
transition: all 0.3s ease; |
||||
|
transform: translateY(100%); |
||||
|
z-index: 3000; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-view-show { |
||||
|
transform: translateY(0); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__hd { |
||||
|
display: flex; |
||||
|
padding: 9px 15px; |
||||
|
background-color: #fff; |
||||
|
position: relative; |
||||
|
text-align: center; |
||||
|
font-size: 17px; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__hd:after { |
||||
|
content: ' '; |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
right: 0; |
||||
|
height: 1px; |
||||
|
border-bottom: 1px solid #e5e5e5; |
||||
|
color: #e5e5e5; |
||||
|
transform-origin: 0 100%; |
||||
|
transform: scaleY(0.5); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action { |
||||
|
display: block; |
||||
|
flex: 1; |
||||
|
color: #1aad19; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action:first-child { |
||||
|
text-align: left; |
||||
|
color: #888; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action:last-child { |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.picker-item { |
||||
|
text-align: center; |
||||
|
line-height: 40px; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-view { |
||||
|
position: relative; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
height: 238px; |
||||
|
background-color: rgba(255, 255, 255, 1); |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,123 @@ |
|||||
|
<template> |
||||
|
<canvas v-if="canvasId" class="ec-canvas" :id="canvasId" :canvasId="canvasId" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd" @error="error"></canvas> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import WxCanvas from './wx-canvas'; |
||||
|
|
||||
|
export default { |
||||
|
props: { |
||||
|
canvasId: { |
||||
|
type: String, |
||||
|
default: 'ec-canvas' |
||||
|
}, |
||||
|
lazyLoad: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
disableTouch: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
throttleTouch: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
}, |
||||
|
// #ifdef H5 |
||||
|
mounted() { |
||||
|
if (!this.lazyLoad) this.init(); |
||||
|
}, |
||||
|
// #endif |
||||
|
// #ifndef H5 |
||||
|
onReady() { |
||||
|
if (!this.lazyLoad) this.init(); |
||||
|
}, |
||||
|
// #endif |
||||
|
methods: { |
||||
|
setChart(chart){ |
||||
|
this.chart = chart |
||||
|
}, |
||||
|
init() { |
||||
|
const { canvasId } = this; |
||||
|
this.ctx = wx.createCanvasContext(canvasId, this); |
||||
|
|
||||
|
this.canvas = new WxCanvas(this.ctx, canvasId); |
||||
|
|
||||
|
const query = wx.createSelectorQuery().in(this); |
||||
|
query |
||||
|
.select(`#${canvasId}`) |
||||
|
.boundingClientRect(res => { |
||||
|
if (!res) { |
||||
|
setTimeout(() => this.init(), 50); |
||||
|
return; |
||||
|
} |
||||
|
this.$emit('onInit', { |
||||
|
width: res.width, |
||||
|
height: res.height |
||||
|
}); |
||||
|
}) |
||||
|
.exec(); |
||||
|
}, |
||||
|
canvasToTempFilePath(opt) { |
||||
|
const { canvasId } = this; |
||||
|
this.ctx.draw(true, () => { |
||||
|
wx.canvasToTempFilePath({ |
||||
|
canvasId, |
||||
|
...opt |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
touchStart(e) { |
||||
|
const { disableTouch, chart } = this; |
||||
|
if (disableTouch || !chart || !e.mp.touches.length) return; |
||||
|
const touch = e.mp.touches[0]; |
||||
|
chart._zr.handler.dispatch('mousedown', { |
||||
|
zrX: touch.x, |
||||
|
zrY: touch.y |
||||
|
}); |
||||
|
chart._zr.handler.dispatch('mousemove', { |
||||
|
zrX: touch.x, |
||||
|
zrY: touch.y |
||||
|
}); |
||||
|
}, |
||||
|
touchMove(e) { |
||||
|
const { disableTouch, throttleTouch, chart, lastMoveTime } = this; |
||||
|
if (disableTouch || !chart || !e.mp.touches.length) return; |
||||
|
|
||||
|
if (throttleTouch) { |
||||
|
const currMoveTime = Date.now(); |
||||
|
if (currMoveTime - lastMoveTime < 240) return; |
||||
|
this.lastMoveTime = currMoveTime; |
||||
|
} |
||||
|
|
||||
|
const touch = e.mp.touches[0]; |
||||
|
chart._zr.handler.dispatch('mousemove', { |
||||
|
zrX: touch.x, |
||||
|
zrY: touch.y |
||||
|
}); |
||||
|
}, |
||||
|
touchEnd(e) { |
||||
|
const { disableTouch, chart } = this; |
||||
|
if (disableTouch || !chart) return; |
||||
|
const touch = e.mp.changedTouches ? e.mp.changedTouches[0] : {}; |
||||
|
chart._zr.handler.dispatch('mouseup', { |
||||
|
zrX: touch.x, |
||||
|
zrY: touch.y |
||||
|
}); |
||||
|
chart._zr.handler.dispatch('click', { |
||||
|
zrX: touch.x, |
||||
|
zrY: touch.y |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.ec-canvas { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
flex: 1; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,73 @@ |
|||||
|
export default class WxCanvas { |
||||
|
constructor(ctx, canvasId) { |
||||
|
this.ctx = ctx; |
||||
|
this.canvasId = canvasId; |
||||
|
this.chart = null; |
||||
|
|
||||
|
WxCanvas.initStyle(ctx); |
||||
|
this.initEvent(); |
||||
|
} |
||||
|
|
||||
|
getContext(contextType) { |
||||
|
return contextType === '2d' ? this.ctx : null; |
||||
|
} |
||||
|
|
||||
|
setChart(chart) { |
||||
|
this.chart = chart; |
||||
|
} |
||||
|
|
||||
|
attachEvent() { |
||||
|
// noop
|
||||
|
} |
||||
|
|
||||
|
detachEvent() { |
||||
|
// noop
|
||||
|
} |
||||
|
|
||||
|
static initStyle(ctx) { |
||||
|
const styles = ['fillStyle', 'strokeStyle', 'globalAlpha', |
||||
|
'textAlign', 'textBaseAlign', 'shadow', 'lineWidth', |
||||
|
'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize']; |
||||
|
|
||||
|
styles.forEach((style) => { |
||||
|
Object.defineProperty(ctx, style, { |
||||
|
set: (value) => { |
||||
|
if ((style !== 'fillStyle' && style !== 'strokeStyle') |
||||
|
|| (value !== 'none' && value !== null) |
||||
|
) { |
||||
|
ctx[`set${style.charAt(0).toUpperCase()}${style.slice(1)}`](value); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
ctx.createRadialGradient = () => ctx.createCircularGradient(arguments); |
||||
|
} |
||||
|
|
||||
|
initEvent() { |
||||
|
this.event = {}; |
||||
|
const eventNames = [{ |
||||
|
wxName: 'touchStart', |
||||
|
ecName: 'mousedown', |
||||
|
}, { |
||||
|
wxName: 'touchMove', |
||||
|
ecName: 'mousemove', |
||||
|
}, { |
||||
|
wxName: 'touchEnd', |
||||
|
ecName: 'mouseup', |
||||
|
}, { |
||||
|
wxName: 'touchEnd', |
||||
|
ecName: 'click', |
||||
|
}]; |
||||
|
|
||||
|
eventNames.forEach((name) => { |
||||
|
this.event[name.wxName] = (e) => { |
||||
|
const touch = e.mp.touches[0]; |
||||
|
this.chart._zr.handler.dispatch(name.ecName, { |
||||
|
zrX: name.wxName === 'tap' ? touch.clientX : touch.x, |
||||
|
zrY: name.wxName === 'tap' ? touch.clientY : touch.y, |
||||
|
}); |
||||
|
}; |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,484 @@ |
|||||
|
<template> |
||||
|
<view class="mpvue-picker"> |
||||
|
<view :class="{'pickerMask':showPicker}" @click="maskClick" catchtouchmove="true"></view> |
||||
|
<view class="mpvue-picker-content " :class="{'mpvue-picker-view-show':showPicker}"> |
||||
|
<view class="mpvue-picker__hd" catchtouchmove="true"> |
||||
|
<view class="mpvue-picker__action" @click="pickerCancel">取消</view> |
||||
|
<view class="mpvue-picker__action" :style="{color:themeColor}" @click="pickerConfirm">确定</view> |
||||
|
</view> |
||||
|
<!-- 单列 --> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" |
||||
|
@change="pickerChange" v-if="mode==='selector' && pickerValueSingleArray.length > 0"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueSingleArray" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</picker-view> |
||||
|
<!-- 时间选择器 --> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" |
||||
|
@change="pickerChange" v-if="mode==='timeSelector'"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueHour" :key="index">{{item.label}}</view> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMinute" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</picker-view> |
||||
|
<!-- 多列选择 --> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" |
||||
|
@change="pickerChange" v-if="mode==='multiSelector'"> |
||||
|
<!-- #ifdef VUE3 --> |
||||
|
<template v-for="(n,index) in pickerValueMulArray.length" :key="index"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index1) in pickerValueMulArray[n]" :key="index1"> |
||||
|
{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</template> |
||||
|
<!-- #endif --> |
||||
|
<!-- #ifndef VUE3 --> |
||||
|
<block v-for="(n,index) in pickerValueMulArray.length" :key="index"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index1) in pickerValueMulArray[n]" :key="index1"> |
||||
|
{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</block> |
||||
|
<!-- #endif --> |
||||
|
</picker-view> |
||||
|
<!-- 二级联动 --> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" |
||||
|
@change="pickerChangeMul" v-if="mode==='multiLinkageSelector' && deepLength===2"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMulTwoOne" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMulTwoTwo" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</picker-view> |
||||
|
<!-- 三级联动 --> |
||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" |
||||
|
@change="pickerChangeMul" v-if="mode==='multiLinkageSelector' && deepLength===3"> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMulThreeOne" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMulThreeTwo" :key="index">{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
<picker-view-column> |
||||
|
<view class="picker-item" v-for="(item,index) in pickerValueMulThreeThree" :key="index"> |
||||
|
{{item.label}} |
||||
|
</view> |
||||
|
</picker-view-column> |
||||
|
</picker-view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
pickerChangeValue: [], |
||||
|
pickerValue: [], |
||||
|
pickerValueArrayChange: true, |
||||
|
modeChange: false, |
||||
|
pickerValueSingleArray: [], |
||||
|
pickerValueHour: [], |
||||
|
pickerValueMinute: [], |
||||
|
pickerValueMulArray: [], |
||||
|
pickerValueMulTwoOne: [], |
||||
|
pickerValueMulTwoTwo: [], |
||||
|
pickerValueMulThreeOne: [], |
||||
|
pickerValueMulThreeTwo: [], |
||||
|
pickerValueMulThreeThree: [], |
||||
|
/* 是否显示控件 */ |
||||
|
showPicker: false, |
||||
|
}; |
||||
|
}, |
||||
|
props: { |
||||
|
/* mode */ |
||||
|
mode: { |
||||
|
type: String, |
||||
|
default: 'selector' |
||||
|
}, |
||||
|
/* picker 数值 */ |
||||
|
pickerValueArray: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
/* 默认值 */ |
||||
|
pickerValueDefault: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
/* 几级联动 */ |
||||
|
deepLength: { |
||||
|
type: Number, |
||||
|
default: 2 |
||||
|
}, |
||||
|
/* 主题色 */ |
||||
|
themeColor: String |
||||
|
}, |
||||
|
watch: { |
||||
|
pickerValueArray(oldVal, newVal) { |
||||
|
this.pickerValueArrayChange = true; |
||||
|
}, |
||||
|
mode(oldVal, newVal) { |
||||
|
this.modeChange = true; |
||||
|
}, |
||||
|
pickerValueArray(val) { |
||||
|
this.initPicker(val); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
initPicker(valueArray) { |
||||
|
let pickerValueArray = valueArray; |
||||
|
this.pickerValue = this.pickerValueDefault; |
||||
|
// 初始化多级联动 |
||||
|
if (this.mode === 'selector') { |
||||
|
this.pickerValueSingleArray = valueArray; |
||||
|
} else if (this.mode === 'timeSelector') { |
||||
|
this.modeChange = false; |
||||
|
let hourArray = []; |
||||
|
let minuteArray = []; |
||||
|
for (let i = 0; i < 24; i++) { |
||||
|
hourArray.push({ |
||||
|
value: i, |
||||
|
label: i > 9 ? `${i} 时` : `0${i} 时` |
||||
|
}); |
||||
|
} |
||||
|
for (let i = 0; i < 60; i++) { |
||||
|
minuteArray.push({ |
||||
|
value: i, |
||||
|
label: i > 9 ? `${i} 分` : `0${i} 分` |
||||
|
}); |
||||
|
} |
||||
|
this.pickerValueHour = hourArray; |
||||
|
this.pickerValueMinute = minuteArray; |
||||
|
} else if (this.mode === 'multiSelector') { |
||||
|
this.pickerValueMulArray = valueArray; |
||||
|
} else if (this.mode === 'multiLinkageSelector' && this.deepLength === 2) { |
||||
|
// 两级联动 |
||||
|
let pickerValueMulTwoOne = []; |
||||
|
let pickerValueMulTwoTwo = []; |
||||
|
// 第一列 |
||||
|
for (let i = 0, length = pickerValueArray.length; i < length; i++) { |
||||
|
pickerValueMulTwoOne.push(pickerValueArray[i]); |
||||
|
} |
||||
|
// 渲染第二列 |
||||
|
// 如果有设定的默认值 |
||||
|
if (this.pickerValueDefault.length === 2) { |
||||
|
let num = this.pickerValueDefault[0]; |
||||
|
for ( |
||||
|
let i = 0, length = pickerValueArray[num].children.length; i < length; i++ |
||||
|
) { |
||||
|
pickerValueMulTwoTwo.push(pickerValueArray[num].children[i]); |
||||
|
} |
||||
|
} else { |
||||
|
for ( |
||||
|
let i = 0, length = pickerValueArray[0].children.length; i < length; i++ |
||||
|
) { |
||||
|
pickerValueMulTwoTwo.push(pickerValueArray[0].children[i]); |
||||
|
} |
||||
|
} |
||||
|
this.pickerValueMulTwoOne = pickerValueMulTwoOne; |
||||
|
this.pickerValueMulTwoTwo = pickerValueMulTwoTwo; |
||||
|
} else if ( |
||||
|
this.mode === 'multiLinkageSelector' && |
||||
|
this.deepLength === 3 |
||||
|
) { |
||||
|
let pickerValueMulThreeOne = []; |
||||
|
let pickerValueMulThreeTwo = []; |
||||
|
let pickerValueMulThreeThree = []; |
||||
|
// 第一列 |
||||
|
for (let i = 0, length = pickerValueArray.length; i < length; i++) { |
||||
|
pickerValueMulThreeOne.push(pickerValueArray[i]); |
||||
|
} |
||||
|
// 渲染第二列 |
||||
|
this.pickerValueDefault = |
||||
|
this.pickerValueDefault.length === 3 ? |
||||
|
this.pickerValueDefault : [0, 0, 0]; |
||||
|
if (this.pickerValueDefault.length === 3) { |
||||
|
let num = this.pickerValueDefault[0]; |
||||
|
for ( |
||||
|
let i = 0, length = pickerValueArray[num].children.length; i < length; i++ |
||||
|
) { |
||||
|
pickerValueMulThreeTwo.push(pickerValueArray[num].children[i]); |
||||
|
} |
||||
|
// 第三列 |
||||
|
let numSecond = this.pickerValueDefault[1]; |
||||
|
for (let i = 0, length = pickerValueArray[num].children[numSecond].children.length; i < |
||||
|
length; i++) { |
||||
|
pickerValueMulThreeThree.push( |
||||
|
pickerValueArray[num].children[numSecond].children[i] |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
this.pickerValueMulThreeOne = pickerValueMulThreeOne; |
||||
|
this.pickerValueMulThreeTwo = pickerValueMulThreeTwo; |
||||
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree; |
||||
|
} |
||||
|
}, |
||||
|
show() { |
||||
|
setTimeout(() => { |
||||
|
if (this.pickerValueArrayChange || this.modeChange) { |
||||
|
this.initPicker(this.pickerValueArray); |
||||
|
this.showPicker = true; |
||||
|
this.pickerValueArrayChange = false; |
||||
|
this.modeChange = false; |
||||
|
} else { |
||||
|
this.showPicker = true; |
||||
|
} |
||||
|
}, 0); |
||||
|
}, |
||||
|
maskClick() { |
||||
|
this.pickerCancel(); |
||||
|
}, |
||||
|
pickerCancel() { |
||||
|
this.showPicker = false; |
||||
|
this._initPickerVale(); |
||||
|
let pickObj = { |
||||
|
index: this.pickerValue, |
||||
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value, |
||||
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label |
||||
|
}; |
||||
|
this.$emit('onCancel', pickObj); |
||||
|
}, |
||||
|
pickerConfirm(e) { |
||||
|
this.showPicker = false; |
||||
|
this._initPickerVale(); |
||||
|
let pickObj = { |
||||
|
index: this.pickerValue, |
||||
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value, |
||||
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label |
||||
|
}; |
||||
|
this.$emit('onConfirm', pickObj); |
||||
|
}, |
||||
|
showPickerView() { |
||||
|
this.showPicker = true; |
||||
|
}, |
||||
|
pickerChange(e) { |
||||
|
console.log(11111111, e); |
||||
|
this.pickerValue = e.detail.value; |
||||
|
let pickObj = { |
||||
|
index: this.pickerValue, |
||||
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value, |
||||
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label |
||||
|
}; |
||||
|
this.$emit('onChange', pickObj); |
||||
|
}, |
||||
|
pickerChangeMul(e) { |
||||
|
if (this.deepLength === 2) { |
||||
|
let pickerValueArray = this.pickerValueArray; |
||||
|
let changeValue = e.detail.value; |
||||
|
// 处理第一列滚动 |
||||
|
if (changeValue[0] !== this.pickerValue[0]) { |
||||
|
let pickerValueMulTwoTwo = []; |
||||
|
// 第一列滚动第二列数据更新 |
||||
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) { |
||||
|
pickerValueMulTwoTwo.push(pickerValueArray[changeValue[0]].children[i]); |
||||
|
} |
||||
|
this.pickerValueMulTwoTwo = pickerValueMulTwoTwo; |
||||
|
// 第二列初始化为 0 |
||||
|
changeValue[1] = 0; |
||||
|
} |
||||
|
this.pickerValue = changeValue; |
||||
|
} else if (this.deepLength === 3) { |
||||
|
let pickerValueArray = this.pickerValueArray; |
||||
|
let changeValue = e.detail.value; |
||||
|
let pickerValueMulThreeTwo = []; |
||||
|
let pickerValueMulThreeThree = []; |
||||
|
// 重新渲染第二列 |
||||
|
// 如果是第一列滚动 |
||||
|
if (changeValue[0] !== this.pickerValue[0]) { |
||||
|
this.pickerValueMulThreeTwo = []; |
||||
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) { |
||||
|
pickerValueMulThreeTwo.push(pickerValueArray[changeValue[0]].children[i]); |
||||
|
} |
||||
|
// 重新渲染第三列 |
||||
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children[0].children.length; i < |
||||
|
length; i++) { |
||||
|
pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[0].children[i]); |
||||
|
} |
||||
|
changeValue[1] = 0; |
||||
|
changeValue[2] = 0; |
||||
|
this.pickerValueMulThreeTwo = pickerValueMulThreeTwo; |
||||
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree; |
||||
|
} else if (changeValue[1] !== this.pickerValue[1]) { |
||||
|
// 第二列滚动 |
||||
|
// 重新渲染第三列 |
||||
|
this.pickerValueMulThreeThree = []; |
||||
|
pickerValueMulThreeTwo = this.pickerValueMulThreeTwo; |
||||
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children[changeValue[1]].children |
||||
|
.length; i < |
||||
|
length; i++) { |
||||
|
pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[changeValue[1]] |
||||
|
.children[ |
||||
|
i]); |
||||
|
} |
||||
|
changeValue[2] = 0; |
||||
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree; |
||||
|
} |
||||
|
this.pickerValue = changeValue; |
||||
|
} |
||||
|
let pickObj = { |
||||
|
index: this.pickerValue, |
||||
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value, |
||||
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label |
||||
|
}; |
||||
|
this.$emit('onChange', pickObj); |
||||
|
}, |
||||
|
// 获取 pxikerLabel |
||||
|
_getPickerLabelAndValue(value, mode) { |
||||
|
let pickerLable; |
||||
|
let pickerGetValue = []; |
||||
|
// selector |
||||
|
if (mode === 'selector') { |
||||
|
pickerLable = this.pickerValueSingleArray[value].label; |
||||
|
pickerGetValue.push(this.pickerValueSingleArray[value].value); |
||||
|
} else if (mode === 'timeSelector') { |
||||
|
pickerLable = `${this.pickerValueHour[value[0]].label}-${this.pickerValueMinute[value[1]].label}`; |
||||
|
pickerGetValue.push(this.pickerValueHour[value[0]].value); |
||||
|
pickerGetValue.push(this.pickerValueHour[value[1]].value); |
||||
|
} else if (mode === 'multiSelector') { |
||||
|
for (let i = 0; i < value.length; i++) { |
||||
|
if (i > 0) { |
||||
|
pickerLable += this.pickerValueMulArray[i][value[i]].label + (i === value.length - 1 ? '' : |
||||
|
'-'); |
||||
|
} else { |
||||
|
pickerLable = this.pickerValueMulArray[i][value[i]].label + '-'; |
||||
|
} |
||||
|
pickerGetValue.push(this.pickerValueMulArray[i][value[i]].value); |
||||
|
} |
||||
|
} else if (mode === 'multiLinkageSelector') { |
||||
|
/* eslint-disable indent */ |
||||
|
pickerLable = |
||||
|
this.deepLength === 2 ? |
||||
|
`${this.pickerValueMulTwoOne[value[0]].label}-${this.pickerValueMulTwoTwo[value[1]].label}` : |
||||
|
`${this.pickerValueMulThreeOne[value[0]].label}-${this.pickerValueMulThreeTwo[value[1]].label}-${this.pickerValueMulThreeThree[value[2]].label}`; |
||||
|
if (this.deepLength === 2) { |
||||
|
pickerGetValue.push(this.pickerValueMulTwoOne[value[0]].value); |
||||
|
pickerGetValue.push(this.pickerValueMulTwoTwo[value[1]].value); |
||||
|
} else { |
||||
|
pickerGetValue.push(this.pickerValueMulThreeOne[value[0]].value); |
||||
|
pickerGetValue.push(this.pickerValueMulThreeTwo[value[1]].value); |
||||
|
pickerGetValue.push(this.pickerValueMulThreeThree[value[2]].value); |
||||
|
} |
||||
|
/* eslint-enable indent */ |
||||
|
} |
||||
|
return { |
||||
|
label: pickerLable, |
||||
|
value: pickerGetValue |
||||
|
}; |
||||
|
}, |
||||
|
// 初始化 pickerValue 默认值 |
||||
|
_initPickerVale() { |
||||
|
if (this.pickerValue.length === 0) { |
||||
|
if (this.mode === 'selector') { |
||||
|
this.pickerValue = [0]; |
||||
|
} else if (this.mode === 'multiSelector') { |
||||
|
this.pickerValue = new Int8Array(this.pickerValueArray.length); |
||||
|
} else if ( |
||||
|
this.mode === 'multiLinkageSelector' && |
||||
|
this.deepLength === 2 |
||||
|
) { |
||||
|
this.pickerValue = [0, 0]; |
||||
|
} else if ( |
||||
|
this.mode === 'multiLinkageSelector' && |
||||
|
this.deepLength === 3 |
||||
|
) { |
||||
|
this.pickerValue = [0, 0, 0]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.pickerMask { |
||||
|
position: fixed; |
||||
|
z-index: 1000; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
background: rgba(0, 0, 0, 0.6); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-content { |
||||
|
position: fixed; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
transition: all 0.3s ease; |
||||
|
transform: translateY(100%); |
||||
|
z-index: 3000; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-view-show { |
||||
|
transform: translateY(0); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__hd { |
||||
|
display: flex; |
||||
|
padding: 9px 15px; |
||||
|
background-color: #fff; |
||||
|
position: relative; |
||||
|
text-align: center; |
||||
|
font-size: 17px; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__hd:after { |
||||
|
content: ' '; |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
right: 0; |
||||
|
height: 1px; |
||||
|
border-bottom: 1px solid #e5e5e5; |
||||
|
color: #e5e5e5; |
||||
|
transform-origin: 0 100%; |
||||
|
transform: scaleY(0.5); |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action { |
||||
|
display: block; |
||||
|
flex: 1; |
||||
|
color: #1aad19; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action:first-child { |
||||
|
text-align: left; |
||||
|
color: #888; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker__action:last-child { |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.picker-item { |
||||
|
text-align: center; |
||||
|
line-height: 40px; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.mpvue-picker-view { |
||||
|
position: relative; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
height: 238px; |
||||
|
background-color: rgba(255, 255, 255, 1); |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,175 @@ |
|||||
|
class GestureLock { |
||||
|
|
||||
|
constructor(containerWidth, cycleRadius) { |
||||
|
this.containerWidth = containerWidth; // 容器宽度
|
||||
|
this.cycleRadius = cycleRadius; // 圆的半径
|
||||
|
|
||||
|
this.circleArray = []; // 全部圆的对象数组
|
||||
|
this.checkPoints = []; // 选中的圆的对象数组
|
||||
|
this.lineArray = []; // 已激活锁之间的线段数组
|
||||
|
this.lastCheckPoint = 0; // 最后一个激活的锁
|
||||
|
this.offsetX = 0; // 容器的 X 偏移
|
||||
|
this.offsetY = 0; // 容器的 Y 偏移
|
||||
|
this.activeLine = {}; // 最后一个激活的锁与当前位置之间的线段
|
||||
|
|
||||
|
this.windowWidth = wx.getSystemInfoSync().windowWidth; // 窗口大小(用于rpx 和 px 转换)
|
||||
|
|
||||
|
this.initCircleArray(); |
||||
|
} |
||||
|
|
||||
|
// 初始化 画布上的 9个圆
|
||||
|
initCircleArray() { |
||||
|
const cycleMargin = (this.containerWidth - 6 * this.cycleRadius) / 6; |
||||
|
let count = 0; |
||||
|
for (let i = 0; i < 3; i++) { |
||||
|
for (let j = 0; j < 3; j++) { |
||||
|
count++; |
||||
|
this.circleArray.push({ |
||||
|
count: count, |
||||
|
x: this.rpxTopx((cycleMargin + this.cycleRadius) * (j * 2 + 1)), |
||||
|
y: this.rpxTopx((cycleMargin + this.cycleRadius) * (i * 2 + 1)), |
||||
|
radius: this.rpxTopx(this.cycleRadius), |
||||
|
check: false, |
||||
|
style: { |
||||
|
left: (cycleMargin + this.cycleRadius) * (j * 2 + 1) - this.cycleRadius + 'rpx', |
||||
|
top: (cycleMargin + this.cycleRadius) * (i * 2 + 1) - this.cycleRadius + 'rpx', |
||||
|
width: this.cycleRadius * 2 + 'rpx', |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
onTouchStart(e) { |
||||
|
this.setOffset(e); |
||||
|
this.checkTouch({ |
||||
|
x: e.touches[0].pageX - this.offsetX, |
||||
|
y: e.touches[0].pageY - this.offsetY |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
onTouchMove(e) { |
||||
|
this.moveDraw(e) |
||||
|
} |
||||
|
|
||||
|
onTouchEnd(e) { |
||||
|
const checkPoints = this.checkPoints; |
||||
|
this.reset(); |
||||
|
return checkPoints; |
||||
|
} |
||||
|
|
||||
|
// 初始化 偏移量
|
||||
|
setOffset(e) { |
||||
|
this.offsetX = e.currentTarget.offsetLeft; |
||||
|
this.offsetY = e.currentTarget.offsetTop; |
||||
|
} |
||||
|
|
||||
|
// 检测当时 触摸位置是否位于 锁上
|
||||
|
checkTouch({ |
||||
|
x, |
||||
|
y |
||||
|
}) { |
||||
|
for (let i = 0; i < this.circleArray.length; i++) { |
||||
|
let point = this.circleArray[i]; |
||||
|
if (this.isPointInCycle(x, y, point.x, point.y, point.radius)) { |
||||
|
if (!point.check) { |
||||
|
this.checkPoints.push(point.count); |
||||
|
if (this.lastCheckPoint != 0) { |
||||
|
// 已激活锁之间的线段
|
||||
|
const line = this.drawLine(this.lastCheckPoint, point); |
||||
|
this.lineArray.push(line); |
||||
|
} |
||||
|
this.lastCheckPoint = point; |
||||
|
} |
||||
|
point.check = true; |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 画线 - 返回 样式 对象
|
||||
|
drawLine(start, end) { |
||||
|
const width = this.getPointDis(start.x, start.y, end.x, end.y); |
||||
|
const rotate = this.getAngle(start, end); |
||||
|
|
||||
|
return { |
||||
|
activeLeft: start.x + 'px', |
||||
|
activeTop: start.y + 'px', |
||||
|
activeWidth: width + 'px', |
||||
|
activeRotate: rotate + 'deg' |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// 获取 画线的 角度
|
||||
|
getAngle(start, end) { |
||||
|
var diff_x = end.x - start.x, |
||||
|
diff_y = end.y - start.y; |
||||
|
if (diff_x >= 0) { |
||||
|
return 360 * Math.atan(diff_y / diff_x) / (2 * Math.PI); |
||||
|
} else { |
||||
|
return 180 + 360 * Math.atan(diff_y / diff_x) / (2 * Math.PI); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 判断 当前点是否位于 锁内
|
||||
|
isPointInCycle(x, y, circleX, circleY, radius) { |
||||
|
return (this.getPointDis(x, y, circleX, circleY) < radius) ? true : false; |
||||
|
} |
||||
|
|
||||
|
// 获取两点之间距离
|
||||
|
getPointDis(ax, ay, bx, by) { |
||||
|
return Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2)); |
||||
|
} |
||||
|
|
||||
|
// 移动 绘制
|
||||
|
moveDraw(e) { |
||||
|
// 画经过的圆
|
||||
|
const x = e.touches[0].pageX - this.offsetX; |
||||
|
const y = e.touches[0].pageY - this.offsetY; |
||||
|
this.checkTouch({ |
||||
|
x, |
||||
|
y |
||||
|
}); |
||||
|
|
||||
|
// 画 最后一个激活的锁与当前位置之间的线段
|
||||
|
this.activeLine = this.drawLine(this.lastCheckPoint, { |
||||
|
x, |
||||
|
y |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
// 使 画布 恢复初始状态
|
||||
|
reset() { |
||||
|
this.circleArray.forEach((item) => { |
||||
|
item.check = false; |
||||
|
}); |
||||
|
this.checkPoints = []; |
||||
|
this.lineArray = []; |
||||
|
this.activeLine = {}; |
||||
|
this.lastCheckPoint = 0; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 获取 最后一个激活的锁与当前位置之间的线段
|
||||
|
getActiveLine() { |
||||
|
return this.activeLine; |
||||
|
} |
||||
|
|
||||
|
// 获取 圆对象数组
|
||||
|
getCycleArray() { |
||||
|
return this.circleArray; |
||||
|
} |
||||
|
|
||||
|
// 获取 已激活锁之间的线段
|
||||
|
getLineArray() { |
||||
|
return this.lineArray; |
||||
|
} |
||||
|
|
||||
|
// 将 RPX 转换成 PX
|
||||
|
rpxTopx(rpx) { |
||||
|
return rpx / 750 * this.windowWidth; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default GestureLock; |
@ -0,0 +1,138 @@ |
|||||
|
<template> |
||||
|
<view class="gesture-lock" :class="{error:error}" :style="{width: containerWidth +'rpx', height:containerWidth +'rpx'}" |
||||
|
@touchstart.stop="onTouchStart" @touchmove.stop="onTouchMove" @touchend.stop="onTouchEnd"> |
||||
|
<!-- 同级 v-for 的 key 重复会有问题,需要套一层。 --> |
||||
|
<!-- 9 个圆 --> |
||||
|
<view> |
||||
|
<view v-for="(item,i) in circleArray" :key="i" class="cycle" :class="{check:item.check}" :style="{left:item.style.left,top:item.style.top,width:item.style.width,height:item.style.width}"> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view> |
||||
|
<!-- 已激活锁之间的线段 --> |
||||
|
<view v-for="(item,i) in lineArray" :key="i" class="line" :style="{left:item.activeLeft,top:item.activeTop,width:item.activeWidth,'-webkit-transform':'rotate('+item.activeRotate+')',transform:'rotate('+item.activeRotate+')'}"> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- 最后一个激活的锁与当前位置之间的线段 --> |
||||
|
<view class="line" :style="{left:activeLine.activeLeft,top:activeLine.activeTop,width:activeLine.activeWidth,'-webkit-transform':'rotate('+activeLine.activeRotate+')',transform:'rotate('+activeLine.activeRotate+')'}"> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
<script> |
||||
|
import GestureLock from './gestureLock'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'index', |
||||
|
props: { |
||||
|
/** |
||||
|
* 容器宽度 |
||||
|
*/ |
||||
|
containerWidth: { |
||||
|
type: [Number, String], |
||||
|
default: 0 |
||||
|
}, |
||||
|
/** |
||||
|
* 圆的半径 |
||||
|
*/ |
||||
|
cycleRadius: { |
||||
|
type: [Number, String], |
||||
|
default: 0 |
||||
|
}, |
||||
|
/** |
||||
|
* 已设定的密码 |
||||
|
*/ |
||||
|
password: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
gestureLock: {}, // 锁对象 |
||||
|
circleArray: [], // 圆对象数组 |
||||
|
lineArray: [], // 已激活锁之间的线段 |
||||
|
activeLine: {}, // 最后一个激活的锁与当前位置之间的线段 |
||||
|
error: false |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
onTouchStart(e) { |
||||
|
this.gestureLock.onTouchStart(e); |
||||
|
this.refesh(); |
||||
|
}, |
||||
|
|
||||
|
onTouchMove(e) { |
||||
|
this.gestureLock.onTouchMove(e); |
||||
|
this.refesh(); |
||||
|
}, |
||||
|
|
||||
|
onTouchEnd(e) { |
||||
|
const checkPoints = this.gestureLock.onTouchEnd(e); |
||||
|
if (!this.password.length || checkPoints.join('') == this.password.join('')) { |
||||
|
this.refesh(); |
||||
|
this.$emit('end', checkPoints); |
||||
|
} else { |
||||
|
this.error = true; |
||||
|
setTimeout(() => { |
||||
|
this.refesh(); |
||||
|
this.$emit('end', checkPoints); |
||||
|
}, 800); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
refesh() { |
||||
|
this.error = false; |
||||
|
this.circleArray = this.gestureLock.getCycleArray(); |
||||
|
this.lineArray = this.gestureLock.getLineArray(); |
||||
|
this.activeLine = this.gestureLock.getActiveLine(); |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.gestureLock = new GestureLock(this.containerWidth, this.cycleRadius); |
||||
|
this.refesh(); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.gesture-lock { |
||||
|
margin: 0 auto; |
||||
|
position: relative; |
||||
|
box-sizing: border-box; |
||||
|
overflow: auto; |
||||
|
} |
||||
|
|
||||
|
.gesture-lock .cycle { |
||||
|
box-sizing: border-box; |
||||
|
position: absolute; |
||||
|
border: 2px solid #66aaff; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
|
||||
|
.gesture-lock .cycle.check:after { |
||||
|
content: ""; |
||||
|
display: block; |
||||
|
position: absolute; |
||||
|
width: 32%; |
||||
|
height: 32%; |
||||
|
border: 2px solid #66aaff; |
||||
|
border-radius: 50%; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
transform: translate(-50%, -50%); |
||||
|
} |
||||
|
|
||||
|
.gesture-lock .line { |
||||
|
height: 0; |
||||
|
border-top: 2px solid #66aaff; |
||||
|
position: absolute; |
||||
|
transform-origin: left center; |
||||
|
} |
||||
|
|
||||
|
.gesture-lock.error .cycle.check, |
||||
|
.gesture-lock.error .cycle.check:after, |
||||
|
.gesture-lock.error .line { |
||||
|
border-color: #ffa197; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,157 @@ |
|||||
|
<!-- 基于z-paging封装个性化分页组件演示,可减少大量重复代码 --> |
||||
|
<template> |
||||
|
<!-- 这边统一设置z-paging,在页面中使用时就不用重复写 --> |
||||
|
<!-- 如果要在这里设置极简写法,这里的ref不能设置为paging,设置为其他名即可,因为极简写法会修改/调用第一个包含了ref="paging"的付view中的list和query --> |
||||
|
<!-- 极简写法在下方设置autowire-list-name="xxx" autowire-query-name="xxx"即可,与minimalism-demo.vue中的一致,并且不用再从这个组件转发到页面,只要遵循上一行的规则即可 --> |
||||
|
<z-paging ref="paging" v-model="list" fixed auto-show-back-to-top refresher-threshold="160rpx" @query="queryList" |
||||
|
:useVirtualList="useVirtualList" :useInnerList="useInnerList" :cellKeyName="cellKeyName" :innerListStyle="innerListStyle" :preloadPage="preloadPage" :cellHeightMode="cellHeightMode" :virtualScrollFps="virtualScrollFps" |
||||
|
:loading-more-loading-text="{'en':'英文的加载中','zh-cn':'中文的加载中','zh-hant-cn':'繁体的加载中'}"> |
||||
|
|
||||
|
<!-- 这里插入一个view到z-paging中,并且这个view会被z-paging标记为top固定在顶部 --> |
||||
|
<template #top> |
||||
|
<!-- 这里接收页面传进来的slot,这样相当于将页面传进来的slot传给z-paging的slot="top"了 --> |
||||
|
<slot name="top" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 这里插入一个view到z-paging中,并且这个view会被z-paging标记为bottom固定在顶部 --> |
||||
|
<!-- vue3中用v-slot:bottom --> |
||||
|
<template #bottom> |
||||
|
<!-- 这里接收页面传进来的slot,这样相当于将页面传进来的slot传给z-paging的slot="bottom"了 --> |
||||
|
<slot name="bottom" /> |
||||
|
</template> |
||||
|
|
||||
|
<template #empty v-if="$slots.empty" > |
||||
|
<!-- 这里接收页面传进来的slot,这样相当于将页面传进来的slot传给z-paging的slot="empty"了 --> |
||||
|
<slot name="empty" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 这个是插入虚拟列表/内置列表的cell --> |
||||
|
<template #cell="{item,index}"> |
||||
|
<slot name="cell" :item="item" :index="index"/> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 这里通过slot统一自定义了下拉刷新view和没有更多数据view,页面那边就不用再写下面两行了 --> |
||||
|
<!-- 自定义下拉刷新view(如果use-custom-refresher为true且不设置下面的slot="refresher",此时不用获取refresherStatus,会自动使用z-paging自带的下拉刷新view) --> |
||||
|
<template #refresher="{refresherStatus}"> |
||||
|
<!-- <custom-refresher :status="refresherStatus" /> --> |
||||
|
</template> |
||||
|
<!-- 自定义没有更多数据view --> |
||||
|
<template #loadingMoreNoMore> |
||||
|
<!-- <custom-nomore></custom-nomore> --> |
||||
|
<uni-load-more status="normore" /> |
||||
|
</template> |
||||
|
|
||||
|
<!-- 这里接收页面传进来的普通slot,如列表数据等 --> |
||||
|
<slot /> |
||||
|
</z-paging> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: "my-paging", |
||||
|
data() { |
||||
|
return { |
||||
|
list: [] |
||||
|
}; |
||||
|
}, |
||||
|
props: { |
||||
|
//用于接收父组件v-model所绑定的list的值 |
||||
|
value: { |
||||
|
type: Array, |
||||
|
default: function() { |
||||
|
return []; |
||||
|
} |
||||
|
}, |
||||
|
//是否使用虚拟列表,默认为否 |
||||
|
useVirtualList: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
//是否在z-paging内部循环渲染列表(内置列表),默认为否。若use-virtual-list为true,则此项恒为true |
||||
|
useInnerList: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
//内置列表cell的key名称,仅nvue有效,在nvue中开启use-inner-list时必须填此项 |
||||
|
cellKeyName: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
//innerList样式 |
||||
|
innerListStyle: { |
||||
|
type: Object, |
||||
|
default: function() { |
||||
|
return {}; |
||||
|
} |
||||
|
}, |
||||
|
//预加载的列表可视范围(列表高度)页数,默认为12,即预加载当前页及上下各7页的cell。此数值越大,则虚拟列表中加载的dom越多,内存消耗越大(会维持在一个稳定值),但增加预加载页面数量可缓解快速滚动短暂白屏问题 |
||||
|
preloadPage: { |
||||
|
type: [Number, String], |
||||
|
default: 12 |
||||
|
}, |
||||
|
//虚拟列表cell高度模式,默认为fixed,也就是每个cell高度完全相同,将以第一个cell高度为准进行计算。可选值【dynamic】,即代表高度是动态非固定的,【dynamic】性能低于【fixed】。 |
||||
|
cellHeightMode: { |
||||
|
type: String, |
||||
|
default: 'fixed' |
||||
|
}, |
||||
|
//虚拟列表scroll取样帧率,默认为60,过高可能出现卡顿等问题 |
||||
|
virtualScrollFps: { |
||||
|
type: [Number, String], |
||||
|
default: 60 |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
//监听页面v-mode传过来的值,同时传给z-paging |
||||
|
value(newVal) { |
||||
|
this.list = newVal; |
||||
|
}, |
||||
|
// #ifdef VUE3 |
||||
|
modelValue(newVal) { |
||||
|
this.list = newVal; |
||||
|
}, |
||||
|
// #endif |
||||
|
//监听z-paging给当前组件的值,同时传给页面 |
||||
|
list(newVal) { |
||||
|
//通过emit input修改页面中v-model绑定的值 |
||||
|
this.$emit('input', newVal); |
||||
|
// #ifdef VUE3 |
||||
|
this.$emit('update:modelValue', newVal); |
||||
|
// #endif |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
//监听z-paging的@query方法,通过emit传递给页面 |
||||
|
queryList(pageNo, pageSize) { |
||||
|
console.log("queryList",pageNo) |
||||
|
// this.$emit('query', pageNo, pageSize); |
||||
|
}, |
||||
|
//接收页面触发的reload方法,传给z-paging |
||||
|
reload(data) { |
||||
|
this.$refs.paging.reload(data); |
||||
|
}, |
||||
|
//接收页面触发的complete方法,传给z-paging |
||||
|
complete(data) { |
||||
|
this.$refs.paging.complete(data); |
||||
|
}, |
||||
|
/* |
||||
|
//如果是使用页面滚动,则需要添加以下三行,注意页面那边要引入mixins,与使用页面滚动示例写法相同。 |
||||
|
//接收页面触发的updatePageScrollTop方法,传给z-paging |
||||
|
updatePageScrollTop(data){ |
||||
|
this.$refs.paging.updatePageScrollTop(data); |
||||
|
}, |
||||
|
//接收页面触发的pageReachBottom方法,传给z-paging |
||||
|
pageReachBottom(){ |
||||
|
this.$refs.paging.pageReachBottom(); |
||||
|
}, |
||||
|
//接收页面触发的doChatRecordLoadMore方法,传给z-paging |
||||
|
doChatRecordLoadMore() { |
||||
|
this.$refs.paging.doChatRecordLoadMore(); |
||||
|
} |
||||
|
*/ |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,38 @@ |
|||||
|
<template name="page-foot"> |
||||
|
<view class="page-share-title"> |
||||
|
<text>感谢{{name}}提供本示例,</text> |
||||
|
<text class="submit" @click="submit">我也提交</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: "page-foot", |
||||
|
props: { |
||||
|
name: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
submit() { |
||||
|
uni.showModal({ |
||||
|
content:"hello uni-app开源地址为https://github.com/dcloudio/uni-app/tree/master/examples,请在这个开源项目上贡献你的代码", |
||||
|
showCancel:false |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.page-share-title { |
||||
|
text-align: center; |
||||
|
font-size: 30rpx; |
||||
|
color: #BEBEBE; |
||||
|
padding: 20rpx 0; |
||||
|
} |
||||
|
|
||||
|
.submit { |
||||
|
border-bottom: 1rpx solid #BEBEBE; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,16 @@ |
|||||
|
<template name="page-head"> |
||||
|
<view class="common-page-head"> |
||||
|
<view class="common-page-head-title">{{title}}</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
name: "page-head", |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,66 @@ |
|||||
|
<template> |
||||
|
<view class="product"> |
||||
|
<image class="product-image" :src="image ? image : 'https://via.placeholder.com/150x200'"></image> |
||||
|
<view class="product-title">{{title}}</view> |
||||
|
<view class="product-price"> |
||||
|
<text class="product-price-favour">¥{{originalPrice}}</text> |
||||
|
<text class="product-price-original">¥{{favourPrice}}</text> |
||||
|
<text class="product-tip">{{tip}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'product', |
||||
|
props: ['image', 'title', 'originalPrice', 'favourPrice', 'tip'] |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.product { |
||||
|
padding: 10rpx 20rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.product-image { |
||||
|
height: 330rpx; |
||||
|
width: 330rpx; |
||||
|
} |
||||
|
|
||||
|
.product-title { |
||||
|
width: 300rpx; |
||||
|
font-size: 32rpx; |
||||
|
word-break: break-all; |
||||
|
display: -webkit-box; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
-webkit-box-orient: vertical; |
||||
|
-webkit-line-clamp: 2; |
||||
|
} |
||||
|
|
||||
|
.product-price { |
||||
|
font-size: 28rpx; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.product-price-original { |
||||
|
color: #E80080; |
||||
|
} |
||||
|
|
||||
|
.product-price-favour { |
||||
|
color: #888888; |
||||
|
text-decoration: line-through; |
||||
|
margin-left: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.product-tip { |
||||
|
position: absolute; |
||||
|
right: 10rpx; |
||||
|
background-color: #FF3333; |
||||
|
color: #FFFFFF; |
||||
|
padding: 0 10rpx; |
||||
|
border-radius: 5rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,590 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<view class="maskbox" v-show="active" @tap="maskClick"></view> |
||||
|
<view class="uni-combox" style="width: 100%;"> |
||||
|
<view v-if="label" class="uni-combox__label" :style="labelStyle"> |
||||
|
<text>{{label}}</text> |
||||
|
</view> |
||||
|
<view class="u-dropdown"> |
||||
|
<view class="u-dropdown__menu" :style="{height:height+'rpx'}"> |
||||
|
<view class="u-dropdown__menu__item"> |
||||
|
<view class="u-flex " style="width: 100%;"> |
||||
|
<view class="u-close-wrap" v-if="isSearch"> |
||||
|
<u-icon class="u-clear-icon" :size="30" :name="searchIcon" |
||||
|
:color="searchIconColor ? searchIconColor : color"></u-icon> |
||||
|
</view> |
||||
|
<input confirm-type="search" class="uni-combox__input" type="text" v-model="inputVal" |
||||
|
@confirm="confirm()" :placeholder="placeholder" /> |
||||
|
<icon class="uni-combox__icon" type="clear" size="16" @tap="clearInputValue" |
||||
|
v-if="inputVal!=''" style="height: 100%;align-items: center;justify-content: center;" /> |
||||
|
<!-- <image size="16" src="/static/icons/close-circle2.svg" |
||||
|
style="height: 35%;width: 10%;align-items: center;justify-content: center;background-color: aqua;display: flex;"> --> |
||||
|
<!-- </image> --> |
||||
|
<view :style="{width:height + 'rpx'}" class="u-dropdown__menu__item__arrow" :class="{ |
||||
|
'u-dropdown__menu__item__arrow--rotate': active |
||||
|
}" @tap.stop="menuClick()"> |
||||
|
<u-icon :custom-style="{display: 'flex'}" :name="menuIcon" |
||||
|
:size="$u.addUnit(menuIconSize)" :color="active ? activeColor : '#c0c4cc'"></u-icon> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="u-dropdown__content" :style="[contentStyle, { |
||||
|
transition: `opacity ${duration / 1000}s linear`, |
||||
|
top: $u.addUnit(height), |
||||
|
height: contentHeight + 'px'}]" @tap="maskClick" @touchmove.stop.prevent> |
||||
|
|
||||
|
<view class="u-dropdown__content__popup" :style="[popupStyle]" @touchmove.stop.prevent="() => {}" |
||||
|
@tap.stop.prevent="() => {}"> |
||||
|
|
||||
|
<view class="uni-combox__selector-empty" v-if="optionsLength === 0" @click="empty()"> |
||||
|
<text>{{emptyTips}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view v-for="(item, index) in filterOptions" style="width: 100%;" |
||||
|
@click="onSelectorClick(index)"> |
||||
|
<view class="uni-combox-item"> |
||||
|
<text class="uni-combox-item-text" :title-style="{ |
||||
|
color: inputVal === item ? activeColor : inactiveColor |
||||
|
}">{{item}}</text> |
||||
|
<u-icon v-if="inputVal === item" name="checkbox-mark" :color="activeColor" size="32"> |
||||
|
</u-icon> |
||||
|
</view> |
||||
|
<u-line class="line_color"></u-line> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <view class="u-dropdown__content__mask"></view> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/** |
||||
|
* dropdown 下拉菜单 |
||||
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景 |
||||
|
* @tutorial http://uviewui.com/components/dropdown.html |
||||
|
* @property {String} active-color 标题和选项卡选中的颜色(默认#2979ff) |
||||
|
* @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266) |
||||
|
* @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true) |
||||
|
* @property {Boolean} close-on-click-self 点击当前激活项标题是否关闭菜单(默认true) |
||||
|
* @property {String | Number} duration 选项卡展开和收起的过渡时间,单位ms(默认300) |
||||
|
* @property {String | Number} height 标题菜单的高度,单位任意(默认80) |
||||
|
* @property {String | Number} border-radius 菜单展开内容下方的圆角值,单位任意(默认0) |
||||
|
* @property {Boolean} border-bottom 标题菜单是否显示下边框(默认false) |
||||
|
* @property {String | Number} title-size 标题的字体大小,单位任意,数值默认为rpx单位(默认28) |
||||
|
* @event {Function} open 下拉菜单被打开时触发 |
||||
|
* @event {Function} close 下拉菜单被关闭时触发 |
||||
|
* @example <pulldown></pulldown> |
||||
|
*/ |
||||
|
export default { |
||||
|
name: 'pulldown', |
||||
|
emits: ["open", "close", "update:modelValue", "input", "change", "confirm"], |
||||
|
props: { |
||||
|
|
||||
|
// 菜单标题 |
||||
|
label: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
// 菜单标题长度 |
||||
|
labelWidth: { |
||||
|
type: String, |
||||
|
default: 'auto' |
||||
|
}, |
||||
|
// 菜单标题和选项的激活态颜色 |
||||
|
activeColor: { |
||||
|
type: String, |
||||
|
default: '#2979ff' |
||||
|
}, |
||||
|
// 菜单标题和选项的未激活态颜色 |
||||
|
inactiveColor: { |
||||
|
type: String, |
||||
|
default: '#606266' |
||||
|
}, |
||||
|
// 点击遮罩是否关闭菜单 |
||||
|
closeOnClickMask: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
// 点击当前激活项标题是否关闭菜单 |
||||
|
closeOnClickSelf: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
// 过渡时间 |
||||
|
duration: { |
||||
|
type: [Number, String], |
||||
|
default: 300 |
||||
|
}, |
||||
|
// 标题菜单的高度,单位任意,数值默认为rpx单位 |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 80 |
||||
|
}, |
||||
|
// 是否显示下边框 |
||||
|
borderBottom: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
// 标题的字体大小 |
||||
|
titleSize: { |
||||
|
type: [Number, String], |
||||
|
default: 28 |
||||
|
}, |
||||
|
// 下拉出来的内容部分的圆角值 |
||||
|
borderRadius: { |
||||
|
type: [Number, String], |
||||
|
default: 0 |
||||
|
}, |
||||
|
// 菜单右侧的icon图标 |
||||
|
menuIcon: { |
||||
|
type: String, |
||||
|
default: 'arrow-down' |
||||
|
}, |
||||
|
// 菜单右侧图标的大小 |
||||
|
menuIconSize: { |
||||
|
type: [Number, String], |
||||
|
default: 26 |
||||
|
}, |
||||
|
|
||||
|
emptyTips: { |
||||
|
type: String, |
||||
|
default: '无匹配项' |
||||
|
}, |
||||
|
|
||||
|
// 是否开启搜索模式 |
||||
|
isSearch: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
|
||||
|
// 占位提示文字 |
||||
|
hint: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
|
||||
|
// 搜索图标的颜色,默认同输入框字体颜色 |
||||
|
searchIconColor: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
// 输入框字体颜色 |
||||
|
color: { |
||||
|
type: String, |
||||
|
default: '#606266' |
||||
|
}, |
||||
|
|
||||
|
// 左边输入框的图标,可以为uView图标名称或图片路径 |
||||
|
searchIcon: { |
||||
|
type: String, |
||||
|
default: 'search' |
||||
|
}, |
||||
|
|
||||
|
// 选项数据,如果传入了默认slot,此参数无效 |
||||
|
options: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return []; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
inputVal: '', |
||||
|
showDropdown: true, // 是否打开下来菜单, |
||||
|
menuList: [], // 显示的菜单 |
||||
|
active: false, // 下拉菜单的状态 |
||||
|
// 当前是第几个菜单处于激活状态,小程序中此处不能写成false或者"",否则后续将current赋值为0, |
||||
|
// 无能的TX没有使用===而是使用==判断,导致程序认为前后二者没有变化,从而不会触发视图更新 |
||||
|
current: 99999, |
||||
|
// 外层内容的样式,初始时处于底层,且透明 |
||||
|
contentStyle: { |
||||
|
// zIndex: 11, |
||||
|
zIndex: -1, |
||||
|
opacity: 0 |
||||
|
}, |
||||
|
// 让某个菜单保持高亮的状态 |
||||
|
highlightIndex: 99999, |
||||
|
contentHeight: 0 |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
// 下拉出来部分的样式 |
||||
|
popupStyle() { |
||||
|
let style = {}; |
||||
|
// 进行Y轴位移,展开状态时,恢复原位。收齐状态时,往上位移100%,进行隐藏 |
||||
|
style.transform = `translateY(${this.active ? 0 : '-100%'})` |
||||
|
style['transition-duration'] = this.duration / 1000 + 's'; |
||||
|
style.borderRadius = `0 0 ${this.$u.addUnit(this.borderRadius)} ${this.$u.addUnit(this.borderRadius)}`; |
||||
|
return style; |
||||
|
}, |
||||
|
|
||||
|
labelStyle() { |
||||
|
if (this.labelWidth === 'auto') { |
||||
|
return {} |
||||
|
} |
||||
|
return { |
||||
|
width: this.labelWidth |
||||
|
} |
||||
|
}, |
||||
|
optionsLength() { |
||||
|
return this.options.length |
||||
|
}, |
||||
|
filterOptions() { |
||||
|
if (this.isSearch) { |
||||
|
return this.options.filter((item) => { |
||||
|
return item.indexOf(this.inputVal) > -1 |
||||
|
}) |
||||
|
} else { |
||||
|
return this.options; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
placeholder() { |
||||
|
if (this.hint) { |
||||
|
return this.hint; |
||||
|
} else { |
||||
|
if (this.isSearch) { |
||||
|
return '请输入关键字'; |
||||
|
} else { |
||||
|
return '请选择'; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
}, |
||||
|
created() { |
||||
|
// 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错 |
||||
|
this.children = []; |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getContentHeight(); |
||||
|
}, |
||||
|
methods: { |
||||
|
//清空数据 |
||||
|
clearInputValue() { |
||||
|
this.inputVal = ""; |
||||
|
}, |
||||
|
|
||||
|
//回车监听 |
||||
|
confirm() { |
||||
|
this.$emit("confirm", this.inputVal); |
||||
|
}, |
||||
|
|
||||
|
init() { |
||||
|
// 当某个子组件内容变化时,触发父组件的init,父组件再让每一个子组件重新初始化一遍 |
||||
|
// 以保证数据的正确性 |
||||
|
this.menuList = []; |
||||
|
this.children.map(child => { |
||||
|
child.init(); |
||||
|
}) |
||||
|
}, |
||||
|
// 点击菜单 |
||||
|
menuClick() { |
||||
|
// 判断是否被禁用 |
||||
|
// if (this.menuList[index].disabled) return; |
||||
|
// 如果点击时的索引和当前激活项索引相同,意味着点击了激活项,需要收起下拉菜单 |
||||
|
if (this.active) { |
||||
|
this.close(); |
||||
|
// 等动画结束后,再移除下拉菜单中的内容,否则直接移除,也就没有下拉菜单收起的效果了 |
||||
|
// setTimeout(() => { |
||||
|
// this.active = false; |
||||
|
// }, this.duration) |
||||
|
return; |
||||
|
} |
||||
|
this.open(); |
||||
|
}, |
||||
|
|
||||
|
onSelectorClick(index) { |
||||
|
// console.log(index); |
||||
|
this.inputVal = this.options[index]; |
||||
|
this.close(); |
||||
|
// 修改通过v-model绑定的值 |
||||
|
this.$emit("input", this.inputVal); |
||||
|
this.$emit("update:modelValue", this.inputVal); |
||||
|
// 发出事件,抛出当前勾选项的value |
||||
|
this.$emit("change", index, this.inputVal); |
||||
|
}, |
||||
|
// 打开下拉菜单 |
||||
|
open() { |
||||
|
console.log(this.options[0]); |
||||
|
console.log(this.options.length); |
||||
|
// console.log(this.filterOptions()); |
||||
|
// 重置高亮索引,否则会造成多个菜单同时高亮 |
||||
|
// this.highlightIndex = 9999; |
||||
|
// 展开时,设置下拉内容的样式 |
||||
|
this.contentStyle = { |
||||
|
zIndex: 11, |
||||
|
} |
||||
|
this.$forceUpdate(); |
||||
|
// 标记展开状态以及当前展开项的索引 |
||||
|
this.active = true; |
||||
|
// this.current = index; |
||||
|
// 历遍所有的子元素,将索引匹配的项标记为激活状态,因为子元素是通过v-if控制切换的 |
||||
|
// 之所以不是因display: none,是因为nvue没有display这个属性 |
||||
|
|
||||
|
this.$emit('open', this.current); |
||||
|
}, |
||||
|
// 设置下拉菜单处于收起状态 |
||||
|
close() { |
||||
|
this.$emit('close', this.current); |
||||
|
// 设置为收起状态,同时current归位,设置为空字符串 |
||||
|
this.active = false; |
||||
|
this.current = 99999; |
||||
|
// 下拉内容的样式进行调整,不透明度设置为0 |
||||
|
this.contentStyle = { |
||||
|
zIndex: -1, |
||||
|
opacity: 0 |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//点击无匹配选项关闭下拉菜单 |
||||
|
empty() { |
||||
|
// 设置为收起状态,同时current归位,设置为空字符串 |
||||
|
this.active = false; |
||||
|
this.current = 99999; |
||||
|
// 下拉内容的样式进行调整,不透明度设置为0 |
||||
|
this.contentStyle = { |
||||
|
zIndex: -1, |
||||
|
opacity: 0 |
||||
|
} |
||||
|
}, |
||||
|
// 点击遮罩 |
||||
|
maskClick() { |
||||
|
// 如果不允许点击遮罩,直接返回 |
||||
|
if (!this.closeOnClickMask) return; |
||||
|
this.close(); |
||||
|
}, |
||||
|
// 外部手动设置某个菜单高亮 |
||||
|
highlight(index = undefined) { |
||||
|
this.highlightIndex = index !== undefined ? index : 99999; |
||||
|
}, |
||||
|
// 获取下拉菜单内容的高度 |
||||
|
getContentHeight() { |
||||
|
// 这里的原理为,因为dropdown组件是相对定位的,它的下拉出来的内容,必须给定一个高度 |
||||
|
// 才能让遮罩占满菜单一下,直到屏幕底部的高度 |
||||
|
// this.$u.sys()为uView封装的获取设备信息的方法 |
||||
|
let windowHeight = this.$u.sys().windowHeight; |
||||
|
this.$uGetRect('.u-dropdown__menu').then(res => { |
||||
|
// 这里获取的是dropdown的尺寸,在H5上,uniapp获取尺寸是有bug的(以前提出修复过,后来又出现了此bug,目前hx2.8.11版本) |
||||
|
// H5端bug表现为元素尺寸的top值为导航栏底部到到元素的上边沿的距离,但是元素的bottom值确是导航栏顶部到元素底部的距离 |
||||
|
// 二者是互相矛盾的,本质原因是H5端导航栏非原生,uni的开发者大意造成 |
||||
|
// 这里取菜单栏的botton值合理的,不能用res.top,否则页面会造成滚动 |
||||
|
this.contentHeight = windowHeight - res.bottom; |
||||
|
// console.log(this.contentHeight); |
||||
|
// console.log(res.bottom); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
@import "../../uni_modules/vk-uview-ui/libs/css/style.components.scss"; |
||||
|
|
||||
|
.u-clear-icon { |
||||
|
@include vue-flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.u-close-wrap { |
||||
|
width: 30px; |
||||
|
height: 100%; |
||||
|
@include vue-flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
|
||||
|
.maskbox { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
z-index: 4; |
||||
|
} |
||||
|
|
||||
|
.uni-combox { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
min-height: 40px; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
position: relative; |
||||
|
background-color: #FFFFFF; |
||||
|
// padding-right: 5px; |
||||
|
// padding-left: 5px; |
||||
|
// z-index: 3; |
||||
|
} |
||||
|
|
||||
|
.uni-combox__label { |
||||
|
font-size: 16px; |
||||
|
line-height: 22px; |
||||
|
padding-right: 10px; |
||||
|
} |
||||
|
|
||||
|
.uni-combox__selector-empty, |
||||
|
.uni-combox__selector-item { |
||||
|
/* #ifdef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
line-height: 36px; |
||||
|
font-size: 14px; |
||||
|
text-align: center; |
||||
|
border-bottom: solid 1px #DDDDDD; |
||||
|
/* margin: 0px 10px; */ |
||||
|
} |
||||
|
|
||||
|
.uni-combox__icon { |
||||
|
display: flex; |
||||
|
height: 100%; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
background-color: #FFFFFF; |
||||
|
z-index: 4; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.uni-combox__input { |
||||
|
// flex: 1; |
||||
|
font-size: 16px; |
||||
|
height: 100%; |
||||
|
line-height: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
width: 100%; |
||||
|
z-index: 5; |
||||
|
} |
||||
|
|
||||
|
.uni-combox-item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
font-size: 16px; |
||||
|
height: 100%; |
||||
|
line-height: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.uni-combox-item-text { |
||||
|
font-size: 16px; |
||||
|
height: 100%; |
||||
|
line-height: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
width: 100%; |
||||
|
padding: 20rpx; |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.uni-combox__input-box { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex: 1; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.uni-combox__selector { |
||||
|
box-sizing: border-box; |
||||
|
position: absolute; |
||||
|
top: 42px; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
border-radius: 6px; |
||||
|
box-shadow: #DDDDDD 4px 4px 8px, #DDDDDD -4px -4px 8px; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
|
||||
|
.u-dropdown { |
||||
|
flex: 1; |
||||
|
width: 100%; |
||||
|
position: relative; |
||||
|
background-color: #FFFFFF; |
||||
|
margin-right: 2rpx; |
||||
|
margin-left: 2rpx; |
||||
|
|
||||
|
&__menu { |
||||
|
@include vue-flex; |
||||
|
// position: relative; |
||||
|
z-index: 11; |
||||
|
width: 100%; |
||||
|
|
||||
|
&__item { |
||||
|
// flex: 1; |
||||
|
@include vue-flex; |
||||
|
justify-content: center; |
||||
|
// align-items: center; |
||||
|
border: 2rpx solid $uni-border-color; |
||||
|
width: 100%; |
||||
|
margin-top: 2rpx; |
||||
|
// margin-right: 2rpx; |
||||
|
// margin-left: 2rpx; |
||||
|
|
||||
|
&__text { |
||||
|
font-size: 28rpx; |
||||
|
color: $u-content-color; |
||||
|
} |
||||
|
|
||||
|
&__arrow { |
||||
|
transition: transform .3s; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
@include vue-flex; |
||||
|
|
||||
|
&--rotate { |
||||
|
transform: rotate(180deg); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
&__content { |
||||
|
position: absolute; |
||||
|
z-index: 8; |
||||
|
width: 100%; |
||||
|
left: 0px; |
||||
|
bottom: 0; |
||||
|
overflow: hidden; |
||||
|
// z-index: 10; |
||||
|
// box-sizing: border-box; |
||||
|
// position: absolute; |
||||
|
// top: 42px; |
||||
|
// left: 0; |
||||
|
// width: 100%; |
||||
|
// // background-color: #FFFFFF; |
||||
|
// border-radius: 6px; |
||||
|
// box-shadow: #DDDDDD 4px 4px 8px, #DDDDDD -4px -4px 8px; |
||||
|
// z-index: 10; |
||||
|
|
||||
|
&__mask { |
||||
|
position: relative; |
||||
|
z-index: 9; |
||||
|
background: rgba(0, 0, 0, .3); |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
} |
||||
|
|
||||
|
&__popup { |
||||
|
position: relative; |
||||
|
z-index: 11; |
||||
|
transition: all 0.3s; |
||||
|
transform: translate3D(0, -100%, 0); |
||||
|
overflow: hidden; |
||||
|
width: 100%; |
||||
|
background-color: aliceblue; |
||||
|
border: 2rpx solid $uni-border-color; |
||||
|
// z-index: 10; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
@ -0,0 +1,456 @@ |
|||||
|
<template name="show-modal"> |
||||
|
<view> |
||||
|
<u-modal v-model="show" :title-style="{color: 'red'}" :title="title" :showTitle="false" |
||||
|
:showConfirmButton="false" ref="modal"> |
||||
|
<view class="slot-content"> |
||||
|
<slot name="icon"> |
||||
|
<image class="icon" :src="icon" /> |
||||
|
</slot> |
||||
|
|
||||
|
<scroll-view scroll-y="true" style="max-height: 200px;"> |
||||
|
<rich-text class="content" :nodes="content"> |
||||
|
</rich-text> |
||||
|
</scroll-view> |
||||
|
|
||||
|
|
||||
|
<u-line></u-line> |
||||
|
<slot name="button"> |
||||
|
<view class="uni-flex uni-row u-col-center space-between" style="width: 100%;height: 48px;"> |
||||
|
<view v-if="showCancelButton" class="cance_button" @tap="$u.throttle(cancelClose, 500)"> |
||||
|
<text :style="{'color':cancelColor}">{{ cancelText }}</text> |
||||
|
</view> |
||||
|
<u-line direction="col" length="100%"></u-line> |
||||
|
<view v-if="showConfirmButton" class="confirm_button" @tap="$u.throttle(confirmClose, 500)"> |
||||
|
<text :style="{'color':confirmColor}">{{confirmText}}</text> |
||||
|
<text v-if="showConfirmCountdown">({{seconds}}s关闭)</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</slot> |
||||
|
</view> |
||||
|
</u-modal> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/** |
||||
|
* modal 模态框 |
||||
|
* @description 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作 |
||||
|
* */ |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
timer: null, |
||||
|
show: false, // 是否显示 |
||||
|
iconType: '消息', |
||||
|
icon: '../../static/icons/error-circle.svg', |
||||
|
title: '', // 提示标题 |
||||
|
content: '', // 提示内容 |
||||
|
cancelText: '取消', // 取消按钮的文字 |
||||
|
confirmText: '确定', // 确认按钮文字 |
||||
|
showCancel: true, // 是否显示取消按钮,默认为 true |
||||
|
confirmColor: '#007aff', // 确定按钮颜色 |
||||
|
cancelColor: null, // 取消按钮颜色 |
||||
|
showConfirmButton: true, // 是否显示确认按钮 |
||||
|
showConfirmCountdown: true, // 是否显示确定倒计时 |
||||
|
showCancelButton: true, // 是否显示取消按钮 |
||||
|
showClose: false, |
||||
|
confirm: false, //为 true 时,表示用户点击了确定按钮 |
||||
|
cancel: false, //为 true 时,表示用户点击了取消 |
||||
|
seconds: 0, |
||||
|
success: () => {} // 回调方法 |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
open() { |
||||
|
this.show = true; |
||||
|
}, |
||||
|
close() { |
||||
|
this.$.refs.modal.popupClose(); |
||||
|
}, |
||||
|
confirmClose() { |
||||
|
if (this.show) { |
||||
|
this.show = false; |
||||
|
clearInterval(this.timer) //清空timer |
||||
|
this.$.refs.modal.popupClose(); |
||||
|
this.success({ |
||||
|
// cancel: false, |
||||
|
confirm: true, |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
cancelClose() { |
||||
|
clearInterval(this.timer) //清空timer |
||||
|
this.$.refs.modal.popupClose(); |
||||
|
this.success({ |
||||
|
// cancel: true, |
||||
|
confirm: false, |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 打开消息弹框(确定) |
||||
|
showConfirmMessageModal(mContent, callback) { |
||||
|
this.showConfirmModal("消息", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开成功弹框(确定) |
||||
|
showConfirmSuccessModal(mContent, callback) { |
||||
|
this.showConfirmModal("成功", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开失败弹框(确定) |
||||
|
showConfirmFailModal(mContent, callback) { |
||||
|
this.showConfirmModal("失败", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开警告弹框(确定) |
||||
|
showConfirmWarningModal(mContent, callback) { |
||||
|
this.showConfirmModal("警告", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开疑问弹框(确定) |
||||
|
showConfirmQuestionModal(mContent, callback) { |
||||
|
this.showConfirmModal("疑问", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 初始化弹框并打开(确定) |
||||
|
showConfirmModal(mIconType, mContent, callback) { |
||||
|
this.showModal({ |
||||
|
iconType: mIconType, |
||||
|
content: mContent, |
||||
|
showCancelButton: false, |
||||
|
success: function(res) { |
||||
|
if (callback != undefined) { |
||||
|
if (res.confirm == true) { |
||||
|
callback(true); |
||||
|
console.log('用户点击确定') |
||||
|
} else { |
||||
|
callback(false); |
||||
|
console.log('用户点击取消') |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 打开消息弹框(取消+确定) |
||||
|
showSelectMessageModal(mContent, callback) { |
||||
|
this.showSelectModal("消息", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开成功弹框(取消+确定) |
||||
|
showSelectSuccessModal(mContent, callback) { |
||||
|
this.showSelectModal("成功", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开失败弹框(取消+确定) |
||||
|
showSelectFailModal(mContent, callback) { |
||||
|
this.showSelectModal("失败", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开警告弹框(取消+确定) |
||||
|
showSelectWarningModal(mContent, callback) { |
||||
|
this.showSelectModal("警告", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开疑问弹框(取消+确定) |
||||
|
showSelectQuestionModal(mContent, callback) { |
||||
|
this.showSelectModal("疑问", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 初始化弹框并打开(取消+确定) |
||||
|
showSelectModal(mIconType, mContent, callback) { |
||||
|
this.showModal({ |
||||
|
iconType: mIconType, |
||||
|
content: mContent, |
||||
|
success: function(res) { |
||||
|
if (callback != undefined) { |
||||
|
if (res.confirm == true) { |
||||
|
callback(true); |
||||
|
console.log('用户点击确定') |
||||
|
} else { |
||||
|
callback(false); |
||||
|
console.log('用户点击取消') |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 打开消息弹框(确定+倒计时) |
||||
|
showConfirmCountdownMessageModal(mContent, callback) { |
||||
|
this.showConfirmCountdownModal("消息", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开成功弹框(确定+倒计时) |
||||
|
showConfirmCountdownSuccessModal(mContent, callback) { |
||||
|
this.showConfirmCountdownModal("成功", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开失败弹框(确定+倒计时) |
||||
|
showConfirmCountdownFailModal(mContent, callback) { |
||||
|
this.showConfirmCountdownModal("失败", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开警告弹框(确定+倒计时) |
||||
|
showConfirmCountdownWarningModal(mContent, callback) { |
||||
|
this.showConfirmCountdownModal("警告", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开疑问弹框(确定+倒计时) |
||||
|
showConfirmCountdownQuestionModal(mContent, callback) { |
||||
|
this.showConfirmCountdownModal("疑问", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 初始化弹框并打开(确定+倒计时) |
||||
|
showConfirmCountdownModal(mIconType, mContent, callback) { |
||||
|
this.showModal({ |
||||
|
iconType: mIconType, |
||||
|
content: mContent, |
||||
|
showCancelButton: false, |
||||
|
showConfirmCountdown: true, |
||||
|
success: function(res) { |
||||
|
if (callback != undefined) { |
||||
|
if (res.confirm == true) { |
||||
|
callback(true); |
||||
|
console.log('用户点击确定') |
||||
|
} else { |
||||
|
callback(false); |
||||
|
console.log('用户点击取消') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 打开消息弹框(取消+确定+倒计时) |
||||
|
showSelectCountdownMessageModal(mContent, callback) { |
||||
|
this.showSelectCountdownModal("消息", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开成功弹框(取消+确定+倒计时) |
||||
|
showSelectCountdownSuccessModal(mContent, callback) { |
||||
|
this.showSelectCountdownModal("成功", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开失败弹框(取消+确定+倒计时) |
||||
|
showSelectCountdownFailModal(mContent, callback) { |
||||
|
this.showSelectCountdownModal("失败", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开警告弹框(取消+确定+倒计时) |
||||
|
showSelectCountdownWarningModal(mContent, callback) { |
||||
|
this.showSelectCountdownModal("警告", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 打开疑问弹框(取消+确定+倒计时) |
||||
|
showSelectCountdownQuestionModal(mContent, callback) { |
||||
|
this.showSelectCountdownModal("疑问", mContent, callback); |
||||
|
}, |
||||
|
|
||||
|
// 初始化弹框并打开(取消+确定+倒计时) |
||||
|
showSelectCountdownModal(mIconType, mContent, callback) { |
||||
|
this.showModal({ |
||||
|
iconType: mIconType, |
||||
|
content: mContent, |
||||
|
showConfirmCountdown: true, |
||||
|
success: function(res) { |
||||
|
if (callback != undefined) { |
||||
|
if (res.confirm == true) { |
||||
|
callback(true); |
||||
|
console.log('用户点击确定') |
||||
|
} else { |
||||
|
callback(false); |
||||
|
console.log('用户点击取消') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 初始化弹框并打开 |
||||
|
showModal(data) { |
||||
|
if (data.iconType) { |
||||
|
this.iconType = data.iconType |
||||
|
switch (data.iconType) { |
||||
|
case '消息': |
||||
|
this.icon = '/static/icons/error-circle.svg'; |
||||
|
break; |
||||
|
case '成功': |
||||
|
this.icon = '/static/icons/checkmark-circle.svg'; |
||||
|
break; |
||||
|
case '失败': |
||||
|
this.icon = '/static/icons/close-circle.svg'; |
||||
|
break; |
||||
|
case '警告': |
||||
|
this.icon = '/static/icons/warning.svg'; |
||||
|
break; |
||||
|
case '疑问': |
||||
|
this.icon = '/static/icons/question-circle.svg'; |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
// image |
||||
|
if (data.title) { |
||||
|
this.title = data.title |
||||
|
} |
||||
|
if (data.content) { |
||||
|
console.log(data.content); |
||||
|
this.content = data.content; |
||||
|
} else { |
||||
|
this.content = '' |
||||
|
} |
||||
|
if (data.cancelText) { |
||||
|
this.cancelText = data.cancelText |
||||
|
} else { |
||||
|
this.cancelText = '取消' |
||||
|
} |
||||
|
if (data.confirmText) { |
||||
|
this.confirmText = data.confirmText |
||||
|
} else { |
||||
|
this.confirmText = '确定' |
||||
|
} |
||||
|
|
||||
|
if (data.showCancel === false || data.showCancel === true) { |
||||
|
this.showCancel = data.showCancel |
||||
|
} else { |
||||
|
this.showCancel = true |
||||
|
} |
||||
|
|
||||
|
if (data.confirmColor) { |
||||
|
this.confirmColor = data.confirmColor |
||||
|
} else { |
||||
|
this.confirmColor = '#007aff' |
||||
|
} |
||||
|
|
||||
|
if (data.cancelColor) { |
||||
|
this.cancelColor = data.cancelColor |
||||
|
} else { |
||||
|
this.cancelColor = '#666F83' |
||||
|
} |
||||
|
|
||||
|
if (data.showConfirmButton === false || data.showConfirmButton === true) { |
||||
|
this.showConfirmButton = data.showConfirmButton |
||||
|
} else { |
||||
|
this.showConfirmButton = true |
||||
|
} |
||||
|
|
||||
|
if (data.showConfirmCountdown === false || data.showConfirmCountdown === true) { |
||||
|
this.showConfirmCountdown = data.showConfirmCountdown |
||||
|
} else { |
||||
|
this.showConfirmCountdown = false |
||||
|
} |
||||
|
|
||||
|
if (data.showCancelButton === false || data.showCancelButton === true) { |
||||
|
this.showCancelButton = data.showCancelButton |
||||
|
} else { |
||||
|
this.showCancelButton = true |
||||
|
} |
||||
|
|
||||
|
if (data.success) { |
||||
|
this.success = data.success |
||||
|
} else { |
||||
|
this.success = () => {} |
||||
|
} |
||||
|
setTimeout(res => { |
||||
|
this.show = true; |
||||
|
}, 500) |
||||
|
if (this.showConfirmCountdown) { |
||||
|
this.startTimer(); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
startTimer() { |
||||
|
this.seconds = 3; |
||||
|
clearInterval(this.timer) |
||||
|
this.timer = setInterval(() => { |
||||
|
this.seconds-- |
||||
|
// console.log("倒计时时间", this.seconds); |
||||
|
if (this.seconds <= 0) { |
||||
|
this.timeUp() |
||||
|
return |
||||
|
} |
||||
|
}, 1000) |
||||
|
}, |
||||
|
|
||||
|
timeUp() { |
||||
|
// clearInterval(this.timer) |
||||
|
console.log('时间到') |
||||
|
this.confirmClose(); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
.slot-content { |
||||
|
font-size: 36rpx; |
||||
|
display: flex; //弹性布局 |
||||
|
flex-direction: column; //垂直排列 |
||||
|
align-items: center; //子元素居中 |
||||
|
// background-image: url() |
||||
|
} |
||||
|
|
||||
|
.icon { |
||||
|
width: 70rpx; |
||||
|
height: 70rpx; |
||||
|
opacity: 1; //透明度 |
||||
|
margin-top: 16px; |
||||
|
} |
||||
|
|
||||
|
.title { |
||||
|
font-size: 35rpx; |
||||
|
} |
||||
|
|
||||
|
.content { |
||||
|
margin-top: 16px; |
||||
|
margin-bottom: 16px; |
||||
|
margin-left: 8px; |
||||
|
margin-right: 8px; |
||||
|
font-size: 32rpx; |
||||
|
text-align: center; |
||||
|
word-wrap: break-word; |
||||
|
word-break: break-all; |
||||
|
white-space: pre-line; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.cance_button { |
||||
|
width: 100%; |
||||
|
margin-top: 10px; |
||||
|
margin-bottom: 10px; |
||||
|
font-size: 32rpx; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.confirm_button { |
||||
|
width: 100%; |
||||
|
margin-top: 10px; |
||||
|
margin-bottom: 10px; |
||||
|
font-size: 32rpx; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.confirm_text { |
||||
|
// color: $uni-color-primary; |
||||
|
} |
||||
|
|
||||
|
.def_text { |
||||
|
color: $uni-color-primary; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,175 @@ |
|||||
|
<template> |
||||
|
<view class="view"> |
||||
|
<view class="list-cell view" hover-class="uni-list-cell-hover" @click="bindClick"> |
||||
|
<view class="media-list view" v-if="options.title"> |
||||
|
<view class="view" :class="{'media-image-right': options.article_type === 2, 'media-image-left': options.article_type === 1}"> |
||||
|
<text class="media-title" :class="{'media-title2': options.article_type === 1 || options.article_type === 2}">{{options.title}}</text> |
||||
|
<view v-if="options.image_list || options.image_url" class="image-section view" :class="{'image-section-right': options.article_type === 2, 'image-section-left': options.article_type === 1}"> |
||||
|
<image class="image-list1" :class="{'image-list2': options.article_type === 1 || options.article_type === 2}" |
||||
|
v-if="options.image_url" :src="options.image_url"></image> |
||||
|
<image class="image-list3" v-if="options.image_list" :src="source.url" v-for="(source, i) in options.image_list" |
||||
|
:key="i" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="media-foot view"> |
||||
|
<view class="media-info view"> |
||||
|
<text class="info-text">{{options.source}}</text> |
||||
|
<text class="info-text">{{options.comment_count}}条评论</text> |
||||
|
<text class="info-text">{{options.datetime}}</text> |
||||
|
</view> |
||||
|
<view class="max-close-view view" @click.stop="close"> |
||||
|
<view class="close-view view"><text class="close">×</text></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
options: { |
||||
|
type: Object, |
||||
|
default: function(e) { |
||||
|
return {} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
close(e) { |
||||
|
this.$emit('close'); |
||||
|
}, |
||||
|
bindClick() { |
||||
|
this.$emit('click'); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.view { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.list-cell { |
||||
|
width: 750rpx; |
||||
|
padding: 0 30rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-list-cell-hover { |
||||
|
background-color: #eeeeee; |
||||
|
} |
||||
|
|
||||
|
.media-list { |
||||
|
flex: 1; |
||||
|
flex-direction: column; |
||||
|
border-bottom-width: 1rpx; |
||||
|
border-bottom-style: solid; |
||||
|
border-bottom-color: #c8c7cc; |
||||
|
padding: 20rpx 0; |
||||
|
} |
||||
|
|
||||
|
.media-image-right { |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
|
||||
|
.media-image-left { |
||||
|
flex-direction: row-reverse; |
||||
|
} |
||||
|
|
||||
|
.media-title { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.media-title { |
||||
|
lines: 3; |
||||
|
text-overflow: ellipsis; |
||||
|
font-size: 32rpx; |
||||
|
color: #555555; |
||||
|
} |
||||
|
|
||||
|
.media-title2 { |
||||
|
flex: 1; |
||||
|
margin-top: 6rpx; |
||||
|
line-height: 40rpx; |
||||
|
} |
||||
|
|
||||
|
.image-section { |
||||
|
margin-top: 20rpx; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
} |
||||
|
|
||||
|
.image-section-right { |
||||
|
margin-top: 0rpx; |
||||
|
margin-left: 10rpx; |
||||
|
width: 225rpx; |
||||
|
height: 146rpx; |
||||
|
} |
||||
|
|
||||
|
.image-section-left { |
||||
|
margin-top: 0rpx; |
||||
|
margin-right: 10rpx; |
||||
|
width: 225rpx; |
||||
|
height: 146rpx; |
||||
|
} |
||||
|
|
||||
|
.image-list1 { |
||||
|
width: 690rpx; |
||||
|
height: 481rpx; |
||||
|
} |
||||
|
|
||||
|
.image-list2 { |
||||
|
width: 225rpx; |
||||
|
height: 146rpx; |
||||
|
} |
||||
|
|
||||
|
.image-list3 { |
||||
|
width: 225rpx; |
||||
|
height: 146rpx; |
||||
|
} |
||||
|
|
||||
|
.media-info { |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
|
||||
|
.info-text { |
||||
|
margin-right: 20rpx; |
||||
|
color: #999999; |
||||
|
font-size: 24rpx; |
||||
|
} |
||||
|
|
||||
|
.media-foot { |
||||
|
margin-top: 20rpx; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
} |
||||
|
|
||||
|
.max-close-view { |
||||
|
align-items: center; |
||||
|
justify-content: flex-end; |
||||
|
flex-direction: row; |
||||
|
height: 40rpx; |
||||
|
width: 80rpx; |
||||
|
} |
||||
|
|
||||
|
.close-view { |
||||
|
border-style: solid; |
||||
|
border-width: 1px; |
||||
|
border-color: #999999; |
||||
|
border-radius: 10rpx; |
||||
|
justify-content: center; |
||||
|
height: 30rpx; |
||||
|
width: 40rpx; |
||||
|
line-height: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.close { |
||||
|
text-align: center; |
||||
|
color: #999999; |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
</style> |
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -1,14 +0,0 @@ |
|||||
import CryptoJS from 'crypto-js' |
|
||||
/** |
|
||||
* @word 要加密的内容 |
|
||||
* @keyWord String 服务器随机返回的关键字 |
|
||||
* */ |
|
||||
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") { |
|
||||
var key = CryptoJS.enc.Utf8.parse(keyWord); |
|
||||
var srcs = CryptoJS.enc.Utf8.parse(word); |
|
||||
var encrypted = CryptoJS.AES.encrypt(srcs, key, { |
|
||||
mode: CryptoJS.mode.ECB, |
|
||||
padding: CryptoJS.pad.Pkcs7 |
|
||||
}); |
|
||||
return encrypted.toString(); |
|
||||
} |
|
@ -1,17 +0,0 @@ |
|||||
import config from '@/config' |
|
||||
const baseUrl = config.baseUrl |
|
||||
export const myRequest = (option = {}) => { |
|
||||
return new Promise((reslove, reject) => { |
|
||||
uni.request({ |
|
||||
url: baseUrl + option.url, |
|
||||
data: option.data, |
|
||||
method: option.method || "GET", |
|
||||
success: (result) => { |
|
||||
reslove(result) |
|
||||
}, |
|
||||
fail: (error) => { |
|
||||
reject(error) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,27 +1,30 @@ |
|||||
// 应用全局配置
|
// 应用全局配置
|
||||
module.exports = { |
const config = { |
||||
// baseUrl: 'http://api-dashboard.win.iocoder.cn',
|
//baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
baseUrl: 'http://localhost:12080', |
//cloud后台网关地址
|
||||
baseApi: '/admin-api', |
baseUrl: 'http://dev.ccwin-in.com:25100/api', |
||||
// 应用信息
|
baseApi: '/admin-api', |
||||
appInfo: { |
// 应用信息
|
||||
// 应用名称
|
appInfo: { |
||||
name: "win-app", |
// 应用名称
|
||||
// 应用版本
|
name: "ruoyi-app-vue3", |
||||
version: "1.0.0", |
// 应用版本
|
||||
// 应用logo
|
version: "1.1.0", |
||||
logo: "/static/logo.png", |
// 应用logo
|
||||
// 官方网站
|
logo: "/static/logo.png", |
||||
site_url: "https://iocoder.cn", |
// 官方网站
|
||||
// 政策协议
|
site_url: "http://ruoyi.vip", |
||||
agreements: [{ |
// 政策协议
|
||||
title: "隐私政策", |
agreements: [{ |
||||
url: "https://iocoder.cn" |
title: "隐私政策", |
||||
}, |
url: "https://ruoyi.vip/protocol.html" |
||||
{ |
}, |
||||
title: "用户服务协议", |
{ |
||||
url: "https://iocoder.cn" |
title: "用户服务协议", |
||||
} |
url: "https://ruoyi.vip/protocol.html" |
||||
] |
} |
||||
} |
] |
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
export default config |
@ -0,0 +1,20 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8" /> |
||||
|
<script> |
||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||
|
CSS.supports('top: constant(a)')) |
||||
|
document.write( |
||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
|
</script> |
||||
|
<title></title> |
||||
|
<!--preload-links--> |
||||
|
<!--app-context--> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="app"><!--app-html--></div> |
||||
|
<script type="module" src="/main.js"></script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,23 @@ |
|||||
|
import axios from 'axios' |
||||
|
|
||||
|
const isNewVersion = () => { |
||||
|
let updae_url = getApp().globalData.text; |
||||
|
let url = updae_url+ `/static/version.json?t=${new Date().getTime()}` |
||||
|
axios.get(url).then(res => { |
||||
|
if (res.status === 200) { |
||||
|
let vueVersion = res.data.version; |
||||
|
let localVueVersion = localStorage.getItem('vueVersion'); |
||||
|
if (localVueVersion && localVueVersion != vueVersion) { |
||||
|
localStorage.setItem('vueVersion', vueVersion); |
||||
|
window.location.reload(); |
||||
|
return; |
||||
|
} else { |
||||
|
localStorage.setItem('vueVersion', vueVersion); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
isNewVersion |
||||
|
} |
@ -1,17 +1,86 @@ |
|||||
import Vue from 'vue' |
|
||||
import App from './App' |
import App from './App' |
||||
import store from './store' // store
|
import store from './store' |
||||
import plugins from './plugins' // plugins
|
import './router/my_router.js'; //引入拦截
|
||||
import './permission' // permission
|
import VueClipboard from 'vue-clipboard2' |
||||
Vue.use(plugins) |
|
||||
|
// 引入 uView UI
|
||||
|
import uView from './uni_modules/vk-uview-ui'; |
||||
|
// import utils from '@/common/utils.js';
|
||||
|
// import uShowModal from "./mycomponents/show-modal/uShowModal.vue"
|
||||
|
// // 如此配置即可
|
||||
|
// uni.$u.config.unit = 'rpx'
|
||||
|
|
||||
|
// #ifndef VUE3
|
||||
|
import Vue from 'vue' |
||||
|
console.log("Vuew2222"); |
||||
Vue.config.productionTip = false |
Vue.config.productionTip = false |
||||
Vue.prototype.$store = store |
Vue.prototype.$store = store |
||||
|
Vue.prototype.$adpid = "1111111111" |
||||
|
Vue.prototype.$backgroundAudioData = { |
||||
|
playing: false, |
||||
|
playTime: 0, |
||||
|
formatedPlayTime: '00:00:00' |
||||
|
} |
||||
App.mpType = 'app' |
App.mpType = 'app' |
||||
|
|
||||
const app = new Vue({ |
const app = new Vue({ |
||||
...App |
store, |
||||
|
...App |
||||
}) |
}) |
||||
|
|
||||
app.$mount() |
app.$mount() |
||||
|
// #endif
|
||||
|
|
||||
|
// #ifdef VUE3
|
||||
|
import { |
||||
|
createSSRApp |
||||
|
} from 'vue' |
||||
|
export function createApp() { |
||||
|
const app = createSSRApp(App) |
||||
|
|
||||
|
// 使用 uView UI
|
||||
|
app.use(store) |
||||
|
app.use(uView) |
||||
|
app.use(VueClipboard) |
||||
|
app.config.globalProperties.$adpid = "1111111111" |
||||
|
app.config.globalProperties.$pageSize = 100 |
||||
|
// app.config.globalProperties.$utils = utils;
|
||||
|
|
||||
|
app.config.globalProperties.$backgroundAudioData = { |
||||
|
playing: false, |
||||
|
playTime: 0, |
||||
|
formatedPlayTime: '00:00:00' |
||||
|
} |
||||
|
startApp(app); |
||||
|
// app.component('u-show-modal', uShowModal);
|
||||
|
return { |
||||
|
app |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export function startApp(app) { |
||||
|
uni.request({ |
||||
|
url: `./static/config.json?t=${new Date().getTime()}`, |
||||
|
method: 'get', |
||||
|
data: {}, |
||||
|
success: (res) => { |
||||
|
if (res.data != "") { |
||||
|
//在配置中读url,company等信息
|
||||
|
app.config.globalProperties.$baseInfo = res.data.baseInfo; |
||||
|
getApp().globalData.dev_url = res.data.baseInfo.dev.value; |
||||
|
getApp().globalData.request_url = res.data.baseInfo.request_url.value; |
||||
|
getApp().globalData.tenantId = res.data.baseInfo.tenantId.value; |
||||
|
app.config.globalProperties.$recepit_configList = res.data.recepit_configList; |
||||
|
getApp().globalData.recepit_configList = res.data.recepit_configList; |
||||
|
getApp().globalData.feed_configList = res.data.feed_configList; |
||||
|
} |
||||
|
}, |
||||
|
fail: (error) => { |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
return { |
||||
|
startApp |
||||
|
}; |
||||
|
} |
||||
|
// #endif
|
||||
|
@ -1,69 +1,210 @@ |
|||||
{ |
{ |
||||
"name" : "闻荫移动端", |
"name" : "pda_vue_3.0", |
||||
"appid" : "__UNI__25A9D80", |
"appid" : "__UNI__43932FE", |
||||
"description" : "", |
"description" : "应用描述", |
||||
"versionName" : "1.0.0", |
"versionName" : "1.0.0", |
||||
"versionCode" : "100", |
"versionCode" : "100", |
||||
"transformPx" : false, |
"transformPx" : false, |
||||
"app-plus" : { |
"app-plus" : { |
||||
"usingComponents" : true, |
"usingComponents" : true, |
||||
"nvueCompiler" : "uni-app", |
"nvueCompiler" : "uni-app", |
||||
|
"nvueStyleCompiler" : "uni-app", |
||||
|
"compilerVersion" : 3, |
||||
|
"nvueLaunchMode" : "fast", |
||||
"splashscreen" : { |
"splashscreen" : { |
||||
"alwaysShowBeforeRender" : true, |
"alwaysShowBeforeRender" : true, |
||||
"waiting" : true, |
"waiting" : true, |
||||
"autoclose" : true, |
"autoclose" : true, |
||||
"delay" : 0 |
"delay" : 0 |
||||
}, |
}, |
||||
"modules" : {}, |
"modules" : { |
||||
|
"OAuth" : {}, |
||||
|
"Payment" : {}, |
||||
|
"Push" : {}, |
||||
|
"Share" : {}, |
||||
|
"Speech" : {}, |
||||
|
"VideoPlayer" : {} |
||||
|
}, |
||||
"distribute" : { |
"distribute" : { |
||||
"android" : { |
"android" : { |
||||
"permissions" : [ |
"permissions" : [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<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-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.GET_TASKS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
"<uses-permission android:name=\"android.permission.READ_SMS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.SEND_SMS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>", |
||||
|
"<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>" |
||||
] |
] |
||||
}, |
}, |
||||
"ios" : {}, |
"ios" : { |
||||
"sdkConfigs" : {} |
"UIBackgroundModes" : [ "audio" ], |
||||
|
"urlschemewhitelist" : [ "baidumap", "iosamap" ] |
||||
|
}, |
||||
|
"sdkConfigs" : { |
||||
|
"speech" : { |
||||
|
"ifly" : {} |
||||
|
} |
||||
|
}, |
||||
|
"orientation" : [ "portrait-primary" ] |
||||
|
}, |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
} |
} |
||||
}, |
}, |
||||
"quickapp" : {}, |
"quickapp" : {}, |
||||
|
"quickapp-native" : { |
||||
|
"icon" : "/static/logo.png", |
||||
|
"package" : "com.example.demo", |
||||
|
"features" : [ |
||||
|
{ |
||||
|
"name" : "system.clipboard" |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
"quickapp-webview" : { |
||||
|
"icon" : "/static/logo.png", |
||||
|
"package" : "com.example.demo", |
||||
|
"minPlatformVersion" : 1070, |
||||
|
"versionName" : "1.0.0", |
||||
|
"versionCode" : 100 |
||||
|
}, |
||||
"mp-weixin" : { |
"mp-weixin" : { |
||||
"appid" : "wxccd7e2a0911b3397", |
"appid" : "", |
||||
"setting" : { |
"setting" : { |
||||
"urlCheck" : false, |
"urlCheck" : false |
||||
"es6" : false, |
|
||||
"minified" : true, |
|
||||
"postcss" : true |
|
||||
}, |
}, |
||||
"optimization" : { |
"usingComponents" : true, |
||||
"subPackages" : true |
"permission" : { |
||||
|
"scope.userLocation" : { |
||||
|
"desc" : "演示定位能力" |
||||
|
} |
||||
}, |
}, |
||||
"usingComponents" : true |
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"mp-alipay" : { |
||||
|
"usingComponents" : true, |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"mp-baidu" : { |
||||
|
"usingComponents" : true, |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"mp-toutiao" : { |
||||
|
"usingComponents" : true, |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"mp-jd" : { |
||||
|
"usingComponents" : true, |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
}, |
}, |
||||
"vueVersion" : "2", |
|
||||
"h5" : { |
"h5" : { |
||||
"template" : "static/index.html", |
|
||||
"devServer" : { |
|
||||
"port" : 9090, |
|
||||
"https" : false |
|
||||
}, |
|
||||
"title" : "win-App", |
|
||||
"router" : { |
"router" : { |
||||
"mode" : "hash", |
"mode" : "hash" |
||||
"base" : "./" |
}, |
||||
|
"template" : "template.h5.html", |
||||
|
"sdkConfigs" : { |
||||
|
"maps" : {} |
||||
|
}, |
||||
|
"devServer" : { |
||||
|
"https" : false, |
||||
|
"proxy" : { |
||||
|
"/prod" : { |
||||
|
"target" : "http://dev.ccwin-in.com:59096/", |
||||
|
//"target": "http://127.0.0.1:4523/m1/1086659-0-default/", |
||||
|
"changeOrigin" : true, |
||||
|
"logLevel" : "debug", |
||||
|
"secure" : false, |
||||
|
"pathRewrite" : { |
||||
|
"^/prod" : "/" |
||||
|
} |
||||
|
}, |
||||
|
"/print" : { |
||||
|
"target" : "http://dev.ccwin-in.com:59095/", |
||||
|
"changeOrigin" : true, |
||||
|
"logLevel" : "debug", |
||||
|
"secure" : false, |
||||
|
"pathRewrite" : { |
||||
|
"^/print" : "/" |
||||
|
} |
||||
|
}, |
||||
|
"/pc" : { |
||||
|
"target" : "http://dev.ccwin-in.com:59097/", |
||||
|
"changeOrigin" : true, |
||||
|
"logLevel" : "debug", |
||||
|
"secure" : false, |
||||
|
"pathRewrite" : { |
||||
|
"^/pc" : "/" |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"port" : 8081 |
||||
|
} |
||||
|
}, |
||||
|
"vueVersion" : "3", |
||||
|
"mp-kuaishou" : { |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
} |
} |
||||
|
}, |
||||
|
"mp-lark" : { |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"mp-qq" : { |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"quickapp-webview-huawei" : { |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"quickapp-webview-union" : { |
||||
|
"uniStatistics" : { |
||||
|
"enable" : true |
||||
|
} |
||||
|
}, |
||||
|
"uniStatistics" : { |
||||
|
"version" : "2", |
||||
|
"enable" : true |
||||
} |
} |
||||
} |
} |
||||
|
@ -0,0 +1,25 @@ |
|||||
|
<template> |
||||
|
<view class="batch_view"> |
||||
|
<text class="card_batch">批次</text> |
||||
|
<text class="card_batch_content"> {{batch}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data(){ |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
batch:{ |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,111 @@ |
|||||
|
<template> |
||||
|
<view :class="dataContent.scaned?'scan_view':''"> |
||||
|
<view class="uni-flex uni-row space-between uni-inline-item"> |
||||
|
<view> |
||||
|
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack> |
||||
|
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch> |
||||
|
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location> |
||||
|
</view> |
||||
|
<view> |
||||
|
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" |
||||
|
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> --> |
||||
|
<qty v-if="dataContent.handleQty==0 || dataContent.handleQty==undefined" :dataContent="dataContent" |
||||
|
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> |
||||
|
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number( dataContent.qty)" |
||||
|
:handleQty="Number (dataContent.handleQty)" :isShowStdPack="isShowStdPack"> |
||||
|
</compare-qty> |
||||
|
<view class="" style="font-size: 40rpx;"> |
||||
|
<u-button @click="copy" size="mini" type="primary">复制箱码</u-button> |
||||
|
</view> |
||||
|
<view class="" style="font-size: 40rpx;"> |
||||
|
<u-button @click="copyPro" size="mini" type="primary">复制制品</u-button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <u-line></u-line> --> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import qty from '@/mycomponents/qty/qty.vue' |
||||
|
import recommendQty from '@/mycomponents/qty/recommendQty.vue' |
||||
|
import compareQty from '@/mycomponents/qty/compareQty.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
pack, |
||||
|
location, |
||||
|
batch, |
||||
|
qty, |
||||
|
recommendQty, |
||||
|
compareQty, |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStdPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
copy(){ |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HPQ;V1.0;I"+this.detail.itemCode+";P"+this.detail.packingNumber+";B"+this.detail.batch+";Q"+this.detail.qty |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
copyPro(){ |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HMQ;V1.0;I"+this.detail.itemCode+";P"+this.detail.packingNumber+";B"+this.detail.batch+";Q"+this.detail.qty |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,181 @@ |
|||||
|
<template> |
||||
|
<uni-popup ref="popup"> |
||||
|
<view class="pop_detail" style="height:80%"> |
||||
|
<com-item :dataContent="dataContent.package"></com-item> |
||||
|
<u-line></u-line> |
||||
|
<scroll-view style="height:320px "> |
||||
|
<view v-for="(item, index) in dataList" style="width: 100%;"> |
||||
|
<view class="item"> |
||||
|
<text class="item_title">{{item.item_title}} </text> |
||||
|
<text v-if="(item.type=='')||(item.type==undefined)" class="text_wrap">{{item.content}} </text> |
||||
|
<text v-else-if="item.type=='dateTime'" class="text_wrap">{{formatDate(item.content)}} </text> |
||||
|
<text v-else-if="item.type=='boolean'" class="text_wrap">{{boolean(item.content)}} </text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
|
||||
|
<view class="uni-flex u-row-center "> |
||||
|
<view class="close_button" @click="closePopup"> |
||||
|
关闭</view> |
||||
|
<!-- button 滚动不好使 --> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import comItem from '@/mycomponents/item/item.vue' |
||||
|
import { dateFormat } from '@/common/basic.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['onClose'], |
||||
|
components: { |
||||
|
comItem |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
dataList: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() {}, |
||||
|
props: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
openPopup(val) { |
||||
|
this.dataContent = val; |
||||
|
this.getDataList(); |
||||
|
this.$refs.popup.open('bottom') |
||||
|
|
||||
|
}, |
||||
|
avaliable(value) { |
||||
|
return value == "TRUE" ? "可用" : "不可用" |
||||
|
}, |
||||
|
boolean(value) { |
||||
|
return value == "TRUE" ? "是" : "否" |
||||
|
}, |
||||
|
formatDate(val) { |
||||
|
return dateFormat(val) |
||||
|
}, |
||||
|
|
||||
|
closePopup(val) { |
||||
|
this.$refs.popup.close('bottom') |
||||
|
// this.$emit('onClose') |
||||
|
}, |
||||
|
|
||||
|
getDataList() { |
||||
|
// console.log(JSON.stringify(this.dataContent)); |
||||
|
this.dataList.length = 0; |
||||
|
this.dataList.push(...[{ |
||||
|
item_title: '包装号', |
||||
|
content: this.dataContent.packingNumber, |
||||
|
}, { |
||||
|
item_title: '器具代码', |
||||
|
content: this.dataContent.containerNumber, |
||||
|
}, { |
||||
|
item_title: '物料代码', |
||||
|
content: this.dataContent.itemCode, |
||||
|
}, { |
||||
|
item_title: '批次', |
||||
|
content: this.dataContent.batch, |
||||
|
}, { |
||||
|
item_title: '替代批次', |
||||
|
content: this.dataContent.altBatch, |
||||
|
}, { |
||||
|
item_title: '到货日期', |
||||
|
content: this.dataContent.arriveDate, |
||||
|
type:"dateTime" |
||||
|
}, { |
||||
|
item_title: '生产日期', |
||||
|
content: this.dataContent.produceDate, |
||||
|
type:"dateTime" |
||||
|
}, { |
||||
|
item_title: '失效日期', |
||||
|
content: this.dataContent.expireDate, |
||||
|
type:"dateTime" |
||||
|
}, { |
||||
|
item_title: '库存状态', |
||||
|
content: this.dataContent.inventoryStatus, |
||||
|
type:"" |
||||
|
}, { |
||||
|
item_title: '库位代码', |
||||
|
content: this.dataContent.locationCode, |
||||
|
type:"" |
||||
|
}, { |
||||
|
item_title: '库位组代码', |
||||
|
content: this.dataContent.locationGroupCode, |
||||
|
type:"" |
||||
|
}, { |
||||
|
item_title: '库区代码', |
||||
|
content: this.dataContent.areaCode, |
||||
|
type:"" |
||||
|
}, { |
||||
|
item_title: '仓库代码', |
||||
|
content: this.dataContent.warehouseCode, |
||||
|
}, { |
||||
|
item_title: 'ERP库位代码', |
||||
|
content: this.dataContent.erpLocationCode, |
||||
|
}, { |
||||
|
item_title: '货主代码', |
||||
|
content: this.dataContent.ownerCode, |
||||
|
}, { |
||||
|
item_title: '计量单位', |
||||
|
content: this.dataContent.uom, |
||||
|
type:"uom" |
||||
|
}, { |
||||
|
item_title: '数量', |
||||
|
content: this.dataContent.qty, |
||||
|
}, { |
||||
|
item_title: '锁定数量', |
||||
|
content: this.dataContent.lockedQty, |
||||
|
}, { |
||||
|
item_title: '可用数量', |
||||
|
content: this.dataContent.usableQty, |
||||
|
}, { |
||||
|
item_title: '单价', |
||||
|
content: this.dataContent.singlePrice, |
||||
|
}, { |
||||
|
item_title: '金额', |
||||
|
content: this.dataContent.amount, |
||||
|
}, { |
||||
|
item_title: '入库时间', |
||||
|
content: this.dataContent.putInTime, |
||||
|
type:"dateTime" |
||||
|
}, { |
||||
|
item_title: '是否冻结', |
||||
|
content: this.dataContent.frozen, |
||||
|
type:"" |
||||
|
}, { |
||||
|
item_title: '冻结原因', |
||||
|
content: this.dataContent.frozenReason, |
||||
|
}, { |
||||
|
item_title: '最后事务号', |
||||
|
content: this.dataContent.lastTransNumber, |
||||
|
}, { |
||||
|
item_title: '重量', |
||||
|
content: this.dataContent.weight, |
||||
|
}, { |
||||
|
item_title: '面积', |
||||
|
content: this.dataContent.area, |
||||
|
}, { |
||||
|
item_title: '体积', |
||||
|
content: this.dataContent.volume, |
||||
|
}]); |
||||
|
// console.log(JSON.stringify(this.dataList)); |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
|
||||
|
|
||||
|
</style> |
@ -0,0 +1,57 @@ |
|||||
|
<template> |
||||
|
<view :class="dataContent.scaned?'scan_view':''"> |
||||
|
<balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack" :isShowLocation="isShowLocation"></balance> |
||||
|
<purchase-info :dataContent="packageContent"></purchase-info> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
import purchaseInfo from '@/mycomponents/purchase/purchaseInfo.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
balance, |
||||
|
purchaseInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
packageContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStdPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,98 @@ |
|||||
|
<template> |
||||
|
<view :class="dataContent.scaned?'scan_view':''"> |
||||
|
<view class="uni-flex uni-row space-between uni-inline-item"> |
||||
|
<view> |
||||
|
<pack v-if="isShowPack" :packingCode="dataContent.packingNumber"></pack> |
||||
|
<batch v-if="isShowBatch" :batch="dataContent.batch"></batch> |
||||
|
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location> |
||||
|
</view> |
||||
|
<view> |
||||
|
<qty :isShowStatus="dataContent.inventoryStatus==dataContent.toInventoryStatus" v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" |
||||
|
:isShowStdPack="isShowStdPack"></qty> |
||||
|
|
||||
|
<compare-qty v-else :dataContent="dataContent" :recommendQty="dataContent.qty" |
||||
|
:handleQty="dataContent.record.qty" :isShowStdPack="isShowStdPack"> |
||||
|
</compare-qty> |
||||
|
<moveStatus v-if="dataContent.inventoryStatus!=dataContent.toInventoryStatus" :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus"> |
||||
|
</moveStatus> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<u-line></u-line> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import qty from '@/mycomponents/qty/qty.vue' |
||||
|
import recommendQty from '@/mycomponents/qty/recommendQty.vue' |
||||
|
import compareQty from '@/mycomponents/qty/compareQty.vue' |
||||
|
import moveStatus from '@/mycomponents/balance/moveStatus.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
pack, |
||||
|
location, |
||||
|
batch, |
||||
|
qty, |
||||
|
recommendQty, |
||||
|
compareQty, |
||||
|
moveStatus |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStdPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBusiness: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
scaned: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
fromInventoryStatus: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
toInventoryStatus: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,54 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
||||
|
<uni-popup ref="popupItems" type="center"> |
||||
|
<scroll-view scroll-y="true" style="background-color: #EEEEEE;height: 90vh;"> |
||||
|
<item :dataContent="balanceItems[0]"></item> |
||||
|
<view class="popinpop count_shadow" style="width: 90vw;margin: 20rpx 20rpx 30rpx 20rpx;" |
||||
|
v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)"> |
||||
|
<balance :dataContent="item"></balance> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</uni-popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import item from '@/mycomponents/item/item.vue' |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: "balanceSelect", |
||||
|
emits: ['onSelectItem'], |
||||
|
components: { |
||||
|
item, |
||||
|
balance |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
balanceItems: [], |
||||
|
}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
// datacontent: { |
||||
|
// type: Object, |
||||
|
// value: null |
||||
|
// } |
||||
|
}, |
||||
|
methods: { |
||||
|
openPopup(items) { |
||||
|
this.balanceItems = items; |
||||
|
this.$refs['popupItems'].open("center"); |
||||
|
}, |
||||
|
|
||||
|
callback(item) { |
||||
|
this.$emit("onSelectItem", item); |
||||
|
this.$refs['popupItems'].close(); |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,24 @@ |
|||||
|
<template> |
||||
|
<view class="batch_view uni-inline-item"> |
||||
|
<text class="card_batch">批次</text> |
||||
|
<text class="card_batch_content">{{batch}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
props: { |
||||
|
batch: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,37 @@ |
|||||
|
<template> |
||||
|
<view class="business_view uni-inline-item"> |
||||
|
<text class="card_business">{{businessTypeDesc(bussinessType)}}</text> |
||||
|
<text class="card_business_content">{{number}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getBusinessTypeDesc |
||||
|
} from '@/common/directory.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
props: { |
||||
|
bussinessType: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
number: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
businessTypeDesc(type){ |
||||
|
return getBusinessTypeDesc(type) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,85 @@ |
|||||
|
<template> |
||||
|
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> |
||||
|
<view class="uni-flex uni-row space-between uni-inline-item"> |
||||
|
<view class="uni-flex uni-row uni-inline-item"> |
||||
|
<view style=" width: 20px;display: flex;justify-content: center;align-items: center;color: #0CC2B6;"> |
||||
|
实际 |
||||
|
</view> |
||||
|
<view> |
||||
|
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> |
||||
|
<batch v-if="isShowBatch" :batch="detail.batch"></batch> |
||||
|
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view> |
||||
|
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" |
||||
|
:isShowStdPack="false"></recommend-qty> |
||||
|
|
||||
|
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty" |
||||
|
:isShowStdPack="false"> |
||||
|
</compare-qty> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import recommendQty from '@/mycomponents/qty/recommendQty.vue' |
||||
|
import compareQty from '@/mycomponents/qty/compareQty.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
pack, |
||||
|
location, |
||||
|
batch, |
||||
|
recommendQty, |
||||
|
compareQty |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
detail: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.recommend { |
||||
|
position: absolute; |
||||
|
left: 25px; |
||||
|
top: 70px; |
||||
|
width: 10px; |
||||
|
height: 30px; |
||||
|
opacity: 1; |
||||
|
|
||||
|
} |
||||
|
</style> |
@ -0,0 +1,26 @@ |
|||||
|
<template> |
||||
|
<view class="location_view uni-inline-item"> |
||||
|
<text class="card_location">库位</text> |
||||
|
<text>{{locationCode}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
props: { |
||||
|
locationCode: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,56 @@ |
|||||
|
<template> |
||||
|
<view class="uni-inline-item" style="font-size: 30rpx;"> |
||||
|
<view :class="statusStyle(fromInventoryStatus)"> |
||||
|
• |
||||
|
{{statusDesc(fromInventoryStatus)}} |
||||
|
</view> |
||||
|
-> |
||||
|
<view :class="statusStyle(toInventoryStatus)"> |
||||
|
• |
||||
|
{{statusDesc(toInventoryStatus)}} |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getInventoryStatusStyle, |
||||
|
getInventoryStatusName |
||||
|
} from '@/common/directory.js'; |
||||
|
export default { |
||||
|
components: {}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
fromInventoryStatus: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
toInventoryStatus: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
statusStyle(value) { |
||||
|
return getInventoryStatusStyle(value); |
||||
|
}, |
||||
|
statusDesc(value) { |
||||
|
return getInventoryStatusName(value) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,34 @@ |
|||||
|
<template> |
||||
|
<view class="pack_view uni-inline-item"> |
||||
|
<text class="card_packing_code">箱码</text> |
||||
|
<text class="card_packing_code_content">{{packingCode}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
components: { |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
packingCode: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,59 @@ |
|||||
|
<template> |
||||
|
<view :class="dataContent.scaned?'scan_view':''"> |
||||
|
<balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack" |
||||
|
:isShowLocation="isShowLocation"></balance> |
||||
|
<production-info :dataContent="packageContent"></production-info> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
import productionInfo from '@/mycomponents/production/productionInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
balance, |
||||
|
productionInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
packageContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStdPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue