Browse Source

初始化项目

wms3.0_pda
李俊城 1 year ago
parent
commit
6a51291b9f
  1. 24
      .gitignore
  2. 38
      App.vue
  3. 21
      LICENSE
  4. 129
      README.md
  5. 40
      api/httpRequest.js
  6. 108
      api/httpRequest2.js
  7. 58
      api/httpRequest3.js
  8. 1232
      api/index.js
  9. 957
      api/request.js
  10. 3628
      api/request2.js
  11. 22
      api/test.js
  12. 171
      changelog.md
  13. 262
      common/airport.js
  14. 41
      common/api/httpRequest.js
  15. 0
      common/cache.js
  16. 371
      common/classify.data.js
  17. 42
      common/commit.js
  18. 33
      common/common.js
  19. 26
      common/config.js
  20. 97
      common/graceChecker.js
  21. 352
      common/html-parser.js
  22. 58
      common/initModal.js
  23. 194
      common/label.js
  24. 112
      common/message.js
  25. 5
      common/modelConfig.js
  26. 245
      common/permission.js
  27. 26
      common/promise.js
  28. 123
      common/request.js
  29. 103
      common/request_test.js
  30. 309
      common/scan.js
  31. 0
      common/storage.js
  32. 2749
      common/style/new_style.css
  33. 762
      common/style/pdabasic.css
  34. 136
      common/uni-nvue.css
  35. 30
      config.js
  36. 4
      index.html
  37. 23
      libs/versionUpdate.js
  38. 87
      main.js
  39. 210
      manifest.json
  40. 122
      mycomponents/balance/balance.vue
  41. 164
      mycomponents/detail/comDetailCard.vue
  42. 153
      mycomponents/detail/comRequestDetailCard.vue
  43. 148
      mycomponents/job/jobcomDetailCard.vue
  44. 267
      mycomponents/qty/CountQtyEdit.vue
  45. 219
      mycomponents/qty/balanceQtyEdit.vue
  46. 198
      mycomponents/qty/inspectQtyEdit.vue
  47. 225
      mycomponents/qty/recommendQtyEdit.vue
  48. 133
      mycomponents/recommend/recommend.vue
  49. 121
      mycomponents/recommend/recommendCount.vue
  50. 181
      mycomponents/record/recordComDetailCard.vue
  51. 243
      mycomponents/scan/winComScan.vue
  52. 119
      mycomponents/scan/winScanContainer.vue
  53. 173
      mycomponents/scan/winScanItem.vue
  54. 163
      mycomponents/scan/winScanLocation.vue
  55. 116
      mycomponents/scan/winScanPack.vue
  56. 134
      mycomponents/scan/winScanPackAndCont.vue
  57. 451
      mycomponents/scan/winScanPackAndLocation.vue
  58. 225
      mycomponents/scan/winScanPackAndPosition.vue
  59. 12242
      package-lock.json
  60. 171
      package.json
  61. 1836
      pages.json
  62. 119
      pages/config/config.vue
  63. 182
      pages/container/coms/comContainerBindCard.vue
  64. 174
      pages/container/coms/comPalletRecord.vue
  65. 424
      pages/container/record/containerBindRecord.vue
  66. 386
      pages/container/record/containerUnBindRecord.vue
  67. 160
      pages/count/coms/comCountDetailCard.vue
  68. 845
      pages/count/job/countDetail.vue
  69. 293
      pages/count/job/countJob.vue
  70. 554
      pages/count/record/countRecord.vue
  71. 174
      pages/customerReturn/coms/comReturnRecord.vue
  72. 540
      pages/customerReturn/job/returnDetail.vue
  73. 287
      pages/customerReturn/job/returnJob.vue
  74. 468
      pages/customerReturn/record/returnRecord.vue
  75. 396
      pages/customerReturn/request/customerReturnRequest.vue
  76. 488
      pages/customerReturn/request/customerReturnRequestCreate.vue
  77. 127
      pages/customerReturn/request/customerReturnRequestDetail.vue
  78. 172
      pages/deliver/coms/comDeliverDetailCard.vue
  79. 297
      pages/deliver/coms/comDeliverRequestPopup.vue
  80. 531
      pages/deliver/coms/comScanDeliverPack.vue
  81. 464
      pages/deliver/job/deliverDetail.vue
  82. 289
      pages/deliver/job/deliverJob.vue
  83. 504
      pages/deliver/record/deliverRecord.vue
  84. 392
      pages/deliver/request/deliverRequest.vue
  85. 200
      pages/deliver/request/deliverRequestCreate.vue
  86. 139
      pages/deliver/request/deliverRequestDetail.vue
  87. 705
      pages/demo/demo.vue
  88. 496
      pages/index/index.vue
  89. 156
      pages/inspect/coms/comInspectDetailCard.vue
  90. 237
      pages/inspect/coms/inspectComDetailCard.vue
  91. 293
      pages/inspect/coms/inspectEdit.vue
  92. 529
      pages/inspect/job/inspectDetail.vue
  93. 551
      pages/inspect/job/inspectFullDetail.vue
  94. 298
      pages/inspect/job/inspectJob.vue
  95. 578
      pages/inspect/job/inspectResult.vue
  96. 382
      pages/inspect/request/inspectRequest.vue
  97. 132
      pages/inspect/request/inspectRequestDetail.vue
  98. 144
      pages/inventoryMove/coms/comInventoryDetailCard.vue
  99. 411
      pages/inventoryMove/coms/comMove.vue
  100. 324
      pages/inventoryMove/coms/comMoveJob.vue

24
.gitignore

@ -1,5 +1,21 @@
/.gitignore
/node_modules
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
/unpackage
/static/config.json
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

38
App.vue

@ -1,38 +0,0 @@
<script>
export default {
onLaunch: function(option) {
console.log('App Launch')
},
onShow: function() {
// setInterval(function(){
// uni.hideKeyboard()
// },60)
// console.log('App Show')
},
onHide: function() {
// console.log('App Hide')
}
}
</script>
<style lang="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 './common/style/uni.css';
@import './common/style/pdabasic.css';
@import './uni.scss';
@import '@/static/scss/index.scss';
@import './static/ali_icon/iconfont.css';
body{
background-color: #EBEEF0;
}
.content{
background-color:#fff
}
</style>

21
LICENSE

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 DCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

129
README.md

@ -1,129 +0,0 @@
# 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/)

40
api/httpRequest.js

@ -1,40 +0,0 @@
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;

108
api/httpRequest2.js

@ -1,108 +0,0 @@
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

58
api/httpRequest3.js

@ -1,58 +0,0 @@
import storage from '@/common/utils/storage'
function service(options = {}) {
var token = storage.getStorage(storage.constant.token)
var tenantId = 1
if(getApp()!=undefined){
tenantId = getApp().globalData.tenantId
}
var requestUrl = ""
if(getApp()!=undefined){
requestUrl = getApp().globalData.request_url
}
options.header = {
"content-type": "application/json",
"Authorization": "Bearer "+token,
"dataType":"json",
"tenant-id":tenantId
};
options.timeout = 10000
options.url = requestUrl+options.url
return new Promise((resolve, reject) => {
options.success = (res) => {
if (res ) {
if(res.statusCode == 200){
if(res.data.code==0){
resolve(res.data);
}else {
reject("系统异常:"+res.data.msg)
}
}else {
reject("系统异常:"+ res.data.msg)
}
} else {
reject("系统异常:"+res.data.msg)
}
};
options.fail = (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) + '异常'
}
reject("系统异常:"+message);
};
uni.request(options);
});
}
export default service;

1232
api/index.js

File diff suppressed because it is too large

957
api/request.js

@ -1,957 +0,0 @@
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,
});
}

3628
api/request2.js

File diff suppressed because it is too large

22
api/test.js

@ -1,22 +0,0 @@
// 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"
})
}

171
changelog.md

@ -1,171 +0,0 @@
## 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 发布插件市场

262
common/airport.js

@ -1,262 +0,0 @@
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": [
"湛江机场",
"昭通机场",
"郑州新郑国际机场",
"芷江机场",
"重庆江北国际机场",
"中卫香山机场",
"舟山朱家尖机场",
"珠海三灶机场"
]
}]
}

41
common/api/httpRequest.js

@ -1,41 +0,0 @@
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
common/cache.js

371
common/classify.data.js

@ -1,371 +0,0 @@
export default [{
"name": "库存查询",
"children": [{
"name": "按物料查询库存",
"icon": "/static/menus/menu_search_lj.svg",
"url": "pages/query/item",
"index": 1,
},
{
"name": "按库位查询库存",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/query/location",
"index": 2,
},
{
"name": "按器具查询库存",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/query/container",
"index": 3,
},
{
"name": "单据查询",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/query/number",
"index": 3,
}
]
},
{
"name": "原料管理",
"children": [{
"name": "采购收货任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/purchaseReceipt/job/receiptJob",
"index": 1,
},
{
"name": "到货检验任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/inspect/job/inspectJob",
"index": 1,
},
{
"name": "采购退货任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/purchaseReturn/job/returnJob",
"index": 2,
},
{
"name": "采购退货记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/purchaseReturn/record/returnRecord",
"index": 3,
},
{
"name": "采购上架任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/job/putawayJob",
"index": 3,
},
{
"name": "采购上架记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/record/putawayRecord",
"index": 3,
},
{
"name": "发料任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/issue/job/issueJob",
"index": 4,
},
{
"name": "直接发料",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/issue/record/issueRecord",
"index": 5,
},
{
"name": "生产收料任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReceipt/job/productionReceiptJob",
"index": 5,
},
{
"name": "生产收料记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReceipt/record/productionReceiptRecord",
"index": 5,
},
{
"name": "生产退料任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReturn/job/returnJob",
"index": 6,
},
{
"name": "生产合格退料",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReturn/record/returnToStore",
"index": 7,
},
{
"name": "生产隔离退料",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReturn/record/returnToHold",
"index": 8,
},
]
},
{
"name": "库存管理",
"children": [{
"name": "库存转移任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/inventoryMove/job/inventoryMoveJob",
"index": 8,
}, {
"name": "库存转移",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/inventoryMove/record/moveFree",
"index": 8,
},
{
"name": "合格转隔离",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/inventoryMove/record/moveOkToHold",
"index": 8,
},
{
"name": "隔离转合格",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/inventoryMove/record/moveHoldToOk",
"index": 8,
},
{
"name": "盘点任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/count/job/countJob",
"index": 8,
},
{
"name": "库位盘点",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/count/record/countRecord",
"index": 8,
},
{
"name": "计划外入库任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/job/receiptJob",
"index": 8,
},
{
"name": "计划外出库任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/job/issueJob",
"index": 8,
},
{
"name": "计划外入库记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/record/receiptRecord",
"index": 8,
},
{
"name": "计划外出库记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/record/issueRecord",
"index": 8,
},
{
"name": "报废出库\n(记录)",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/scrap/record/scrapRecord",
"index": 8,
},
]
},
{
"name": "制品管理",
"children": [{
"name": "制品收货任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/productReceipt/job/productReceiptJob',
"index": 1,
},
{
"name": "制品收货记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/productReceipt/record/productReceiptRecord',
"index": 1,
},
{
"name": "制品上架任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/productPutaway/job/productPutawayJob',
"index": 1,
},
{
"name": "制品上架记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/productPutaway/record/productPutawayRecord',
"index": 1,
},
{
"name": "制品发货任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/deliver/job/deliverJob',
"index": 1,
},
{
"name": "制品发货记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/deliver/record/deliverRecord',
"index": 1,
},
{
"name": "客户退货任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/customerReturn/job/returnJob',
"index": 1,
},
{
"name": "客户退货记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": '/pages/customerReturn/record/returnRecord',
"index": 1,
},
{
"name": "调拨接收任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/transfer/job/receiptJob",
"index": 8,
},
{
"name": "调拨接收记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/transfer/record/receiptRecord",
"index": 8,
},
{
"name": "调拨发出任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/transfer/job/issueJob",
"index": 8,
},
{
"name": "调拨发出记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/transfer/record/issueRecord",
"index": 8,
},
]
},
{
"name": "器具管理",
"children": [{
"name": "托盘绑定",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/pallet/record/bindPalletRecord",
"index": 8,
},
{
"name": "托盘解绑",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/pallet/record/unBindPalletRecord",
"index": 8,
},
{
"name": "拆包",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/package/record/splitPackageRecord",
"index": 8,
},
{
"name": "合包",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/package/record/mergePackageRecord",
"index": 8,
},
{
"name": "翻包",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/package/record/overPackageRecord",
"index": 8,
},
]
},
{
"name": "申请(原料)",
"children": [{
"name": "发料申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/issue/request/issueRequest",
"index": 8,
},
{
"name": "采购退货申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/purchaseReturn/request/returnRequest",
"index": 8,
},
{
"name": "采购上架申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/request/putawayRequest",
"index": 8,
},
{
"name": "生产退料合格申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReturn/request/returnToStoreRequest",
"index": 8,
},
{
"name": "生产退料隔离申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productionReturn/request/returnToHoldRequest",
"index": 8,
},
{
"name": "制品上架申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/productPutaway/request/putawayRequest",
"index": 8,
},
{
"name": "成品发货申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/deliver/request/deliverRequest",
"index": 8,
},
{
"name": "客户退货申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/customerReturn/request/customerReturnRequest",
"index": 8,
},
{
"name": "计划外入库申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/request/receiptRequest",
"index": 8,
},
{
"name": "计划外出库申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/unPlanned/request/issueRequest",
"index": 8,
},
{
"name": "报废出库申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/scrap/request/scrapRrequest",
"index": 8,
}
]
}
]

42
common/commit.js

@ -1,42 +0,0 @@
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;
}
}

33
common/common.js

@ -1,33 +0,0 @@
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;
},
}
}

26
common/config.js

@ -1,26 +0,0 @@
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
}

97
common/graceChecker.js

@ -1,97 +0,0 @@
/**
数据验证表单验证
来自 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);
}
}

352
common/html-parser.js

@ -1,352 +0,0 @@
/*
* 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;

58
common/initModal.js

@ -1,58 +0,0 @@
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;
}
}
}

194
common/label.js

@ -1,194 +0,0 @@
let labelDic = [];
import {
getLabelByHeader,
getPackageByNumber
} from '@/api/request2.js';
import {
checkDirectoryItemExist,
getDirectoryItemArray
} from '@/common/directory.js';
export function getLabelInfo(scanMsg,headerType, callBack) {
console.log('扫描信息:', scanMsg);
if (scanMsg.length == 0) {
return null
}
let items = scanMsg.split(';');
let header = items[0];
let version = items[1];
if ((header != undefined) && (version!=undefined)) {
var hearList =getDirectoryItemArray(headerType)
if(!checkDirectoryItemExist(hearList,header)){
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '请输入'+headerType+"开始的标签",
}
callBack(labelResult);
return;
}
//解析扫描的是一维码还是二维码
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);
}
}else {
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '标签格式不正确',
}
callBack(labelResult);
}
}
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: {},
success: true,
message: ''
}
getLabelByHeader(header, version).then(res => {
if (res.data==null) {
labelResult.success = 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.success = 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.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
} else {
labelResult.package = pack.data.list[0];
console.log('包装信息', JSON.stringify(labelResult.package))
}
callBack(labelResult);
}).catch(err => {
labelResult.success = false;
labelResult.message = err;
callBack(labelResult);
})
} else {
labelResult.success = false;
labelResult.message = '在条码中未解析到箱码';
callBack(labelResult);
}
} else {
callBack(labelResult);
}
}
export function analysisQRCodeLabel(labelItem, scanMsg) {
let labelResult = {
label: {
labelType: labelItem.label.labelType,
barType: 'QRCode',
},
package: {},
success: true,
message: ''
}
let separators = labelItem.label.separators;
if (separators == undefined || separators == null) {
labelResult.message = "未读取到分隔符";
} else {
if (scanMsg.indexOf(separators) < 0) {
labelResult.success = 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,
success: true,
message: '',
}
callBack(labelResult);
}

112
common/message.js

@ -1,112 +0,0 @@
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
}

5
common/modelConfig.js

@ -1,5 +0,0 @@
let maxPageSize = 10;
export default{
maxPageSize
}

245
common/permission.js

@ -1,245 +0,0 @@
/// 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

26
common/promise.js

@ -1,26 +0,0 @@
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

123
common/request.js

@ -1,123 +0,0 @@
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。

103
common/request_test.js

@ -1,103 +0,0 @@
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;

309
common/scan.js

@ -1,309 +0,0 @@
//解析扫描信息
//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 供应商批次
//返回结果
//success true:成功 false:失败
//scanType barcode:条码 qrcode:二维码
//isPack true:箱码 false:托码
export function analyseScanInfo(scanMsg) {
let scanResult = {
success: 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.success = 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.success = true;
} else { //扫描的是条码,直接返回接收到的内容
scanResult.success = true;
scanResult.data.code = scanMsg;
scanResult.data.scanType = 'barcode';
}
}
} catch (ex) {
scanResult.success = 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日期
//返回结果
//success true:成功 false:失败
//scanType barcode:条码 qrcode:二维码
//isPack true:箱码 false:托码
export function analyseProductLabelInfo(scanMsg) {
let scanResult = {
success: 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.success = 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.success = false;
scanResult.message = "无法识别的前缀" + type;
break;
}
scanResult.success = true;
} else {
scanResult.success = false;
scanResult.message = "标签信息不能为空" + type;
}
}
})
} else { //扫描的是条码,直接返回接收到的内容
scanResult.success = false;
scanResult.message = "标签分隔符错误";
}
}
} catch (ex) {
scanResult.success = 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 = {
success: false,
message: "",
items: []
};
if (scanMsg == "") {
scanResult.message = "扫描到的内容为空";
} else {
try {
if (scanMsg.indexOf(':') < 0) {
scanResult.success = 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.success = false;
scanResult.message = "标签信息不能为空";
}
})
scanResult.success = true;
} else { //扫描的是条码,直接返回接收到的内容
scanResult.success = false;
scanResult.message = "标签分隔符错误";
}
}
} catch (ex) {
scanResult.success = false;
scanResult.message = "解析遇到异常" + ex.message;
}
}
return scanResult;
}

0
common/storage.js

2749
common/style/new_style.css

File diff suppressed because it is too large

762
common/style/pdabasic.css

@ -1,762 +0,0 @@
/*
.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;
}
.location_hold {
background-color: #FF8C00;
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:5rpx 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%;
/* background-color: #fff; */
}
.page-header {
background-color: #fff;
font-size: 35rpx;
padding: 10rpx 20rpx;
}
.page-header .header_item {
/* padding-left: 10rpx; */
padding: 5rpx 10rpx;
font-size:32rpx ;
}
.page-header .header_job_top {
padding:5rpx 0rpx;
}
.page-main {
flex: 1;
position: relative;
background: #fff;
}
.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;
}

136
common/uni-nvue.css

@ -1,136 +0,0 @@
/* #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;
}

30
config.js

@ -1,30 +0,0 @@
// 应用全局配置
const config = {
//baseUrl: 'https://vue.ruoyi.vip/prod-api',
//cloud后台网关地址
baseUrl: 'http://dev.ccwin-in.com:25100/api',
baseApi: '/admin-api',
// 应用信息
appInfo: {
// 应用名称
name: "ruoyi-app-vue3",
// 应用版本
version: "1.1.0",
// 应用logo
logo: "/static/logo.png",
// 官方网站
site_url: "http://ruoyi.vip",
// 政策协议
agreements: [{
title: "隐私政策",
url: "https://ruoyi.vip/protocol.html"
},
{
title: "用户服务协议",
url: "https://ruoyi.vip/protocol.html"
}
]
}
}
export default config

4
index.html

@ -12,9 +12,11 @@
<title></title>
<!--preload-links-->
<!--app-context-->
<!-- 配置H5的 web图标static/logo.png -->
<link rel="icon" href="../../static/logo.png" />
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<script type="module" src="/src/main.js"></script>
</body>
</html>

23
libs/versionUpdate.js

@ -1,23 +0,0 @@
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
}

87
main.js

@ -1,87 +0,0 @@
import App from './App'
import store from './store'
import './router/my_router.js'; //引入拦截
import VueClipboard from 'vue-clipboard2'
// 引入 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.prototype.$store = store
Vue.prototype.$adpid = "1111111111"
Vue.prototype.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
App.mpType = 'app'
const app = new Vue({
store,
...App
})
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;
getApp().globalData.isDevelopment = res.data.baseInfo.isDevelopment.value
}
},
fail: (error) => {
}
})
return {
startApp
};
}
// #endif

210
manifest.json

@ -1,210 +0,0 @@
{
"name" : "pda_vue_3.0",
"appid" : "__UNI__43932FE",
"description" : "应用描述",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"nvueLaunchMode" : "fast",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {
"OAuth" : {},
"Payment" : {},
"Push" : {},
"Share" : {},
"Speech" : {},
"VideoPlayer" : {}
},
"distribute" : {
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<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_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<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_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_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.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<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" : {
"UIBackgroundModes" : [ "audio" ],
"urlschemewhitelist" : [ "baidumap", "iosamap" ]
},
"sdkConfigs" : {
"speech" : {
"ifly" : {}
}
},
"orientation" : [ "portrait-primary" ]
},
"uniStatistics" : {
"enable" : true
}
},
"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" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "演示定位能力"
}
},
"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
}
},
"h5" : {
"router" : {
"mode" : "hash"
},
"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
}
}

122
mycomponents/balance/balance.vue

@ -1,122 +0,0 @@
<template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; ">
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
<to-location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode">
</to-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="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</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 toLocation from '@/mycomponents/balance/toLocation.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,
toLocation,
batch,
qty,
recommendQty,
compareQty,
},
data() {
return {
}
},
props: {
dataContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
},
watch: {
},
methods: {
copy() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" +
this.dataContent.batch + ";Q" + this.dataContent.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.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" +
this.dataContent.batch + ";Q" + this.dataContent.qty
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
)
},
isDevlement() {
return getApp().globalData.isDevelopment;
}
}
}
</script>
<style>
</style>

164
mycomponents/detail/comDetailCard.vue

@ -1,164 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
</template>
<u-line></u-line>
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowToLocation="false">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
emits: ['openDetail', "updateData"],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
comMessage,
winScanLocation
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
locationTypeList: {
type: Array,
default: []
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
showItem: {},
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
</script>
<style>
</style>

153
mycomponents/detail/comRequestDetailCard.vue

@ -1,153 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<!-- <comReturnRequestInfo :workShopCode="dataContent.workshopCode" :dataContent="requestItem">
</comReturnRequestInfo> -->
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty
:dataContent="dataContent"
:handleQty="Number(dataContent.handleQty)"
:isShowStdPack="false">
</item-compare-qty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestInfo from '@/pages/productionReturn/coms/comReturnRequestInfo.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
export default {
emits: ['openDetail'],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
comMessage,
comReturnRequestInfo
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
},
watch: {
dataContent(newVal) {
var test =this.dataContent
this.requestItem = newVal.subList[0];
},
},
data() {
return {
option: [],
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: [],
requestItem:{}
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

148
mycomponents/job/jobcomDetailCard.vue

@ -1,148 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)">
</item-compare-qty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
export default {
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
comMessage,
jobDetailPopup,
batch
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
jobType: {
type: String,
default: ""
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

267
mycomponents/qty/CountQtyEdit.vue

@ -1,267 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeEditPopup"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; height:60%;">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between padding title ">
<text>标包个数 : </text>
<view class="uni-flex uni-row u-col-center">
<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount" :focus="false">
</uni-number-box>
<view class="std_pack">
{{getStdPackUnitInfo(dataContent.stdPackUnit)}}
</view>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>标包量 : </text>
<view class="uni-flex u-col-center uni-row">
<text>{{Number(dataContent.stdPackQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@mousedown="mousedown" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view v-if="isShowBalance"
class="uni-flex uni-row space-between padding title u-col-center">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view v-if="isShowStatus" class="uni-flex uni-row space-between title"
style="align-items: center; padding-left: 30rpx;">
<text>库存状态 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<balanceStatus ref="balanceStatus" :status="inventoryStatus" :allowEdit='true'
@updateStatus="updateStatus" @onOpen="clickState">
</balanceStatus>
</view>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button v-if="showConfirmCountdown" class="btn_edit_big_confirm" hover-class="btn_edit_big_after"
@click="confirm()">确认({{seconds}}s关闭)</button>
<button v-else class="btn_edit_big_confirm" hover-class="btn_edit_big_after"
@click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getStdPackUnitInfo
} from "@/common/directory.js"
import {
getInventoryStatusName
} from '@/common/directory.js';
export default {
components: {
uom,
balanceStatus,
comMessage
},
data() {
return {
allQty: 0,
stdCount: 0,
stateData: 0,
balanceQty: 0,
inventoryStatus: "",
dataContent: {},
handleQty: 0,
seconds: 0,
timer: {},
showConfirmCountdown: false,
detailList: [],
maxlength: 10,
mode: 'add' //add edit
}
},
watch: {
},
created() {
},
props: {
title: {
type: String,
default: "编辑数量"
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: true
},
isShowBalance: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
//
openEditPopup(item, detailList) {
this.initData(item, detailList);
// this.dataContent = item
// this.inventoryStatus = this.dataContent.inventoryStatus;
// this.allQty = Number(this.dataContent.qty)
// this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty);
// this.detailList = detailList
this.showConfirmCountdown = false;
this.mode = 'edit';
this.$refs.popup.open('bottom')
clearInterval(this.timer)
},
//
openEditPopupShowSeconds(item, detailList) {
this.initData(item, detailList);
this.showConfirmCountdown = true;
this.mode = 'add';
this.$refs.popup.open('bottom')
this.startTimer()
},
initData(item, detailList) {
this.dataContent = item;
this.inventoryStatus = this.dataContent.inventoryStatus;
this.allQty = Number(this.dataContent.handleQty);
this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty);
this.detailList = detailList;
},
mousedown() {
this.showConfirmCountdown = false;
clearInterval(this.timer)
},
clickState() {
this.showConfirmCountdown = false;
clearInterval(this.timer)
},
closeEditPopup() {
clearInterval(this.timer)
this.$emit("close");
this.$refs.popup.close()
},
confirm() {
this.setValue();
},
cancel() {
this.closeEditPopup();
},
startTimer() {
this.seconds = 3;
clearInterval(this.timer)
this.timer = setInterval(() => {
this.seconds--
if (this.seconds <= 0) {
this.confirm();
// this.cancel()
return
}
}, 1000)
},
calcQty(val) {
if (val > 0) {
this.allQty = val * Number(this.dataContent.stdPackQty);
}
},
setValue() {
this.dataContent.handleQty = Number(this.allQty)
this.$emit("confirm", Number(this.allQty), this.inventoryStatus, this.mode);
this.closeEditPopup();
},
updateStatus(value) {
this.inventoryStatus = value
},
getStdPackUnitInfo(value) {
return getStdPackUnitInfo(value).name
}
}
}
</script>
<style lang="scss">
.uni-popup .uni-popup__wrapper {
width: 100% !important;
padding: 30rpx;
}
.hide_border {
button {
border: none;
}
button::after {
border: none;
}
}
.title {
font-size: 30rpx;
}
</style>

219
mycomponents/qty/balanceQtyEdit.vue

@ -1,219 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeEditPopup"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; height:60%;">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between padding title ">
<text>标包个数 : </text>
<view class="uni-flex uni-row u-col-center">
<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount">
</uni-number-box>
<std-uom :uom="dataContent.stdPackUnit"></std-uom>
<!-- <uom :uom="dataContent.stdPackUnit"></uom> -->
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>标包量 : </text>
<view class="uni-flex u-col-center uni-row">
<text>{{Number(dataContent.stdPackQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@confirm="confirm()" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view v-if="isShowStatus" class="uni-flex uni-row space-between title u-col-center"
style="padding-left: 30rpx;">
<text>库存状态 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<balanceStatus ref="balanceStatus" :status="inventoryStatus"
:allowEdit='allowEditStatus' @updateStatus="updateStatus">
</balanceStatus>
</view>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
uom,
StdUom,
balanceStatus,
comMessage
},
data() {
return {
allQty: 0,
stdCount: 0,
stateData: 0,
balanceQty: 0,
inventoryStatus: "",
originalInventoryStatus: "",
dataContent: {},
handleQty: 0,
maxlength: 10
}
},
watch: {
},
created() {
},
props: {
title: {
type: String,
default: "编辑数量"
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
}
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup(item, handleQty) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
this.originalInventoryStatus =this.dataContent.inventoryStatus;
this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = handleQty
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
},
closeEditPopup() {
this.$refs.popup.close()
},
confirm() {
this.setValue();
},
cancel() {
this.dataContent.inventoryStatus = this.originalInventoryStatus;
this.closeEditPopup();
},
calcQty(val) {
if (val > 0) {
this.allQty = val * Number(this.dataContent.stdPackQty);
}
},
setValue() {
var balanceQty = Number(this.dataContent.balanceQty);
if (this.allQty == 0) {
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0',
res => {
this.allQty = balanceQty;
})
} else if (this.allQty > balanceQty) {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']',
res => {
this.allQty = balanceQty;
})
} else {
this.callback();
}
},
callback() {
let qty = Number(this.allQty);
this.dataContent.handleQty = qty;
if (this.allowEditStatus) //,
{
this.dataContent.toInventoryStatus = this.inventoryStatus;
}
this.$emit("confirm", qty);
this.closeEditPopup();
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
}
}
}
</script>
<style lang="scss">
.uni-popup .uni-popup__wrapper {
width: 100% !important;
padding: 30rpx;
}
.hide_border {
button {
border: none;
}
button::after {
border: none;
}
}
.title {
font-size: 30rpx;
}
</style>

198
mycomponents/qty/inspectQtyEdit.vue

@ -1,198 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeEditPopup"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; height:60%;">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@confirm="confirm()" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>不合格数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="FailedQty" :focus="true" type="number"
@confirm="confirm()" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row u-col-center" style="width: 100%;">
<view class=""
style=" text-align: center;font-size: 32rpx;font-weight: 700;margin-left: 20rpx;">
不合格原因 :
</view>
<uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker'
placeholder="请选择原因" popup-title="选择不合格原因" :localdata="reasonList" v-model="reason">
</uni-data-picker>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInspectReasonList
} from '@/common/directory.js';
export default {
components: {
uom,
StdUom,
balanceStatus,
comMessage
},
data() {
return {
allQty: 0,
stdCount: 1,
stateData: 0,
balanceQty: 0,
inventoryStatus: "",
originalInventoryStatus: "",
dataContent: {},
handleQty: 0,
FailedQty: 0,
reasonList: [],
reason: ""
}
},
watch: {
},
created() {
this.reasonList = getInspectReasonList();
},
props: {
title: {
type: String,
default: "编辑数量"
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
}
},
methods: {
openEditPopup(item, handleQty) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty)
this.FailedQty = Number(item.FailedQty)
this.$refs.popup.open('bottom')
},
closeEditPopup() {
this.$refs.popup.close()
},
confirm() {
this.setValue();
},
cancel() {
this.dataContent.inventoryStatus = this.originalInventoryStatus;
this.closeEditPopup();
},
calcQty(val) {
this.allQty = val * Number(this.dataContent.stdPackQty);
},
setValue() {
var balanceQty = Number(this.dataContent.qty);
if (this.allQty == 0) {
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0',
res => {
this.allQty = balanceQty;
})
} else if (this.allQty > balanceQty) {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']',
res => {
this.allQty = balanceQty;
})
} else {
this.callback();
}
},
callback() {
var reasonInfo = this.reasonList.find(res => {
if (res.value == this.reason) {
return res
}
})
if (reasonInfo == undefined) {
reasonInfo = {
text: "",
value: ""
}
}
this.dataContent.toInventoryStatus = this.inventoryStatus
this.$emit("confirm", Number(this.allQty), Number(this.FailedQty), reasonInfo);
this.closeEditPopup();
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
}
}
}
</script>
<style lang="scss">
.uni-popup .uni-popup__wrapper {
width: 100% !important;
padding: 30rpx;
}
.hide_border {
button {
border: none;
}
button::after {
border: none;
}
}
.title {
font-size: 30rpx;
}
</style>

225
mycomponents/qty/recommendQtyEdit.vue

@ -1,225 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeEditPopup"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; height:60%;">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between padding title ">
<text>标包个数 : </text>
<view class="uni-flex uni-row u-col-center">
<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount">
</uni-number-box>
<std-uom :uom="dataContent.stdPackUnit"></std-uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>标包量 : </text>
<view class="uni-flex u-col-center uni-row">
<text>{{Number(dataContent.stdPackQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>总数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="false" type="number"
@input="checkNum" @confirm="confirm()" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
import stdUom from '@/mycomponents/qty/stdUom.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
uom,
stdUom,
comMessage
},
data() {
return {
allQty: 0,
stdCount: 0,
labelQty: 0,
recommendQty: 0,
maxlength: 10
}
},
watch: {
// handleQty: {
// handler(newval, oldval) {
// this.allQty = Number(this.handleQty)
// },
// immediate: true,
// deep: true
// }
},
created() {
},
props: {
title: {
type: String,
default: "编辑数量"
},
dataContent: {
type: Object,
default: {}
},
handleQty: {
type: Number,
default: 0
},
settingParam: {
type: Object,
default: {}
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup() {
this.$refs.popup.open('bottom')
},
openTaskEditPopup(recommendQty, handleQty, labelQty) {
this.recommendQty = Number(recommendQty);
this.labelQty = Number(labelQty);
this.allQty = Number(handleQty)
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
},
openRecordEditPopup(labelQty) {
this.recommendQty = 0;
this.labelQty = Number(labelQty);
this.allQty = Number(labelQty)
this.$refs.popup.open('bottom')
},
closeEditPopup() {
this.$refs.popup.close()
},
confirm() {
this.setValue();
},
cancel() {
this.closeEditPopup();
},
calcQty(val) {
if (val > 0) {
this.allQty = val * this.dataContent.stdPackQty;
}
},
setValue() {
// var recommendQty = Number(this.dataContent.qty);
// var labelQty = Number(this.dataContent.record.label.qty);
if (this.allQty > this.labelQty) {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于标签数量[' +
this.labelQty +
']',
res => {
this.allQty = this.labelQty;
})
} else {
if (this.recommendQty != 0) {
if (this.allQty > this.recommendQty) {
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty ==
"TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' +
this.recommendQty +
']',
res => {
this.allQty = this.labelQty;
})
}
} else if (this.allQty < this.recommendQty) {
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty ==
"TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' +
this.recommendQty +
']',
res => {
this.allQty = this.labelQty;
})
}
} else {
this.callback();
}
} else {
this.callback();
}
}
},
callback() {
this.$emit("confirm", Number(this.allQty));
this.closeEditPopup();
}
}
}
</script>
<style lang="scss">
.uni-popup .uni-popup__wrapper {
width: 100% !important;
padding: 30rpx;
}
.hide_border {
button {
border: none;
}
button::after {
border: none;
}
}
.title {
font-size: 30rpx;
}
</style>

133
mycomponents/recommend/recommend.vue

@ -1,133 +0,0 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;">
<view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;">
<container v-if="isShowContainer&&detail.containerNumber!=''" :container="detail.containerNumber"></container>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
</location>
<!-- <to-location></to-location> -->
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode">
</to-location>
</view>
<view style="word-break: break-all;">
<!-- ||detail.handleQty==0 可能会有扫描到0的情况-->
<recommend-qty v-if="detail.handleQty==null || detail.handleQty==undefined" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number(detail.qty)"
:handleQty="Number(detail.handleQty)" :isShowStdPack="false">
</compare-qty>
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view>
</view>
</view>
</view>
</template>
<script>
import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.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: {
container,
pack,
location,
toLocation,
batch,
recommendQty,
compareQty
},
data() {
return {
}
},
props: {
detail: {
type: Object,
default: {}
},
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
isShowStatus: {
type: Boolean,
default: true
},
locationTitle: {
type: String,
default: '库位'
},
},
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'
})
}
)
},
isDevlement() {
return getApp().globalData.isDevelopment;
}
}
}
</script>
<style>
</style>

121
mycomponents/recommend/recommendCount.vue

@ -1,121 +0,0 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="uni-flex uni-row space-between ">
<!-- uni-inline-item 暂时拿掉-->
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
</location>
<location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode">
</location>
</view>
<view class="uni-flex uni-row center">
<!-- <recommend-qty v-if="detail.handleQty==null || detail.handleQty==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty> -->
<!-- {{detail.scaned}} -->
<compare-qty :dataContent="detail" :recommendQty="Number(detail.qty)"
:isShowRecommendQty="isShowRecommendQty" :isShowStatus="isShowRecommendQty || detail.scaned==true"
:handleQty="Number(detail.handleQty)" :isShowStdPack="false">
</compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view>
</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
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationTitle: {
type: String,
default: '库位'
},
isShowRecommendQty: {
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'
})
}
)
},
isDevlement() {
return getApp().globalData.isDevelopment;
}
}
}
</script>
<style>
</style>

181
mycomponents/record/recordComDetailCard.vue

@ -1,181 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true" :isShowBalanceQty="isShowBalanceQty"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<!-- <u-line /> -->
<view class="" v-for="(detail,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
:right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation">
</balance>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <u-line /> -->
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<!-- <balance-detail-popup ref="balanceDetailPopup"></balance-detail-popup> -->
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
// import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import location from '@/mycomponents/balance/location.vue'
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
balance,
balanceQtyEdit,
balanceDetailPopup,
purchaseLabel,
comMessage,
location,
recordDetailPopup
// winListHint
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: false
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
},
isShowBalanceQty: {
type: Boolean,
default: false
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty);
},
detail(item) {
this.showItem = item;
this.$refs.recordDetailPopup.openPopup(item);
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
// this.editItem.qty = qty;
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

243
mycomponents/scan/winComScan.vue

@ -1,243 +0,0 @@
<!--扫描组件-->
<template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view>
<view class="pop_tab">
<view class="tab_info">
<view class="conbox">
<textarea v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:focus="boxfocus" :placeholder="placeholderValue" @focus="getfocus" @blur="losefocus"
@input="handelScanMsg" :cursor="cursorIndex"></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center">
<!-- <view class="paizhao" @click="scanQRCode()" v-if="true">
<image src="/static/icons/icons_camera.svg" alt="" />
</view> -->
<view class="uni-flex">
<button class="clean_scan_btn" @click="clearScanValue()">清空</button>
<button class="scan_btn" @click="clickScanMsg()">扫描</button>
</view>
</view>
</view>
<view style="width: 100%;">
<view style="width: 100%;" v-if="scanList.length>0&&isShowHistory">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
</view>
<view class="" style="padding-right: 10rpx;">
<u-icon :name="expendIcon" size="35rpx" @click="expands()"></u-icon>
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line>
<scroll-view scroll-y="true" class="scroll-view" v-if="expand&&scanList.length>0"
style="height: 70px;">
<view class="uni-flex u-col" v-for="(item,index) in scanList">
<view style="width: 100%;max-height: 100px;">
<view class="uni-flex u-row space-between u-col-center" @click="showItem(item)">
<view class="text_ellipsis" style="padding: 15rpx;">
{{item}}
</view>
<view class="">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<u-line class='line_color'></u-line>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script module="input" lang="renderjs">
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getLabelInfo
} from '@/common/label.js';
export default {
name: "winComScan",
emits: ["getResult"],
components: {
comMessage
},
props: {
placeholder: {
type: String,
default: '请扫描标签'
},
clearResult: {
type: Boolean,
default: true
},
boxFocus: {
type: Boolean,
default: true
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ' //HLB HMQ HCQ HPQ
}
},
data() {
return {
// scanMsg: "HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q100",
scanMsg: "",
boxfocus: true,
placeholderValue: '',
scanResult: {},
scanList: [],
expand: true,
expendIcon: 'arrow-down',
cursorIndex: 0
}
},
mounted() {
if (document.querySelector('textarea') != null) {
document.querySelector('textarea').setAttribute('inputmode', 'none')
}
// if (this.$el.querySelector('textarea') != null) {
// this.$el.querySelector('textarea').setAttribute('inputmode', 'none')
// }
},
watch: {
placeholder() {
this.placeholderValue = '请扫描' + this.placeholder;
}
},
created() {
this.placeholderValue = '请扫描' + this.placeholder;
},
methods: {
getValue() {
return this.scanMsg
},
setValue(val) {
this.scanMsg = val
},
clearScanValue() {
this.scanMsg = ''
this.getfocus();
},
clickScanMsg() {
this.scanMsg = this.scanMsg + "\n";
this.handelScanMsg();
},
handelScanMsg() {
//
// uni.showLoading({
// title: '...',
// mask: true
// })
let that = this;
let index = that.scanMsg.indexOf('\n');
if (index >= 0) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => {
that.losefocus();
let content = uni.$u.trim(that.scanMsg)
if (content == "") {
that.getfocus();
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => {
if (res) {
that.scanMsg=""
that.getfocus();
}
})
return;
}
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
if (scanResult.success) {
that.clear();
// that.getfocus();//
that.$emit("getResult", scanResult);
} else {
that.clear();
this.$refs.comMessage.showErrorMessage(scanResult.message, res => {
if (res) {
that.getfocus();
}
})
}
});
}, 500);
}
},
getfocus() {
let that = this;
that.boxfocus = true;
this.$nextTick(r => {
that.boxfocus = true;
});
},
losefocus() {
let that = this;
that.boxfocus = false;
this.$nextTick(r => {
that.boxfocus = false;
});
},
clear() {
this.cursorIndex = 0;
this.scanMsg = ''
},
iconClick(type) {
this.$emit("clearResult", this.scanMsgk);
},
expands() {
this.expand = !this.expand;
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up"
},
scanClick() {
this.handelScanMsg();
},
cancelClick() {
this.clear();
this.getfocus();
},
showItem(item) {
this.$refs.comMessage.showMessage(item, res => {
if (res) {
// this.$refs.modal.cancelClose();
}
})
},
scanQRCode() {
let that = this;
uni.scanCode({
onlyFromCamera: true,
success: (res) => {
that.scanMsg = res.result;
that.$emit("getResult", res.result);
console.log('扫描二维码成功,结果:' + res.result);
},
fail: (res) => {
that.showItem('扫描出现错误:' + res.result);
console.log('扫描出现错误:' + res.result);
}
});
}
}
}
</script>
<style scoped lang="scss">
</style>

119
mycomponents/scan/winScanContainer.vue

@ -1,119 +0,0 @@
<template>
<uni-popup ref="popup" :maskClick='false'>
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view>
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()">
</image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" headerType='HCQ' @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
getContainerByNumber
} from '@/api/request2.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
winComScan,
comMessage
},
emits: ["getContainer"],
props: {
title: {
type: String,
default: '器具'
},
isShowHistory: {
type: Boolean,
default: false
}
},
data() {
return {
code: '',
containerInfo: {}
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
},
closeScanPopup() {
this.$refs.popup.close()
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
});
let label = result.label;
this.code = label.container;
getContainerByNumber(this.code).then(res => {
uni.hideLoading();
if (res.data.list.length > 0) {
this.containerInfo = res.data.list[0];
if (this.containerInfo.containerStatus == 'USED') {
this.callBack();
} else {
this.showErrorMessage("器具[" + this.code + "]状态是[" + this.containerInfo.status + "],不可以绑定")
}
} else {
this.showErrorMessage("未查找到器具[" + this.code + "]")
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
callBack() {
this.closeScanPopup();
this.$emit("getContainer", this.containerInfo);
},
getfocus() {
this.$refs.scan.getfocus();
},
losefocus() {
this.$refs.scan.losefocus();
},
showErrorMessage(message) {
setTimeout(r => {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
})
}
}
}
</script>
<style>
</style>

173
mycomponents/scan/winScanItem.vue

@ -1,173 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup" @change="change">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="">
扫描{{title}}
</view>
<view class="">
<image class=" icons_scan_close" src="@/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
headerType="HMQ,HPQ">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getBasicItemByCode
} from '@/api/request2.js';
import {
checkDirectoryItemExist,
getListItemTypeDesc,
getItemTypeInfo
} from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
name: 'winScanItem',
components: {
winComScan,
comMessage
},
emits: ["getScanCode", 'getScanResult'],
props: {
title: {
type: String,
default: ''
},
isShowRecord: {
type: Boolean,
default: true
},
itemCodeTypeList: {
type: Array,
default: []
},
},
data() {
return {
code: '',
result: {},
isShow: false,
expand: false,
scanList: [],
expendIcon: 'arrow-down'
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
},
closeScanPopup() {
this.$refs.popup.close()
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
});
var scanResult = result;
if (scanResult.label.barType == "QRCode") {
this.code = scanResult.label.itemCode;
} else if (scanResult.label.barType == "BarCode") {
this.code = scanResult.label.code;
}
if (this.code == undefined) {
uni.hideLoading();
this.showErrorMessage("扫描物料[" + this.code + "]为空,请输入正确的物料")
return
}
getBasicItemByCode(this.code).then(res => {
uni.hideLoading();
if (res.data != null && res.data.list.length > 0) {
var result =res.data.list[0];
var status =result.status;
var type = result.type;
var itemCode = result.code
var itemName =result.name
var uom = result.uom
var std = result.uom
result.package = scanResult.package
if(status=="ENABLE"){
if(checkDirectoryItemExist(this.itemCodeTypeList,type)){
this.result =result;
this.callBack()
}else {
var hint = getListItemTypeDesc(this.itemCodeTypeList);
this.showErrorMessage("扫描物料[" + this.code + "]是[" +
getItemTypeInfo(type).label + "],需要的物料类型是[" + hint + "]")
}
}else {
this.showErrorMessage('物料【' + this.code + '】不可用');
}
} else {
this.showErrorMessage('未查找到物料【' + this.code + '】');
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
callBack() {
this.closeScanPopup();
this.$refs.scan.clear();
// this.$emit("getScanCode", this.code);
this.$emit("getScanResult", this.code, this.result);
},
change(e) {
this.isShow = e.show
},
showErrorMessage(message) {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
},
getfocus() {
this.$refs.scan.getfocus();
},
losefocus() {
this.$refs.scan.losefocus();
},
}
}
</script>
<style>
</style>

163
mycomponents/scan/winScanLocation.vue

@ -1,163 +0,0 @@
<template>
<uni-popup ref="popup" :maskClick='false'>
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view>
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()">
</image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory" headerType="HLB">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
getBasicLocationByCode,
} from '@/api/request2.js';
import {
getLocationTypeName,
getListLocationTypeDesc,
checkDirectoryItemExist
} from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
winComScan,
comMessage
},
emits: ["getLocation"],
props: {
title: {
type: String,
default: ''
},
locationTypeList: {
type: Array,
default: []
},
isShowHistory: {
type: Boolean,
default: false
}
},
data() {
return {
code: '',
location: {}
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
},
closeScanPopup() {
this.$refs.popup.close()
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
});
let label = result.label;
if (label.barType === 'QRCode') {
this.code = label.locationCode;
} else if (label.barType === 'BarCode') {
this.code = label.code;
}
if(this.code==undefined){
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.code + "]为空,请输入正确的库位")
return
}
getBasicLocationByCode(this.code).then(res => {
uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
if (checkDirectoryItemExist(this.locationTypeList, type)) {
this.location = result;
this.callBack();
} else {
var hint = getListLocationTypeDesc(this.locationTypeList);
this.showErrorMessage("扫描库位[" + this.code + "]是[" +
getLocationTypeName(type) + "],需要的库位类型是[" + hint + "]")
}
} else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用")
}
} else {
this.showErrorMessage('未查询到库位[' + this.code + ']')
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
callBack() {
this.closeScanPopup();
this.$emit("getLocation", this.location, this.code);
},
checkLocationType(type) {
var isPass = false;
if (this.locationTypeList.length == 0) {
isPass = true;
} else {
var temp = this.locationTypeList.filter(res => {
if (res == type) {
return res
}
})
if (temp != undefined && temp.length > 0) {
isPass = true
}
}
return isPass
},
getfocus() {
this.$refs.scan.getfocus();
},
losefocus() {
this.$refs.scan.losefocus();
},
showErrorMessage(message) {
setTimeout(r => {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
})
}
}
}
</script>
<style>
</style>

116
mycomponents/scan/winScanPack.vue

@ -1,116 +0,0 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<com-message ref="comMessage" @afterClose="getfocus"></com-message>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInventoryLabel
} from '@/api/index.js';
export default {
name: 'winScanPack',
components: {
winComScan,
comMessage
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType:{
type: String,
default: 'HPQ'
}
},
data() {
return {
show: false,
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom');
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if (result.success) {
this.$emit("getResult", result);
} else {
this.showMessage(result.message)
}
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

134
mycomponents/scan/winScanPackAndCont.vue

@ -1,134 +0,0 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描 : {{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<com-message ref="comMessage" @afterClose="getfocus"></com-message>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInventoryLabel,
getContainerByNumber
} from '@/api/request2.js';
export default {
name: 'winScanPack',
components: {
winComScan,
comMessage
},
props: {
title: {
type: String,
default: '箱标签或托标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType:{
type: String,
default: 'HPQ,HMQ,HCQ'
}
},
data() {
return {
show: false,
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom');
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if (result.success) {
if(result.label.labelType=="ContainerLabel"){
this.getContainerByNumber(result);
}else {
this.$emit("getResult", result);
}
} else {
this.showMessage(result.message)
}
},
getContainerByNumber(result){
getContainerByNumber(result.label.container).then(res => {
if (res.data.list.length > 0) {
this.$emit("getResult", result);
} else {
this.showMessage('未查找到托码【' + result.label.container + '】');
}
}).catch(error => {
this.showMessage(error);
})
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

451
mycomponents/scan/winScanPackAndLocation.vue

@ -1,451 +0,0 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 8rpx;
height: 30px;">
<view class="uni-center" style="width: 25%; ">
来源库位
</view>
<!-- style="width: 75%;padding: 8rpx" -->
<view class="">
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus"
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> -->
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">
{{fromLocationCode}}
</text>
</view>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
</view>
<com-message ref="comMessage"></com-message>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getBalanceByManagementPrecision,
} from '@/common/balance.js';
import {
getBasicLocationByCode,
} from '@/api/request2.js';
import {
getListLocationTypeDesc,
checkDirectoryItemExist,
getDirectoryItemArray,
getLocationTypeName,
getInventoryStatusDesc
} from '@/common/directory.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close", "getCountScanResult"],
components: {
winComScan,
comMessage,
balanceSelect
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
allowNullBalance: {
type: Boolean,
default: false
},
//
noShowBalanceMessage: {
type: Boolean,
default: false
},
//
allowModifyLocation: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: "HPQ,HMQ"
},
},
data() {
return {
scanResult: {},
show: false,
scanList: [],
expand: false,
showScanResult: {},
expendIcon: 'arrow-down',
fromLocationCode: '',
fromLocation: '',
fromLocationList: [],
fromLocationTypeArray: [],
locationOnFocus: false,
businessType: {},
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses: "",
isCheck:false
}
},
created() {
},
methods: {
//
openScanPopupForType(fromLocationCode, businessType) {
this.businessType = businessType;
this.fromLocationCode = fromLocationCode;
if (fromLocationCode != '') {
this.packGetFocus();
} else {
this.locationGetFocus();
}
this.fromInventoryStatuses = this.businessType.outInventoryStatuses
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //
this.fromLocationTypeArray = getDirectoryItemArray(this.businessType.outLocationTypes); //
this.$refs.popup.open('bottom');
},
//
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) {
this.fromLocationCode = fromLocationCode;
this.fromLocationList = fromLocationList;
if (fromLocationCode != '') {
this.packGetFocus();
} else {
if (this.fromLocationList.length == 0) {
this.locationGetFocus();
} else {
this.fromLocationCode = this.fromLocationList[0];
}
}
this.$refs.popup.open('bottom');
this.fromInventoryStatuses = jobContent.outInventoryStatuses
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
this.fromLocationTypeArray = getDirectoryItemArray(jobContent.fromLocationTypes); //
},
closeScanPopup(content) {
this.$refs.popup.close();
this.$emit("close", '');
},
scanLocation(scanResult) {
var isCheck = false;
if (this.fromLocationCode == '') {
this.showErrorMessage('来源库位不能为空', callback => {
this.locationGetFocus();
})
return;
}
if(this.fromLocationList.length>0){
if(!this.isInLocationList(this.fromLocationCode)){
this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => {
this.locationGetFocus();
})
return;
}
}
uni.showLoading({
title: '扫描中...',
mask: true
});
getBasicLocationByCode(this.fromLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) {
this.location = result;
// this.packGetFocus();
this.checkPackage(scanResult);
} else {
uni.hideLoading();
var hint = getListLocationTypeDesc(this.fromLocationTypeArray);
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" +
getLocationTypeName(type) + ",<br>需要的库位类型是[" + hint + "]", callback => {
this.locationGetFocus();
})
}
} else {
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => {
this.locationGetFocus();
})
}
} else {
uni.hideLoading();
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => {
this.locationGetFocus();
})
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, res => {
this.locationGetFocus();
})
})
},
getScanResult(result) {
// console.log("", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('', callback => {
// this.locationGetFocus();
// })
// return;
// } else
this.scanLocation(result);
// debugger
// if(this.isCheck){
// this.checkPackage(result);
// }
},
checkPackage(result){
if (result.label != null) {
this.scanResult = result;
// uni.showLoading({
// title: '...',
// mask: true
// })
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => {
uni.hideLoading();
if (res.success) {
this.managementPrecision = res.managementPrecision
this.afterQueryBalance(res.data.list);
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
})
}
// uni.hideLoading();
});
}
},
afterQueryBalance(datas) {
if (this.allowNullBalance) {
this.allowNoneBalance(datas);
} else if (this.noShowBalanceMessage) {
this.countCallBack(datas);
} else {
this.mustHavaBalance(datas);
}
uni.hideLoading();
},
//
allowNoneBalance(datas) {
if (datas.length == 0) {
this.packCallBack(null);
} else {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => {
this.packGetFocus();
})
}
},
//
mustHavaBalance(datas) {
if (datas.length == 0) {
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => {
this.packGetFocus();
})
} else if (datas.length == 1) {
let balance = datas[0];
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
// } else {
// this.showErrorMessage(this.getQueryCondition() + '<br>[' + balance.qty + "],<br>",
// res => {
// this.packGetFocus();
// })
// }
} else {
this.showBalanceSelect(datas);
}
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
selectBalanceItem(balance) {
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
// } else {
// this.showErrorMessage(this.getQueryCondition() + '<br>[' + balance.qty + "],",
// res => {
// this.packGetFocus();
// })
// }
},
//
countCallBack(datas) {
this.$refs.comscan.clear();
//
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
balance: datas,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
this.$emit("getCountScanResult", data);
},
packCallBack(item) {
this.$refs.comscan.clear();
//
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
balance: item,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
this.$emit("getResult", data);
},
packGetFocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
locationGetFocus() {
this.fromLocationCode = '';
this.locationOnFocus = true;
},
getQueryCondition() {
let condition = '按照以下条件:<br>';
let label = this.scanResult.label;
let status = getInventoryStatusDesc(this.inventoryStatus);
switch (this.managementPrecision) {
case 'BY_PACKAGING':
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber +
']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_BATCH':
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_QUANTITY':
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_UNIQUEID':
condition = condition + '物料号=[' + label.itemCode + ']'
break;
}
if (this.inventoryStatus.length > 0) {
condition = condition + '<br>库存状态=[' + status + ']'
}
return condition;
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback)
})
},
change(e) {
this.show = e.show
},
isInLocationList(location) {
var item = this.fromLocationList.find(res => res == location)
if (item = undefined) {
return false
}
return true
},
addLocationCode(code) {
if (!this.isInLocationList(code)) {
this.fromLocationList.push(code)
}
}
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

225
mycomponents/scan/winScanPackAndPosition.vue

@ -1,225 +0,0 @@
<template>
<view>
<uni-popup ref="popup" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 8rpx;
height: 30px;">
<view class="uni-center" style="width: 25%; ">
位置
</view>
<view class="" style="width: 75%;padding: 8rpx">
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
</view>
<com-message ref="comMessage" @afterClose="getfocus"></com-message>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getWorkShopLineStation
} from '@/api/request2.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close"],
components: {
winComScan,
comMessage,
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ,HMQ'
}
},
data() {
return {
show: false,
positionInfo: "请选择位置",
positionList: [],
productionLineCode: '',
rawLocationCode: "",
fgLocationCode: "",
workshopCode: "",
workStationCode: "",
workShopName: "",
productionLineName: "",
workStationName: "",
isEditPosition: true
}
},
created() {
},
methods: {
openScanPopup() {
if (this.positionList.length == 0) {
uni.showLoading({
title: "数据加载中....",
mask: true
});
getWorkShopLineStation().then(res => {
uni.hideLoading()
this.positionList = res.data
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
this.$refs.popup.open('bottom');
},
initData(){
this.positionInfo = "请选择位置";
this.positionList = [];
this.productionLineCode = '';
this.rawLocationCode = "";
this.fgLocationCode = "";
this.workshopCode = "";
this.workStationCode ="";
this.workShopName = "";
this.productionLineName="";
this.workStationName="";
this.show = false;
this.isEditPosition = true
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if (this.positionInfo == "请选择位置") {
this.showErrorMessage("请先选择位置")
return
}
var param = {
positionInfo: this.positionInfo,
workshopCode: this.workshopCode,
productionLineCode: this.productionLineCode,
workStationCode: this.workStationCode,
rawLocationCode: this.rawLocationCode,
fgLocationCode: this.fgLocationCode,
}
if (result.success) {
this.isEditPosition = false
this.$emit("getResult", result, param);
} else {
this.showErrorMessage(result.message)
}
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
showSelect() {
if (this.isEditPosition) {
this.show = !this.show
}
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName = e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

12242
package-lock.json

File diff suppressed because it is too large

171
package.json

@ -1,114 +1,77 @@
{
"id": "hello-uniapp",
"name": "hello-uniapp",
"displayName": "hello-uniapp 示例工程",
"version": "3.4.4",
"description": "uni-app 框架示例,一套代码,同时发行到iOS、Android、H5、小程序等多个平台,请使用手机扫码快速体验 uni-app 的强大功能",
"name": "uni-preset-vue",
"version": "0.0.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"dev:app": "uni -p app",
"dev:app-android": "uni -p app-android",
"dev:app-ios": "uni -p app-ios",
"dev:custom": "uni -p",
"dev:h5": "uni",
"dev:h5:ssr": "uni --ssr",
"dev:mp-alipay": "uni -p mp-alipay",
"dev:mp-baidu": "uni -p mp-baidu",
"dev:mp-jd": "uni -p mp-jd",
"dev:mp-kuaishou": "uni -p mp-kuaishou",
"dev:mp-lark": "uni -p mp-lark",
"dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin",
"dev:mp-xhs": "uni -p mp-xhs",
"dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": "uni build -p app",
"build:app-android": "uni build -p app-android",
"build:app-ios": "uni build -p app-ios",
"build:custom": "uni build -p",
"build:h5": "uni build",
"build:h5:ssr": "uni build --ssr",
"build:mp-alipay": "uni build -p mp-alipay",
"build:mp-baidu": "uni build -p mp-baidu",
"build:mp-jd": "uni build -p mp-jd",
"build:mp-kuaishou": "uni build -p mp-kuaishou",
"build:mp-lark": "uni build -p mp-lark",
"build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin",
"build:mp-xhs": "uni build -p mp-xhs",
"build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
},
"repository": "https://github.com/dcloudio/hello-uniapp.git",
"keywords": [
"hello-uniapp",
"uni-app",
"uni-ui",
"示例工程"
],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/dcloudio/hello-uniapp/issues"
},
"homepage": "https://github.com/dcloudio/hello-uniapp#readme",
"dependencies": {
"@dcloudio/uni-app": "3.0.0-3090920231225001",
"@dcloudio/uni-app-plus": "3.0.0-3090920231225001",
"@dcloudio/uni-components": "3.0.0-3090920231225001",
"@dcloudio/uni-h5": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-alipay": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-baidu": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-jd": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-lark": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-qq": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-toutiao": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001",
"less": "^4.2.0",
"vue": "^3.2.45",
"vue-i18n": "^9.1.9",
"vuex": "^4.1.0"
},
"devDependencies": {
"@dcloudio/types": "^3.3.2",
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
"@vue/runtime-core": "^3.2.45",
"axios": "^1.3.4",
"decimal.js": "^10.4.3",
"jwt-decode": "^3.1.2",
"sass": "^1.70.0",
"sass-loader": "^14.1.0",
"vite": "4.0.3",
"vue-clipboard2": "^0.3.3"
},
"dcloudext": {
"category": [
"前端页面模板",
"uni-app前端项目模板"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"京东": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
},
"uni-app": {
"scripts": {
"mp-dingtalk": {
"title": "钉钉小程序",
"env": {
"UNI_PLATFORM": "mp-alipay"
},
"define": {
"MP-DINGTALK": true
}
}
}
},
"devDependencies": {
"browserslist": "^4.21.9",
"caniuse-lite": "^1.0.30001515"
}
}

1836
pages.json

File diff suppressed because it is too large

119
pages/config/config.vue

@ -1,119 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-main" style="background-color: #fff; height: 100%;">
<pullDown label="项目名称" v-model="name" :options="arrayUnique(options,'name')" description='column' />
<pullDown label="服务器地址" v-model="value" :options="unique(options)" :itemTextCount="2" :isAutoHeight='true'
description='column' style="font-size: 35rpx;padding: 30rpx 0 0 0;" />
</view>
<!-- 页面底部 -->
<view class="page-footer">
<button type="primary" @click="saveClick">保存</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
name: '',
value: '',
options: [{
name: '汽车镜备件',
desc: '汽车镜备件公司测试库',
value: 'http://192.168.0.178:12080/admin-api',
},
{
name: '汽车镜备件',
desc: '汽车镜备件现场测试库',
value: 'http://192.168.0.178:12080/admin-api',
},
{
name: '汽车镜备件',
desc: '汽车镜备件现场正式库',
value: 'http://192.168.0.178:12080/admin-api',
},
{
name: '富维汽车镜',
desc: '汽车镜备件现场正式库',
value: 'http://192.168.0.178:12080/admin-api',
},
],
};
},
onLoad(option) {
this.value = getApp().globalData.request_url;
},
methods: {
saveClick() {
getApp().globalData.request_url = this.value;
console.log(getApp().globalData.request_url);
// uni.navigateBack()
uni.navigateBack({
delta: 1 // delta
})
},
unique(arr) {
let that = this;
if (this.name == '') {
return this.options
} else {
return arr.filter(item => item.name === this.name);
}
},
arrayUnique(arr, type) {
return arr ? [
...new Set(
arr.map((item) => {
return item[type]
})
)
] : []
}
}
}
</script>
<style>
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-footer {
color: #fff;
line-height: 100rpx;
/* 不放大不缩小固定100rpx */
flex: 0 0 100rpx;
background-color: #00AAFF;
}
.container {
background-color: #f5f7fa;
/* 这里只是作为样式展示 */
}
</style>

182
pages/container/coms/comContainerBindCard.vue

@ -1,182 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<balance :dataContent="item" :isShowStdPack="false" :isShowPack="true" :isShowStatus="false"
:isShowBatch="true" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="isShowLocation">
</balance>
</view>
<!-- <view class="" v-for="(item,index) in dataContent.bindList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowPack="true" :isShowStatus="false"
:isShowBatch="true" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="isShowLocation">
</balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view> -->
</uni-collapse-item>
</uni-collapse>
<recommendQtyEdit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
:handleQty="editItem.qty" @confirm="confirm">
</recommendQtyEdit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
balance,
recommendQtyEdit,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: false
},
isShowLocation: {
type: Boolean,
default: false
},
isShowPatch: {
type: Boolean,
default: true
}
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.receiptEdit.openEditPopup();
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false;
// this.dataContent.subList.splice(index, 1)
// this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

174
pages/container/coms/comPalletRecord.vue

@ -1,174 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowPack="true" :isShowStatus="false" :isShowBatch="true"
:toInventoryStatus="item.toInventoryStatus" :isShowFromLocation="isShowLocation" >
</balance>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <u-line color="#D8D8D8"></u-line> -->
</view>
</uni-collapse-item>
</uni-collapse>
<recommendQtyEdit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
:handleQty="editItem.qty" @confirm="confirm">
</recommendQtyEdit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getEditOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
balance,
recommendQtyEdit,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: false
},
isShowLocation: {
type: Boolean,
default: false
},
isShowPatch: {
type: Boolean,
default: true
}
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditOption();
this.removeOptions = getClearOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.receiptEdit.openEditPopup();
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned=false;
// this.dataContent.subList.splice(index, 1)
// this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

424
pages/container/record/containerBindRecord.vue

@ -1,424 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showContainerPopup' v-if="containerCode==''"></com-blank-view>
</view>
<view class="page-wraper" v-if="containerCode!=''">
<view class="" style="margin-left: 20rpx;">
<targetContainer ref="targetContainer" title="托盘" :containerCode="containerCode" :isShowEdit="false"
@getContainer="getContainer"></targetContainer>
</view>
<u-line color="#D8D8D8"></u-line>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<!-- {{item.contentNumber}} -->
<comPalletRecord :dataContent="item" :index="index" :isShowPatch="false"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</comPalletRecord>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-container ref="scanContainer" title="器具" @getContainer='getContainer'></win-scan-container>
<win-scan-location ref="scanLocationPopup" title="来源库位" @getLocation="getFromLocation"></win-scan-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false">
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
containerBindRecordSubmit,
getContainerDetailByNumber
} from '@/api/request2.js';
import {
goHome
} from '@/common/basic.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import targetContainer from "@/mycomponents/container/targetContainer.vue"
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comPalletRecord from '@/pages/container/coms/comPalletRecord.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
export default {
components: {
winScanButton,
winScanPack,
comBlankView,
comMessage,
targetContainer,
recordComDetailCard,
winScanContainer,
comPalletRecord,
winScanPackAndLocation,
winScanLocation
},
data() {
return {
id: '',
scanCount: 0,
detailSource: [], //
locationTypeList: [],
toLocationInfo: {},
fromLocationInfo: {},
toLocationInfo: {},
containerCode: "",
containerInfo: {},
fromlocationTypeList: [],
tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {}
};
},
onLoad(option) {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {
getBusinessType('ContainerBind', res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showContainerPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
methods: {
getContainer(containerInfo) {
this.containerInfo = containerInfo;
this.containerCode = containerInfo.number;
getContainerDetailByNumber(this.containerCode).then(res => {
if (res.data != null && res.data.subList.length > 0) {
this.detailSource = this.getDataSource(res.data.subList)
}
this.showScanLocation();
}).catch(error => {
this.showErrorMessage(error.message)
})
},
showScanLocation() {
this.$nextTick(r => {
this.$refs.scanLocationPopup.openScanPopup();
})
},
getFromLocation(location, code) {
this.fromLocationInfo = location;
this.openScanPopup();
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var item = this.detailSource.find(r => r.itemCode == itemCode);
if (item == undefined) {
if (this.detailSource.length == 0) {
item = this.createItemInfo(result.label);
let itemDetail = result.balance;
itemDetail.scaned = true;
item.subList.push(itemDetail);
this.detailSource.push(item);
} else {
this.showMessage("绑定物料【" + itemCode + "】与现有物料不一致,不可以绑定");
}
} else {
var itemDetail = item.subList.find(r => r.packingNumber == packingNumber && r.batch == batch);
if (itemDetail == undefined) {
itemDetail = result.balance;
itemDetail.scaned = true;
item.subList.push(itemDetail);
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】已经扫描")
} else {
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】已经绑定到器具")
}
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
createRecordInfo(detail, label) {
var record = {}
detail.scaned = true;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.qty = Number(label.qty);
return record;
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.scanPopupGetFocus();
this.$forceUpdate();
},
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = this.createItemInfo(detail);
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: res.stdPackQty,
stdPackUnit: res.stdPackUnit,
qty: res.qty,
handleQty: 0,
uom: res.uom,
subList: []
}
return item;
},
createDetailInfo(data) {
data.scaned = false;
data.packingNumber = data.contentNumber
data.qty = Number(data.qty)
data.handleQty = 0;
let detail = data;
return detail;
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationInfo.code != undefined) {
this.$refs.scanPopup.openScanPopupForType(this.fromLocationInfo.code, this.businessType);
} else {
this.showScanLocation();
}
},
showContainerPopup() {
this.$nextTick(() => {
this.$refs.scanContainer.openScanPopup();
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus();
}
},
commit() {
uni.showLoading({
title: '提交中...',
mask: true
})
this.scanCount = getScanCount(this.detailSource[0].subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描要解绑的箱码")
return;
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params))
containerBindRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data)
this.clear();
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
getParams() {
var subList = []
var creator = this.$store.state.user.id
let params = {
number: this.containerCode,
status: 'USED',
toLocationCode: this.fromLocationInfo.code,
containerType: this.containerInfo.type,
creator: creator
};
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.containerContentType = 'PACKAGE';
detail.contentNumber = detail.packingNumber;
detail.package = null;
subList.push(detail)
}
})
})
params.subList = subList
return params;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.containerCode = '';
})
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
}
}
</script>
<style scoped lang="scss">
</style>

386
pages/container/record/containerUnBindRecord.vue

@ -1,386 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showContainerPopup' v-if="containerCode==''"></com-blank-view>
</view>
<view class="page-wraper" v-if="containerCode!=''">
<view class="" style="margin-left: 20rpx;">
<targetContainer ref="targetContainer" title="托盘" :containerCode="containerCode" :isShowEdit="false"
@getContainer="getContainer"></targetContainer>
</view>
<u-line color="#D8D8D8"></u-line>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<!-- {{item.contentNumber}} -->
<comPalletRecord :dataContent="item" :index="index"
:isShowPatch="false" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</comPalletRecord>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
<winScanContainer ref="scanContainer" title="托盘" @getContainer='getContainer'></winScanContainer>
</view>
</template>
<script>
import {
containerUnBindRecordSubmit,
getContainerDetailByNumber
} from '@/api/request2.js';
import {
goHome
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import targetContainer from "@/mycomponents/container/targetContainer.vue"
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comPalletRecord from '@/pages/container/coms/comPalletRecord.vue'
export default {
components: {
winScanButton,
winScanPack,
comBlankView,
comMessage,
targetContainer,
recordComDetailCard,
winScanContainer,
comPalletRecord
},
data() {
return {
id: '',
scanCount: 0,
detailSource: [], //
businessTypeInfo: {},
fromLocationInfo: {},
containerCode: "",
};
},
onLoad(option) {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {
this.showContainerPopup();
},
methods: {
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch);
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.label);
// this.calcHandleQty();
}
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
createRecordInfo(detail, label) {
var record = {}
detail.scaned = true;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.qty = Number(label.qty);
return record;
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.scanPopupGetFocus();
this.$forceUpdate();
},
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = this.createItemInfo(detail);
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: res.stdPackQty,
stdPackUnit: res.stdPackUnit,
qty: res.qty,
handleQty: 0,
uom: res.uom,
subList: []
}
return item;
},
createDetailInfo(data) {
data.scaned = false;
data.packingNumber = data.contentNumber
data.qty = Number(data.qty)
data.handleQty =0;
let detail = data;
return detail;
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.containerCode == "") {
this.showContainerPopup();
return
}
this.$refs.scanPopup.openScanPopup();
},
showContainerPopup() {
this.$nextTick(() => {
this.$refs.scanContainer.openScanPopup();
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
}
},
commit() {
uni.showLoading({
title: '提交中...',
mask: true
})
this.scanCount = getScanCount(this.detailSource[0].subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描要解绑的箱码")
return;
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params))
containerUnBindRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data)
this.clear();
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
getParams() {
var subList = []
var creator = this.$store.state.user.id
let params = {
number: this.containerCode,
type: 'bind',
status: 'USED',
creator: creator
};
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.containerContentType = 'PACKAGE';
detail.contentNumber = detail.packingNumber;
detail.itemCode = detail.itemCode;
detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus;
detail.qty =detail.handleQty;
detail.package = null;
subList.push(detail)
}
})
})
params.subList = subList
return params;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getContainer(containerInfo) {
this.containerCode = containerInfo.number;
getContainerDetailByNumber(this.containerCode).then(res => {
if (res.data != null && res.data.subList.length > 0) {
this.detailSource = this.getDataSource(res.data.subList)
}
}).catch(error => {
this.showErrorMessage(error.message)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.containerCode = '';
})
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
},
clear()
{
}
}
}
</script>
<style scoped lang="scss">
</style>

160
pages/count/coms/comCountDetailCard.vue

@ -1,160 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty v-if="settingParam.isOpenCount=='TRUE'" :dataContent="dataContent"
:handleQty="dataContent.handleQty" :isShowBalanceQty="false">
</item-qty>
<item-qty v-else :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalanceQty="true" :showRecommendQty="false" :showStdPack="true">
</item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend-count :detail="item" :isShowFromLocation="false" style='margin:1px 0px;'
:isShowRecommendQty="settingParam.isOpenCount=='TRUE'">
</recommend-count>
<u-line />
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import recommendCount from '@/mycomponents/recommend/recommendCount.vue'
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
item,
itemQty,
recommendCount,
detailInfoPopup,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: [],
removeOptions: [],
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空该物料下面扫描的信息吗?",
res => {
if (res) {
dataContent.handleQty = 0;
dataContent.subList.forEach(res=>{
res.scaned = false;
res.handleQty= 0
})
this.$emit('clear')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(detail) {
this.$emit("editItem", detail)
},
detail(item) {
this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item);
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
// this.dataContent.subList.splice(index, 1)
item.scaned = false;
item.handleQty = 0;
this.$emit('removePack')
}
});
},
confirm(qty) {
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

845
pages/count/job/countDetail.vue

@ -1,845 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="cen_card" style="padding-top: 10rpx;padding-bottom: 10rpx;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">阶段</view>
<view>{{getCountStageName(jobContent.stage)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">策略</view>
<view>{{ isOpenCount(jobContent.isOpenCount) }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">库位</view>
<view>{{fromLocationCode}}</view>
</view>
</view>
</view>
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;"></u-line>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-count-detail-card :ref="'countDetail_'+index" :dataContent="item" :index="index"
@editItem="editItem" :settingParam="jobContent" @remove="updateData"
@updateData="updateData">
</com-count-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'>
</win-scan-pack-and-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true"
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getCountJobDetail,
takeCountJob,
cancleTakeCountJob,
countJobSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getCountStageName
} from '@/common/directory.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comCountDetailCard from '@/pages/count/coms/comCountDetailCard.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
comCountDetailCard,
requiredLocation,
comMessage,
winScanPackAndLocation,
countQtyEdit,
jobTop,
balanceSelect
},
data() {
return {
id: '',
receiptJob: {},
fromLocationCode: '',
isShowPackingCode: true,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {}, //
currentEditItem: {},
jobStatus: ""
};
},
onLoad(option) {
this.id = option.id;
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakeCountJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeCountJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getCountJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.fromLocationCode = that.jobContent.locationCode;
that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList)
this.calcHandleQty();
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = this.createItemInfo(detail);
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
console.log("数量", item.qty)
item.qty = calc.add(item.qty, detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
},
createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: res.stdPackQty,
stdPackUnit: res.stdPackUnit,
qty: Number(res.qty),
handleQty: 0,
uom: res.uom,
subList: []
}
return item;
},
createDetailInfo(data) {
data.scaned = false;
let detail = data;
detail.balanceQty = 0
detail.handleQty = 0;
detail.inventoryStatus = detail.inventoryStatus
detail.fromLocationCode = this.fromLocationCode
return detail;
},
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
for (let item of this.detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail!= undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
item.qty = calc.add(item.qty, detail.qty);
}
}
}
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus();
}
},
//
getScanResult(result) {
if (this.jobContent.isOpenCount) {
this.getOpenCountResult(result);
} else {
this.getUnOpenCountResult(result);
}
},
getOpenCountResult(result) {
try {
let that = this;
that.package = result.package;
that.label = result.label;
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode);
if (item == undefined) {
that.scanByBalance(result);
} else {
// let subItem = item.subList.find(item => {
// if (item.packingNumber == that.label.packingNumber &&
// item.batch == that.label.batch && item.scaned == true) {
// return item;
// }
// })
let subItems = item.subList.filter(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch) {
return item;
}
})
//
if (subItems.length > 1) {
let subItem = subItems.find(r => r.scaned == false)
if (subItem == undefined) {
subItem = subItems[0];
that.editCountResult(item, subItem);
} else {
that.scanByBalance(result);
}
} else if (subItems.length == 1) {
let subItem = subItems[0];
if (subItem.scaned) {
that.editCountResult(item, subItem);
// this.$refs.comMessage.showQuestionMessage("" + that.label.packingNumber +
// ",?",
// res => {
// if (res) {
// this.currentEditItem = subItem;
// this.$refs.countQtyEdit.openEditPopup(subItem,
// item.subList);
// // this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// // item.subList);
// } else {
// this.scanPopupGetFocus();
// }
// })
} else {
that.scanByBalance(result);
}
} else if (subItems.length == 0) {
that.scanByBalance(result);
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
//
editCountResult(item, subItem) {
let that = this;
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber +
"】已经完成盘点,是否要编辑盘点结果?",
res => {
if (res) {
this.currentEditItem = subItem;
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
// this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// item.subList);
} else {
this.scanPopupGetFocus();
}
})
},
getUnOpenCountResult(result) {
try {
let that = this;
that.package = result.package;
that.label = result.label;
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode);
if (item == undefined) {
this.$refs.comMessage.showQuestionMessage("没有物料【" + that.package.itemCode +
"】的盘点明细,是否继续盘点?",
res => {
if (res) {
that.scanByLabel(result);
} else {
this.scanPopupGetFocus();
}
})
} else {
let subItem = item.subList.find(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch && item.scaned == true) {
return item;
}
})
if (subItem != undefined) {
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber +
"】已经完成盘点,是否要编辑盘点结果?",
res => {
if (res) {
this.currentEditItem = subItem;
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
} else {
this.scanPopupGetFocus();
}
})
} else {
that.scanByLabel(result);
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
//
scanByBalance(result) {
let that = this;
if (result.balance.length == 0) {
that.scanPopupLoseFocus()
that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode +
"],未查找到库存,是否继续盘点?",
res => {
if (res) {
that.editInventoryStatus = true;
let item = that.package;
item.packingNumber = that.label.packingNumber;
item.qty = 0
item.handleQty = Number(that.label.qty);
item.balanceQty = 0;
item.inventoryStatus = "OK";
that.balance = item;
that.$refs.countQtyEdit.openEditPopupShowSeconds(item,
null);
} else {
//
that.scanPopupGetFocus();
}
})
} else if (result.balance.length == 1) {
this.countByBalance(result.balance[0]);
} else {
//
this.$refs.balanceSelect.openPopup(result.balance);
}
},
//
scanByLabel(result) {
let that = this;
that.scanPopupLoseFocus()
let item = that.package;
item.packingNumber = that.label.packingNumber;
item.qty = 0
item.handleQty = Number(that.label.qty);
item.balanceQty = 0;
item.inventoryStatus = "OK";
that.balance = item;
that.$refs.countQtyEdit.openEditPopupShowSeconds(item,
null);
},
selectBalanceItem(balance) {
this.countByBalance(balance);
},
countByBalance(balance) {
this.balance = balance;
// this.balance.qty = 0
this.balance.handleQty = Number(this.label.qty);
this.balance.balanceQty = this.balance.qty;
this.balance.stdPackQty = this.package.stdPackQty;
this.balance.stdPackUnit = this.package.stdPackUnit;
this.$refs.countQtyEdit.openEditPopupShowSeconds(this.balance,
null);
},
editConfirm(qty, inventoryStatus, mode) {
let that = this;
//
if (mode == 'edit') {
this.currentEditItem.handleQty = qty;
this.currentEditItem.inventoryStatus = inventoryStatus;
} else {
//
//
var detail = that.detailSource.find(r => r.itemCode == that.label.itemCode);
if (detail == undefined) {
//
that.addNewItemCodeToList(qty, inventoryStatus)
} else {
var itemEditInfo = detail.subList.find(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch &&
item.inventoryStatus == inventoryStatus) {
return item;
}
})
if (itemEditInfo == undefined) {
//
that.addExistItemCodeToList(detail, qty, inventoryStatus);
} else { //
itemEditInfo.scaned = true;
itemEditInfo.handleQty = qty;
itemEditInfo.inventoryStatus = inventoryStatus;
itemEditInfo.balanceQty = that.balance.qty;
itemEditInfo.stdPackQty = that.package.stdPackQty;
itemEditInfo.stdPackUnit = that.package.stdPackUnit;
}
}
setTimeout(r => {
this.calcHandleQty();
this.scanPopupGetFocus();
}, 100)
}
},
openEditConfirm() {
},
unOpenEditConfirm() {
},
editClose() {
this.scanPopupGetFocus();
},
addNewItemCodeToList(qty, inventoryStatus) {
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?",
res => {
if (res) {
var item = this.createAddItemInfo(this.balance, this.package);
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); //
item.subList.push(newDetail);
this.detailSource.push(item)
this.showMessage('添加成功');
this.updateData()
this.scanPopupGetFocus();
}
})
},
addExistItemCodeToList(detail, qty, inventoryStatus) {
let that = this;
that.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage("盘点结果不在明细列表中,是否添加到列表?",
res => {
if (res) {
// detail.qty = calc.add(qty, qty)
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); //
detail.subList.push(newDetail);
this.showMessage('添加成功');
that.updateData()
}
that.scanPopupGetFocus();
})
},
createAddItemInfo() {
let item = {
itemCode: this.package.itemCode,
itemName: this.package.itemName,
stdPackQty: this.package.stdPackQty,
stdPackUnit: this.package.stdPackUnit,
// qty: Number(qty),
qty: 0,
handleQty: 0,
uom: this.package.uom,
subList: [],
}
return item;
},
//
createAddDetailInfo(qty, inventoryStatus) {
var detail = {
id: "0", //
scaned: true,
countDetailNumber: "",
ownerCode: this.balance.ownerCode,
packingNumber: this.package.number,
containerNumber: this.balance.containerNumber,
batch: this.package.batch,
inventoryStatus: inventoryStatus,
itemCode: this.package.itemCode,
itemName: this.package.itemName,
itemDesc1: this.package.itemDesc1,
itemDesc2: this.package.itemDesc2,
stdPackQty: this.package.stdPackQty,
stdPackUnit: this.package.stdPackUnit,
projectCode: "",
qty: 0,
handleQty: qty,
uom: this.package.uom,
number: this.jobContent.number,
remark: "",
countQty: qty,
balanceQty: this.balance.qty,
fromLocationCode: this.balance.locationCode,
creator: this.$store.state.user.id
}
return detail;
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
getScanCount() {
var scanCount = 0;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
scanCount = scanCount + 1;
}
})
})
return scanCount;
},
getTotalCount() {
var totalCount = 0;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
totalCount = totalCount + 1;
})
})
return totalCount;
},
commit() {
this.scanCount = this.getScanCount();
if (this.scanCount == this.getTotalCount()) {
this.submitJob();
} else if (this.scanCount < this.getTotalCount()) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage("已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "],是否把未扫描的盘点数量设置为0?",
res => {
if (res) {
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (!detail.scaned) {
detail.countQty = 0;
}
})
})
this.submitJob();
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "]", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成盘点记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.countQty = detail.handleQty;
}
subList.push(detail)
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
editItem(item) {
this.currentEditItem = item;
var detail = this.detailSource.find(r => r.itemCode == item.itemCode);
this.$refs.countQtyEdit.openEditPopup(item,
detail.subList);
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1);
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
}
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

293
pages/count/job/countJob.vue

@ -1,293 +0,0 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-count-job-card :dataContent="item" @click='openJobDetail(item)'></com-count-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" />
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
cancleTakeCountJob,
getCountJobList
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue'
import jobListPopup from '@/pages/count/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/count/coms/jobInfoPopup.vue'
export default {
name: 'receipt',
components: {
comEmptyView,
jobFilter,
comMessage,
comCountJobCard,
jobListPopup,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList('refresh');
},
onReady() {
const rightButtonEle2 = document.getElementsByClassName('uni-page-head-btn')[2]
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getCountJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("盘点(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("盘点");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './countDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeCountJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getCountJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

554
pages/count/record/countRecord.vue

@ -1,554 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="fromLocationCode==''"></com-blank-view>
</view>
<view class="page-wraper" v-if="fromLocationCode!=''">
<requiredLocation title="盘点库位" :locationCode="fromLocationCode"
:isShowEdit="jobContent.allowModifyLocation==1" @getLocation='scanLocationCode'
:locationTypeList="locationTypeList"></requiredLocation>
<u-line></u-line>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-count-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"
@editItem="editItem">
</com-count-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="盘点库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location>
<count-qty-edit ref="CountQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="true">
</count-qty-edit>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
goHome,
getDataSource,
navigateBack
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
balanceByLocation
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comCountDetailCard from '@/pages/count/coms/comCountDetailCard.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import CountQtyEdit from '@/mycomponents/qty/CountQtyEdit.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
comCountDetailCard,
requiredLocation,
comBlankView,
winScanPackAndLocation,
comMessage,
winScanLocation,
CountQtyEdit
},
data() {
return {
id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationTypeArray: [],
toLocationTypeArray: [],
fromLocationInfo: {},
fromLocationCode: "",
businessType: {},
itemEditInfo: {}
};
},
onLoad(option) {
var typeCode = "Count"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
},
onPullDownRefresh() {
uni.stopPullDownRefresh();
},
mounted() {},
methods: {
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
for (let item of this.detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if(detail!=undefined){
if(detail.scaned){
item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
item.qty = calc.add(item.qty,detail.qty);
}
}
}
this.$forceUpdate();
},
selectedItem(item) {
if (item.locationCode != this.fromLocationCode) {
this.showErrorMessage("来源库位[" + this.fromLocationCode + "]无库存")
return;
}
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
getLocation(location) {
this.getfromLocationCode(location)
},
getfromLocationCode(location) {
this.fromLocationInfo = location;
this.fromLocationCode = location.code;
//
balanceByLocation(this.fromLocationCode, res => {
this.subList = res.data.list;
this.detailSource = getDataSource(this.subList);
});
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
updateData() {
this.calcHandleQty();
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
getScanResult(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
//
if (detail == undefined) {
//
this.addNewItemCodeToList(result)
} else {
//
this.itemEditInfo = detail.subList.find(item => {
if (item.packingNumber == packingNumber &&
item.batch == batch &&
item.inventoryStatus == inventoryStatus) {
return item;
}
})
if (this.itemEditInfo == undefined) {
//
this.addExistItemCodeToList();
} else {
//
if (this.itemEditInfo.scaned) {
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + "】已经完成盘点,是否要编辑数量",
res => {
if (res) {
this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo,
detail.subList);
} else {
this.scanPopupGetFocus();
}
})
} else {
this.itemEditInfo.scaned = true;
this.itemEditInfo.stdPackQty = result.package.stdPackQty;
this.itemEditInfo.stdPackUnit = result.package.stdPackUnit;
this.itemEditInfo.record = this.createRecordInfo(this.itemEditInfo, result.balance);
this.$refs.CountQtyEdit.openEditPopupShowSeconds(this.itemEditInfo);
this.calcHandleQty();
}
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
addNewItemCodeToList(result) {
var item = this.createAddItemInfo(result.balance, result.package);
let newDetail = this.createAddDetailInfo(result.balance, result.package); //
item.subList.push(newDetail);
this.detailSource.push(item)
},
createRecordInfo(detail, balance) {
var record = {}
detail.scaned = true;
detail.balanceQty = Number(balance.qty);
detail.inventoryStatus = balance.inventoryStatus;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.fromLocationCode = this.fromLocationCode;
return record;
},
addExistItemCodeToList(detail, result) {
detail.qty = calc.add(detail.qty,detail.qty)
let newDetail = this.createAddDetailInfo(result.balance, result.package); //
detail.subList.push(newDetail);
},
createAddItemInfo(balance, pack) {
let item = {
itemCode: balance.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: balance.qty,
handleQty: 0,
uom: pack.uom,
subList: []
}
return item;
},
createAddDetailInfo(balance, pack) {
var detail = {
scaned: true,
balanceQty: balance.qty,
toInventoryStatus: balance.inventoryStatus,
fromLocationCode: balance.locationCode,
id: "",
countDetailNumber: "",
ownerCode: balance.OwnerCode,
packingNumber: balance.packingNumber,
containerNumber: pack.containerNumber,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
itemCode: balance.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
projectCode: "",
qty: balance.qty,
uom: balance.uom,
masterID: "",
Number: "",
remark: "",
creationTime: "",
creatorId: "",
creatorName: "",
siteId: ""
}
return detail;
},
editItem(val) {
var detail = this.detailSource.find(r => r.itemCode == val.itemCode);
this.$refs.CountQtyEdit.openEditPopup(val,
detail.subList);
},
editConfirm() {
this.calcHandleQty();
this.scanPopupGetFocus();
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.fromLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
//
if (this.jobContent.allowPartialComplete == "TRUE") {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log("提交" + JSON.stringify(params))
// (this.id, params).then(res => {
// uni.hideLoading()
// if (res.data) {
// var hint = res.data.Number;
// this.showCommitSuccessMessage("" + hint, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
this.calcScanCount();
if (this.scanCount < this.subList.length) {
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList.length +
"]");
}
}
},
setParams() {
var params = {
requestNumber: this.jobContent.requestNumber,
jobNumber: "",
asnNumber: this.jobContent.asnNumber,
ppNumber: this.jobContent.ppNumber,
supplierCode: this.jobContent.supplierCode,
receiptDock: this.jobContent.receiptDock,
carrierCode: this.jobContent.carrierCode,
transferMode: this.jobContent.transferMode,
vehiclePlateNumber: this.jobContent.vehiclePlateNumber,
fromWarehouseCode: this.toLocationInfo.WarehouseCode,
toWarehouseCode: this.toLocationInfo.warehouseCode,
outTransaction: this.businessTypeInfo.outTransactionType, //
inTransaction: this.businessTypeInfo.inTransactionType, //
executeTime: "2023-08-4 16:30:11", //
activeDate: "2023-08-4 16:30:11", //
available: "1", // 0,1
requestTime: this.jobContent.requestTime,
dueTime: "2023-08-4 16:30:11", //
departmentCode: this.jobContent.departmentCode,
userPositionCode: "", //
interfaceType: "jklxPURCHASE_RECEIPT", //
number: this.jobContent.number,
businessType: this.jobContent.businessType,
remark: this.jobContent.remark,
creationTime: this.jobContent.creationTime,
creatorld: this.jobContent.creatorld,
creatorName: this.jobContent.creatorName,
extraProperties: this.jobContent.extraProperties,
siteld: this.jobContent.siteld,
code: "",
subList: [
],
}
this.detailSource.forEach(res => {
res.subList.forEach(res1 => {
if (res1.scaned) {
res1.FromLocationGroupCode = "";
res1.FromAreaCode = "";
res1.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode;
res1.ToAreaCode = this.toLocationInfo.AreaCode;
res1.VisualInspectResult = ""; //
res1.VisualInspectPhotos = ""; //
res1.FailedReason = ""; //
res1.MassDefect = ""; //
res1.SinglePrice = ""; //
res1.Amount = ""; //
res1.Code = "";
res1.JobDetailID = res1.id;
res1.interfaceType = "jklxPURCHASE_RECEIPT";
params.subList.push(res1)
}
})
})
return params;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

174
pages/customerReturn/coms/comReturnRecord.vue

@ -1,174 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<production-label :dataContent="item" :packageContent="item.package">
</production-label>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true" :allowEditStatus="false">
</balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import productionLabel from '@/mycomponents/balance/productionLabel.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
balanceQtyEdit,
productionLabel,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
},
detail(item) {
this.showItem = item;
this.dataList = [
{
title: "箱码",
content: item.packingNumber
},
{
title: "批次",
content: item.batch
},
{
title: "库位",
content: item.locationCode
},
{
title: "数量",
content: item.qty
},
{
title: "单位",
content: item.uom
}
]
this.$refs.winHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

540
pages/customerReturn/job/returnDetail.vue

@ -1,540 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList="tolocationTypeList">
</com-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getCustomerReturnJobDetail,
getBasicLocationByCode,
takeCustomerReturnJob,
cancleTakeCustomerReturnJob,
customerReturnJobSubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch,
getInventoryStatusName,
getDirectoryItemArray
} from '@/common/basic.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue'
export default {
components: {
winScanButton,
winScanPackAndLocation,
requiredLocation,
comMessage,
comDetailCard,
detailInfoPopup
},
data() {
return {
id: '',
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
managementList: [],
fromLocationCode: "",
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [],
jobStatus:""
};
},
onLoad(option) {
this.id = option.id;
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
//
cancleTakeCustomerReturnJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeCustomerReturnJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getCustomerReturnJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.getLocationInfo(that.toLocationCode);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
getLocationInfo(locationCode) {
if (locationCode != '') {
getBasicLocationByCode(locationCode).then(res => {
if (res.data.list.length > 0) {
this.toLocationInfo = res.data.list[0]
}
})
}
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.continueScan();
this.$forceUpdate();
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openDetail(item) {
this.$refs.detailInfoPopup.openPopup(item)
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if(this.jobContent.allowModifyInventoryStatus=="TRUE"){
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续退货?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
}else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
}
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this.subList.length + "]箱", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
customerReturnJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成客户退货记录:" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.toContainerNumber = detail.containerNumber;
detail.toBatch = info.batch;
detail.toLocationCode = detail.toLocationCode;
detail.toInventoryStatus = 'HOLD';
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.packGetFocus();
}
},
scanPopupLoseFocus() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.packLoseFocus();
}
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

287
pages/customerReturn/job/returnJob.vue

@ -1,287 +0,0 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-return-job-card :dataContent="item" @click='openJobDetail(item)'></com-return-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
cancleTakeCustomerReturnJob,
getCustomerReturnJobList,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnJobCard from '@/pages/customerReturn/coms/comReturnJobCard.vue'
import jobListPopup from '@/pages/customerReturn/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/customerReturn/coms/jobInfoPopup.vue'
export default {
name: 'customerReturn',
components: {
comEmptyView,
jobFilter,
comMessage,
comReturnJobCard,
jobListPopup,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList('refresh');
},
onReady() {
const rightButtonEle2 = document.getElementsByClassName('uni-page-head-btn')[2]
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getCustomerReturnJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("客户退货(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("客户退货任务");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './returnDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeCustomerReturnJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getCustomerReturnJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

468
pages/customerReturn/record/returnRecord.vue

@ -1,468 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :isShowLocation="true"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
</view>
</template>
<script>
import {
getBasicCustomerList,
customerReturnRecordSubmit
} from '@/api/request2.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
updateTitle,
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReturnRecord from '@/pages/customerReturn/coms/comReturnRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default {
components: {
winScanButton,
winScanPack,
comReturnRecord,
requiredLocation,
comBlankView,
winScanLocation,
comMessage,
winScanPackAndLocation,
recordComDetailCard
},
data() {
return {
id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
dataContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
businessType: {},
fromLocationCode: "",
toLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
managementList: [],
toWarehouseCode: '',
};
},
onLoad(option) {
var typeCode = "CustomerReject"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {
},
methods: {
getScanResult(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
customerReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成客户退货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData()
})
},
clearData(){
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

396
pages/customerReturn/request/customerReturnRequest.vue

@ -1,396 +0,0 @@
<template>
<view>
<com-empty-view v-if="requestList.length==0"></com-empty-view>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<com-return-request-card :dataContent="item" @click='openRequestDetail(item)'>
</com-return-request-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" v-if="requestList.length>0" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<requestButton @goScan='openScanDetailPopup'></requestButton>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import requestFilter from '@/mycomponents/request/requestFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCard from '@/pages/customerReturn/coms/comReturnRequestCard.vue'
import requestInfoPopup from '@/pages/customerReturn/coms/requestInfoPopup.vue'
import requestButton from '@/mycomponents/button/requestButton.vue'
import {
goHome,
updateTitle,
clearTirmAndWrap
} from '@/common/basic.js';
import {
getCustomerReturnRequestList,
customerReturnRequestClose,
customerReturnRequestApprove,
customerReturnRequestApproveAgree,
customerReturnRequestApproveRefused,
customerReturnRequestHandle,
customerReturnRequestAddAgain
} from '@/api/request2.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndAddAndCloseOption,
getAddAgainOption
} from '@/common/array.js';
export default {
components: {
comEmptyView,
requestFilter,
comMessage,
comReturnRequestCard,
requestInfoPopup,
requestButton
},
data() {
return {
requestList: [],
pageNo: 1,
pageSize: 10,
status: "1,2,3,4,5,6",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndAddAndCloseOption: [],
addAgainOption: [],
showOptions: [],
fromType: "requestType",
loadingType: "nomore",
};
},
onReady() {
this.detailOptions = getDetailOption();
this.addAgainOption = getAddAgainOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndAddAndCloseOption = getDetailAndAddAndCloseOption()
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
onLoad(option) {
this.getList('refresh');
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
mounted() {
},
methods: {
requestConfirm(action, item) {},
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
openRequestDetail(item) {
uni.navigateTo({
url: './customerReturnRequestDetail?id=' + item.id
});
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getCustomerReturnRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle("客户退货申请(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle("客户退货申请");
uni.hideLoading();
that.showMessage(error)
})
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndAddAndCloseOption;
} else if (status == "5") {
this.showOptions = this.addAgainOption;
} else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
openScanDetailPopup() {
uni.navigateTo({
url: "../request/customerReturnRequestCreate"
})
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?", res => {
this.customerReturnRequestHandle(dataContent.id)
})
} else if (text == "提交审批") {
this.showQuestionMessage("确定要审批当前申请吗?", res => {
this.customerReturnRequestApprove(dataContent.id)
})
} else if (text == "审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?", res => {
this.customerReturnRequestApproveAgree(dataContent.id)
})
} else if (text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?", res => {
this.customerReturnRequestApproveRefused(dataContent.id)
})
} else if (text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?", res => {
this.customerReturnRequestClose(dataContent.id)
})
} else if (text == "重新添加") {
this.showQuestionMessage("确定要重新添加当前申请吗?", res => {
this.customerReturnRequestAddAgain(dataContent.id)
})
}
},
showQuestionMessage(hint, callBack) {
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getCustomerReturnRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
customerReturnRequestApprove(id) {
customerReturnRequestApprove(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请提交审批成功"
})
this.getList("refresh")
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
customerReturnRequestClose(id) {
customerReturnRequestClose(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请关闭成功"
})
this.getList("refresh")
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
customerReturnRequestAddAgain(id) {
customerReturnRequestAddAgain(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请重新添加成功"
})
this.getList("refresh")
} else {
this.showMessage("申请重新添加失败")
}
}).catch(error => {
this.showMessage(error)
})
},
customerReturnRequestApproveAgree(id) {
customerReturnRequestApproveAgree(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批通过成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
customerReturnRequestApproveRefused(id) {
customerReturnRequestApproveRefused(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批驳回成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
customerReturnRequestHandle(id) {
customerReturnRequestHandle(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请处理成功"
})
this.getList("refresh")
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
}
}
</script>
<style>
</style>

488
pages/customerReturn/request/customerReturnRequestCreate.vue

@ -1,488 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="uni-flex uni-row padding title u-col-center" @click="showSelect" style="font-size: 35rpx;">
<text style="font-size: 32rpx;">客户 : </text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;font-size: 32rpx;">
{{customerName}}
</view>
<u-select v-model="showCustomer" mode="single-column" :list="customerList" @confirm="confirmSelect">
</u-select>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :isShowLocation="true"
:isShowBalanceQty="false" :isShowToLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</view>
</scroll-view>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<!-- <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view> -->
<view class="">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</div>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"
:allowModifyLocation="false">
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
</view>
</template>
<script>
import {
calc
} from '@/common/calc'
import {
customerReturnRequestSubmit,
getBasicCustomerList
} from '@/api/request2.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
updateTitle,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReturnRecord from '@/pages/customerReturn/coms/comReturnRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default {
components: {
winScanButton,
winScanPack,
comReturnRecord,
requiredLocation,
comBlankView,
winScanLocation,
comMessage,
winScanPackAndLocation,
recordComDetailCard
},
data() {
return {
id: '',
scanCount: 0,
dataContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
businessType: {},
fromLocationCode: "",
fromLocation: {},
toLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
toWarehouseCode: '',
customerCode: '',
showCustomer: false,
customerList: [],
customerName: "请选择退货客户",
customerCode: ""
};
},
onLoad(option) {
var typeCode = "CustomerReject"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
getBasicCustomerList().then(res => {
if (res.data.length > 0) {
var list = res.data;
list.forEach(item => {
item.label = item.name
item.value = item.code
})
this.customerList = list;
}
}).catch(error => {
})
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {
},
methods: {
getScanResult(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.customerName == ""||this.customerName == "请选择退货客户") {
this.showErrorMessage("请选择退货客户")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
//退hold
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
customerReturnRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成客户退货申请<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = 'HOLD';
submitItem.fromPackingNumber = detail.packingNumber;
submitItem.toPackingNumber = detail.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = detail.batch;
submitItem.toBatch = detail.batch;
submitItem.qty = detail.handleQty;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = 'HOLD';
submitItem.package = ""
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.customerCode = this.customerCode;
this.dataContent.fromWarehouseCode = this.fromLocation.warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData()
})
},
clearData() {
this.fromLocationCode = '';
this.fromLocation = ''
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
this.customerName ="请选择退货客户"
this.customerCode =""
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
},
confirmSelect(e) {
this.customerName = e[0].label
this.customerCode = e[0].value
},
showSelect() {
this.showCustomer = true
},
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

127
pages/customerReturn/request/customerReturnRequestDetail.vue

@ -1,127 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<request-top :dataContent="requestContent"></request-top>
</view>
<view class="header_item">
客户代码 : {{requestContent.customerCode}}
</view>
<u-line color="#D8D8D8" />
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRequestDetailCard :dataContent="item"
@openDetail="openDetail">
</comRequestDetailCard>
</view>
</view>
</scroll-view>
</view>
<requestDetailInfoPopup ref="jobDetailPopup"></requestDetailInfoPopup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getCustomerReturnRequestDetail,
} from '@/api/request2.js';
import {
goHome,
} from '@/common/basic.js';
import {
getDataSource,
} from '@/common/detail.js';
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
import requestDetailInfoPopup from '@/pages/customerReturn/coms/requestDetailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import requestTop from "@/mycomponents/request/requestTop.vue"
export default {
components: {
comRequestDetailCard,
requestDetailInfoPopup,
comMessage,
requestTop
},
data() {
return {
id: '',
requestContent: {}, //
subList: [], //details
detailSource: [], //
};
},
onLoad(option) {
this.id = option.id;
this.getDetail();
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getCustomerReturnRequestDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.requestContent = res.data;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
openDetail(item) {
this.$refs.jobDetailPopup.openPopup(item)
},
}
}
</script>
<style scoped lang="scss">
</style>

172
pages/deliver/coms/comDeliverDetailCard.vue

@ -1,172 +0,0 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
</template>
<u-line />
<view v-for="(loacation,index) in item.Locations">
<view>
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs">
<recommend-balance style='margin-left: 20px;' :detail="batch"
:isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;">
实际
</view>
<view class="uni-flex uni-column" style="width: 100%;">
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import {
getDetailOption,
getEditRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
components: {
itemQty,
recommend,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
balanceQtyEdit,
location,
comMessage,
detailInfoPopup
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, index)
}
},
edit(batch, item) {
let that = this;
that.editItem = item;
that.batchItem = batch;
item.balance.balanceQty=item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(batch, record, index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
confirm(val) {
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
}
}
}
</script>
<style>
</style>

297
pages/deliver/coms/comDeliverRequestPopup.vue

@ -1,297 +0,0 @@
<template>
<view class="">
<uni-popup ref="popup" :maskClick="false">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeRequestPopup()"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; ">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row padding title u-col-center">
<text>客户 : </text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{customerName}}
</view>
<u-select v-model="showCustomer" mode="single-column" :list="customerList"
@confirm="confirmSelect"></u-select>
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>物料 : </text>
<view class="uni-flex u-col-center uni-row">
<u-input v-model="itemCode" :focus="itemCodeFocus" :border="true"
placeholder="请输入需求物料" @confirm="itemCodeConfirm" />
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 10rpx;" @click="itemCodeClick">
</image>
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<!-- <view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view> -->
</view>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
<selectList ref='selectList' @selectedItem="selectedItem"></selectList>
</view>
</template>
<script>
import {
getBasicLocationByCode,
getBasicItemByCode,
getProductionlineItem,
getWorkShopLineStation,
getBasicCustomerList,
} from '@/api/request2.js';
import {
getLocationTypeName,
getListLocationTypeDesc,
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import selectList from '@/mycomponents/popup/selectList.vue'
export default {
components: {
uom,
balanceStatus,
comMessage,
selectList
},
data() {
return {
// itemCode: 'CE115F11161AG',
itemCode: '',
itemName: "",
qty: 0,
itemCodeFocus: false,
requestInfo: null,
itemCodeList: [],
isCheckItemCode: false,
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "",
showCustomer: false,
isModifiedPosition: true,
customerList: [],
customerName: "请选择客户",
customerCode:"",
maxlength:10,
stdPackInfo:undefined
}
},
props: {
title: {
type: String,
default: '需求信息'
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
this.change(value)
},
openRequestPopup(editPosition) {
if (this.customerList.length == 0) {
getBasicCustomerList().then(res => {
if (res.data.length > 0) {
var list = res.data;
list.forEach(item => {
item.label = item.name
item.value = item.code
})
this.customerList = list;
}
}).catch(error => {
})
}
this.editPosition = editPosition;
if (this.isModifiedPosition) {
this.isModifiedPosition = false
} else {
this.itemCode = "";
this.uom = ""
this.qty = 0
this.counQty =undefined;
this.itemCodeGetFocus();
}
this.$refs.popup.open('bottom')
},
closeRequestPopup() {
this.$refs.popup.close()
},
locationConfirm() {
//
this.checkLocatioCode();
},
itemCodeClick() {
if (this.customerName == "请选择客户") {
this.showErrorMessage("请选择客户")
return
}
this.$refs.selectList.queryList(this.customerCode)
},
itemCodeGetFocus() {
this.itemCodeFocus = true;
},
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() {
if (this.itemCode == "" || !this.isCheckItemCode) {
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
}
this.callback('add');
},
confirmSelect(e){
this.customerName = e[0].label
this.customerCode = e[0].value
},
checkItemCode() {
//
getBasicItemByCode(this.itemCode).then(res => {
uni.hideLoading();
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到物料【' + this.itemCode + '】', "itemCode");
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "itemCode");
})
},
callback(action) {
let item = {
customerName :this.customerName,
customerCode:this.customerCode,
itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom,
qty: this.qty
};
this.closeRequestPopup();
this.$emit("confirm", action, item);
},
showErrorMessage(message, type) {
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (type == "itemCode") {
this.itemCodeGetFocus();
} else {
this.numberFocus = true;
}
})
if (type == "itemCode") {
this.itemCode = ""
this.isCheckItemCode = false;
}
})
},
itemCodeConfirm() {
this.checkItemCode();
},
change(value) {
this.qty = value;
},
cancel(e) {
this.closeRequestPopup();
},
showSelect() {
if (this.editPosition) {
this.showCustomer = true
}
},
}
}
</script>
<style lang="scss">
.title {
font-size: 30rpx;
}
</style>

531
pages/deliver/coms/comScanDeliverPack.vue

@ -1,531 +0,0 @@
<template>
<view>
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描箱码
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
padding:20rpx;
border-radius: 8rpx;">
<view class="uni-center">
位置 :
</view>
<view class="" style="width: 75%;padding: 0rpx">
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 15rpx;font-size: 30rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList" :defaultValue="defaultValueList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
margin-top: 8rpx;
border-radius: 8rpx;">
<view class="uni-center" style="width: 25%; ">
来源库位
</view>
<view class="" style="width: 75%; padding: 8rpx;">
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate"></uni-combox>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:headerType="headerType" :isShowHistory="false">
</win-com-scan>
<view style="width: 100%;">
<view style="width: 100%;" v-if="issueRecord.length>0">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
</view>
<view class="" style="padding-right: 10rpx;">
<u-icon :name="expendIcon" size="35rpx" @click="expands()"></u-icon>
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'>
</u-line>
<scroll-view scroll-y="true" class="scroll-view"
v-if="expand&&issueRecord.length>0">
<view class="uni-flex u-col" v-for="(record,index) in issueRecord">
<view style="width: 100%;">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowLocation="false"
:isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line class='line_color'></u-line>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<com-message ref="comMessage"></com-message>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
</view>
</template>
<script>
import comMessage from '@/mycomponents/common/comMessage.vue'
import winComScan from '@/mycomponents/scan/winComScan.vue'
import balance from '@/mycomponents/balance/balance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getDetailOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
calc
} from '@/common/calc.js';
import {
getWorkShopLineStation
} from '@/api/request2.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
export default {
name: 'winScanPack',
components: {
comMessage,
winComScan,
balance,
balanceQtyEdit,
balanceSelect
},
props: {
title: {
type: String,
default: ''
},
headerType: {
type: String,
default: "HPQ,HMQ"
},
},
data() {
return {
dataContent: {},
jobContent: {},
expendIcon: 'arrow-down',
show: false,
scanList: [],
toLocation: null,
toLocationCode: '',
fromLocationList: [],
fromLocationCode: '',
fromLocation: null,
issueRecord: [], //
expand: true,
scanOptions: {},
editItem: {},
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
label: {},
fromInventoryStatuses: "",
packageInfo: {}
}
},
created() {
},
watch: {},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
"-" + this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom');
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("closeScan")
//
// Object.assign(this.$data, this.$options.data());
},
initData() {
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
}
},
showBalanceSelect(items, packageInfo) {
this.packageInfo = packageInfo;
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) {
location.Items.forEach(item => {
item.Locations.forEach(f => {
list.push(f.fromLocationCode)
})
})
this.fromLocationCode = list[0];
return list;
} else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => {
this.toLocationCode = '';
});
}
},
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
if (location == undefined) {
this.fromLocationCode = ''
this.showErrorMessage('发货库位【' + fromlocation + '】不存在')
}
},
onScan(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细',
res => {
that.getfocus();
}
)
return;
} else {
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.label = result.label;
this.showBalanceSelect(balanceRes.data.list, packageInfo);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
afterGetBalance(label, balance, packageInfo) {
try {
let that = this;
let itemCode = label.itemCode;
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
if (batch.Records == undefined) {
batch.Records = [];
}
let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) {
//
if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
that.getfocus();
}
)
}
}
} else {
that.addRecord(batch, label, balance, packageInfo)
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => {
that.getfocus();
}
)
}
} else {
if (this.jobContent.AllowModifyBatch == null) {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发货明细,是否要继续发货?', res => {
if (res) {
let batch = that.createBatchInfo(label, balance);
fromLocation.Batchs.unshift(batch);
}
})
} else {
that.showErrorMessage('未查找到批次【' + lot + '】的发货明细',
res => {
that.getfocus();
});
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发货明细',
res => {
that.getfocus();
}
)
}
} catch (e) {
that.showErrorMessage(e.stack,
res => {
that.getfocus();
}
)
}
},
createBatchInfo(data, balance) {
let batch = {
batch: data.lot,
qty: 0,
uom: data.uom,
handleQty: Number(data.qty),
Records: []
}
let record = this.creatRecord(data, balance);
batch.Records.push(record);
this.issueRecord.unshift(record)
return batch;
},
creatRecord(label, balance, packageInfo) {
balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit
let record = {
itemCode: label.itemCode,
packingNumber: label.packingNumber,
batch: label.batch,
qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode
}
return record;
},
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty = calc.add(handleQty,res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
expands() {
this.expand = !this.expand;
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up"
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
// item.balance.balanceQty = item.balance.qty;
item.balance.balanceQty = item.balance.qty;
this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(record, index) {
this.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
record.qty = 0;
this.issueRecord.splice(index, 1)
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch);
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r
.batch == record.batch);
batch.Records.splice(rIndex, 1);
})
}
this.$emit('updateData', item);
}
});
},
packGetFocus() {
this.$refs.comscan.getfocus();
},
packLoseFocus() {
this.$refs.comscan.losefocus();
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback);
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, callback);
})
},
confirm(val) {
this.editItem.qty = Number(val);
this.$emit('updateData', this.editItem)
},
cancle() {
this.closeScanPopup()
}
}
}
</script>
<style lang="scss">
button {
border: none;
}
button::after {
border: none
}
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
padding: 10rpx;
}
</style>

464
pages/deliver/job/deliverDetail.vue

@ -1,464 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="header_item">
申请单号{{jobContent.requestNumber}}
</view>
<u-line color="#D8D8D8"></u-line>
<view class="cen_card" style="padding: 5rpx;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">客户代码</view>
<view>{{jobContent.customerCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">客户寄售库</view>
<view>{{toLocationCode}}</view>
</view>
</view>
<u-line />
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCard ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</comDeliverDetailCard>
</view>
</scroll-view>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getDeliverDetail,
getBasicLocationByCode,
takeDeliverJob,
cancleTakeDeliverJob,
deliverJobSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
updateTitle,
navigateBack,
getRemoveOption,
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDeliverDetailCard from '@/pages/deliver/coms/comDeliverDetailCard.vue'
import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comDeliverDetailCard,
comScanDeliverPack,
comMessage,
jobTop
},
data() {
return {
id: '',
jobContent: {}, //
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
status: "",
toLocationCode: "",
jobStatus:""
};
},
props: {
},
onLoad(option) {
this.id = option.id;
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
//
cancleTakeDeliverJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeDeliverJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getDeliverDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode = that.subList[0].toLocationCode
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//使
if (locationCode == null) {
this.submitJob();
} else {
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
deliverJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发货记录" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
if (this.toLocationCode ==null) {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
subItem.recordList.push(record);
})
subList.push(subItem);
}
})
})
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
cancel() {
let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {
if (res) {
that.clearInfo();
}
});
},
clearInfo() {
this.dataContent.itemCodeList.forEach(res => {
if (res.recommendList != null) {
res.recommendList.forEach(res1 => {
if (res1.locationCodeList != null) {
res1.locationCodeList.forEach(res2 => {
if (res2.packingCodeList != null) {
res2.packingCodeList.forEach(res3 => {
res3.itemCode = "";
res3.qty = 0;
})
}
})
}
})
}
})
},
updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
// item.handleQty=itemHandleQty;
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.scanPopupGetFocus();
},
confirm(data) {
this.dataContent = data;
},
confirmResult(result) {
this.dataContent = result;
this.$forceUpdate();
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
closeScanPopup() {
this.updateCommitBtn();
},
}
};
</script>
<style scoped lang="scss">
.uni-numbox__value {
width: 40px;
}
button[disabled] {
background-color: #3C9CFF;
color: #fff;
opacity: 0.7;
}
// /deep/ .input-value {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item__title-text {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 0px;
// border-bottom-color: #ebeef5;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 1px;
// border-bottom-color: #ebeef5;
// }
</style>

289
pages/deliver/job/deliverJob.vue

@ -1,289 +0,0 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-deliver-job-card :dataContent="item" @click='openJobDetail(item)'></com-deliver-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getDeliverJobList,
cancleTakeDeliverJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comDeliverJobCard from '@/pages/deliver/coms/comDeliverJobCard.vue'
import jobListPopup from '@/pages/deliver/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/deliver/coms/jobInfoPopup.vue'
export default {
name: 'Deliver',
components: {
comEmptyView,
jobFilter,
comMessage,
comDeliverJobCard,
jobListPopup,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList('refresh');
},
onReady() {
const rightButtonEle2 = document.getElementsByClassName('uni-page-head-btn')[2]
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getDeliverJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.receiptList.concat(list);
this.pageNo++;
updateTitle("制品发货任务(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("制品发货任务");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './deliverDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeDeliverJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getDeliverJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
}
}
}
</script>
<style scoped lang="scss">
</style>

504
pages/deliver/record/deliverRecord.vue

@ -1,504 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</record-com-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="uni-flex uni-row u-col-center" style="width: 100%;">
<view class="" style=" text-align: center;font-size: 32rpx;font-weight: 700;margin-left: 10rpx;">
客户 :
</view>
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择客户" popup-title="选择客户" :localdata="customerList"
@change="reasonChange">
</uni-data-picker>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="true"
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HMQ"></win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
</view>
</template>
<script>
import {
getBasicCustomerList,
deliverRecordSubmit
} from '@/api/request2.js';
import {
goHome,
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default {
components: {
winScanButton,
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
comMessage,
winScanPackAndLocation,
recordComDetailCard
},
data() {
return {
id: '',
subList: [], //subList
detailSource: [], //
locationTypeList: [],
fromLocationCode: "",
toLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
businessType: {},
customerList: [],
customerText: "",
customerCode : "",
dataContent:{},
managementList:[]
};
},
onLoad(option) {
var typeCode = "Deliver"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
getBasicCustomerList().then(res => {
if (res.data.length > 0) {
var list = res.data;
list.forEach(item => {
item.text = item.name
item.value = item.code
})
this.customerList = list;
}
}).catch(error => {
this.showErrorMessage(error)
})
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {},
methods: {
getScanResult(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let labelQty =result.label.qty;
let balanceQty =result.balance.qty;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.getfocus();
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.customerText == "") {
this.showMessage("请先选择客户")
return;
}
console.log("客户", this.customerText)
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
deliverRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品发货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.customerCode = this.customerCode;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
clearData(){
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
},
reasonChange(e) {
if (e.detail.value.length == 0) {
this.customerCode = ""
this.customerText = ""
} else {
this.customerCode = e.detail.value[0].value
this.customerText = e.detail.value[0].text
}
},
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

392
pages/deliver/request/deliverRequest.vue

@ -1,392 +0,0 @@
<template>
<view>
<com-empty-view v-if="requestList.length==0"></com-empty-view>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<com-deliver-request-card :dataContent="item" @click='openRequestDetail(item)'>
</com-deliver-request-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<requestButton @goScan='openScanDetailPopup'></requestButton>
</view>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import requestFilter from '@/mycomponents/request/requestFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comDeliverRequestCard from '@/pages/deliver/coms/comDeliverRequestCard.vue'
import requestInfoPopup from '@/pages/deliver/coms/requestInfoPopup.vue'
import requestButton from '@/mycomponents/button/requestButton.vue'
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDeliverRequestList,
deliverRequestClose,
deliverRequestApprove,
deliverRequestApproveAgree,
deliverRequestApproveRefused,
deliverRequestHandle,
deliverRequestAddAgain
} from '@/api/request2.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndAddAndCloseOption,
getAddAgainOption
} from '@/common/array.js';
export default {
components: {
comEmptyView,
requestFilter,
requiredLocation,
comMessage,
comDeliverRequestCard,
requestInfoPopup,
requestButton
},
data() {
return {
requestList: [],
pageNo: 1,
pageSize: 10,
status: "1,2,3,4,5,6",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndAddAndCloseOption: [],
addAgainOption: [],
showOptions: [],
fromType: "requestType",
loadingType: "nomore",
};
},
onReady() {
this.detailOptions = getDetailOption();
this.addAgainOption = getAddAgainOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndAddAndCloseOption = getDetailAndAddAndCloseOption()
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
onShow() {
this.getList('refresh');
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
mounted() {
},
methods: {
requestConfirm(action, item) {
},
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
openRequestDetail(item) {
uni.navigateTo({
url: './deliverRequestDetail?id=' + item.id
});
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getDeliverRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle("成品发货申请(" + this.totalCount + ")");
}).catch(error => {
updateTitle("成品发货申请");
uni.hideLoading();
that.showMessage(error)
})
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndAddAndCloseOption;
} else if(status == "5"){
this.showOptions = this.addAgainOption;
}else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
openScanDetailPopup() {
uni.navigateTo({
url: "./deliverRequestCreate"
})
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?",res=>{
this.deliverRequestHandle(dataContent.id)
})
} else if (text == "提交审批") {
this.showQuestionMessage("确定要审批当前申请吗?",res=>{
this.deliverRequestApprove(dataContent.id)
})
} else if (text=="审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{
this.deliverRequestApproveAgree(dataContent.id)
})
} else if (text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{
this.deliverRequestApproveRefused(dataContent.id)
})
} else if (text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{
this.deliverRequestClose(dataContent.id)
})
}else if(text == "重新添加"){
this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{
this.deliverRequestAddAgain(dataContent.id)
})
}
},
showQuestionMessage(hint,callBack){
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getDeliverRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
deliverRequestApprove(id) {
deliverRequestApprove(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请提交审批成功"
})
this.getList("refresh")
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
deliverRequestClose(id) {
deliverRequestClose(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请关闭成功"
})
this.getList("refresh")
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
deliverRequestAddAgain(id) {
deliverRequestAddAgain(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请重新添加成功"
})
this.getList("refresh")
} else {
this.showMessage("申请重新添加失败")
}
}).catch(error => {
this.showMessage(error)
})
},
deliverRequestApproveAgree(id) {
deliverRequestApproveAgree(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批通过成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
deliverRequestApproveRefused(id) {
deliverRequestApproveRefused(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批驳回成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
deliverRequestHandle(id) {
deliverRequestHandle(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请处理成功"
})
this.getList("refresh")
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
}
}
</script>
<style>
</style>

200
pages/deliver/request/deliverRequestCreate.vue

@ -1,200 +0,0 @@
<template>
<view class="page-wraper">
<view class="" v-if='detailSource.subList.length==0'>
<com-blank-view @goScan='goScan(true)'></com-blank-view>
</view>
<view v-else class="page-wraper">
<view class="page-main">
<comDeliverRequestCreator ref="deliverRequest" :dataContent="detailSource">
</comDeliverRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
<comMessage ref="comMessage"></comMessage>
</view>
</view>
<comDeliverRequestPopup ref="comDeliverRequestPopup" @confirm='requestConfirm'></comDeliverRequestPopup>
</template>
<script>
import {
deliverRequestSubmit,
issueRecordSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
updateTitle,
getRemoveOption,
getISODateTime
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comDeliverRequestPopup from '@/pages/deliver/coms/comDeliverRequestPopup.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comDeliverRequestCreator from '@/pages/deliver/coms/comDeliverRequestCreator.vue'
export default {
name: 'issueRequestSubmit',
components: {
comBlankView,
comDeliverRequestPopup,
jobDetailPopup,
comMessage,
comDeliverRequestCreator
},
data() {
return {
subList: [], //subList
detailSource: {
subList: []
}, //
detailOptions: [],
scanOptions: [],
fromType: "",
dataContent: {}
}
},
mounted() {
this.goScan(true)
},
onLoad(option) {
this.fromType = option.fromType
},
methods: {
goScan(editPosition) {
this.$refs.comDeliverRequestPopup.openRequestPopup(editPosition);
},
//
requestConfirm(action, item) {
if (this.detailSource.subList.length == 0) {
this.detailSource = {
customerCode: item.customerCode,
customerName: item.customerName,
totalQty: 0,
subList: []
}
var subItem = {
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
} else {
var result = this.detailSource.subList.filter(res => {
if (res.itemCode == item.itemCode &&
res.productionLineCode == item.productionLineCode &&
res.workStationCode == item.workStationCode) {
return res
}
})
//
if (result.length == 0) {
var subItem = {
productionLineCode: item.productionLineCode,
productionLineName: item.productionLineName,
workStationCode: item.workStationCode,
workStationName: item.workStationName, //
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
} else {
//
result[0].qty = calc.add(result[0].qty,item.qty)
}
}
this.caclcQty();
if (this.$refs.deliverRequest != undefined) {
this.$refs.deliverRequest.update()
}
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty = calc.add(totalQty,res.qty)
})
this.detailSource.totalQty = totalQty;
},
setParams() {
return this.detailSource
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setRequestParams()
console.log("提交参数", JSON.stringify(params));
deliverRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成成品发货申请<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setRequestParams() {
let requestContent = {};
requestContent.customerCode = this.detailSource.customerCode;
var subList = []
this.detailSource.subList.forEach(detail => {
subList.push(detail)
})
requestContent.subList = subList;
return requestContent;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './deliverRequest'
})
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
}
}
</script>
<style>
</style>

139
pages/deliver/request/deliverRequestDetail.vue

@ -1,139 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<request-top :dataContent="requestContent"></request-top>
</view>
<view class="header_item">
客户代码 : {{requestContent.customerCode}}
</view>
<u-line color="#D8D8D8" />
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="page-header">
<view class="page-item">
{{detailSource.customerCode}}
</view>
<u-line />
</view>
<view class="detail-list" v-for="(item, index) in detailSource.subList" :key="item.id">
<view class="">
<item-qty :dataContent="item"></item-qty>
<!-- <comRequestDetailCard :dataContent="item" @openDetail="openDetail">
</comRequestDetailCard> -->
</view>
</view>
</scroll-view>
</view>
<requestDetailInfoPopup ref="jobDetailPopup"></requestDetailInfoPopup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getDeliverRequestDetail,
} from '@/api/request2.js';
import {
goHome,
} from '@/common/basic.js';
import {
getDataSource,
} from '@/common/detail.js';
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
import requestDetailInfoPopup from '@/pages/deliver/coms/requestDetailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import itemQty from '@/mycomponents/item/itemQty.vue'
import requestTop from "@/mycomponents/request/requestTop.vue"
export default {
components: {
comRequestDetailCard,
requestDetailInfoPopup,
comMessage,
itemQty,
requestTop
},
data() {
return {
id: '',
requestContent: {}, //
detailSource: [], //
};
},
onLoad(option) {
this.id = option.id;
this.getDetail();
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getDeliverRequestDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
that.detailSource = res.data
that.requestContent = res.data;
// if (res.data.subList.length > 0) {
// that.requestContent = res.data;
// that.subList = res.data.subList;
// that.subList.forEach(res => {
// res.fromLocationCode = res.toLocationCode
// })
// that.detailSource = getDataSource(that.subList);
// debugger;
// } else {
// that.showMessage('0');
// }
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
openDetail(item) {
this.$refs.jobDetailPopup.openPopup(item)
},
}
}
</script>
<style scoped lang="scss">
</style>

705
pages/demo/demo.vue

@ -1,705 +0,0 @@
<template>
<view class="" style="width: 100%;">
<view class="">
公共组件
</view>
<u-gap height="10" bg-color="#bbb"></u-gap>
<button @click="takePhoto"> 拍照</button>
<view class="">
<view class="title-1">
按钮组件
</view>
<view class="">
<view class="" style="font-size: 35rpx; padding: 10rpx;">
页面按钮
</view>
<div class="">
<view class="" style="display: flex;flex-direction: row;">
<view class="">
<button class="btn_clear" style="button" hover-class="btn_clear_after" @click="">清空</button>
</view>
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="">提交</button>
</view>
</view>
</div>
<view class="" style="font-size: 35rpx; padding: 10rpx;">
弹出页按钮
</view>
<view class="uni-flex uni-row test">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="">确认</button>
</view>
<!-- <view class="" style="font-size: 35rpx; padding: 10rpx;">
去添加
</view>
<view>
<button style="margin-top: 30rpx;" class="btn_add_small" hover-class="btn_add_small_after"> +
去添加</button>
</view>
-->
<view class="" style="font-size: 35rpx; padding: 10rpx;">
去扫描
</view>
<view>
<com-blank-view @goScan='goScan'></com-blank-view>
</view>
<view class="" style="font-size: 35rpx; padding: 10rpx;">
扫描按钮
</view>
<view>
<win-scan-button @goScan='goScan'></win-scan-button>
</view>
</view>
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<view class="">
<view class="" style=" font-size: 40rpx; padding: 20rpx;font-weight: 600;">
扫描组件
</view>
<view class="">
<button @click="openScanPopup">扫描箱码</button>
<winScanPack ref="scanPopup" :title="'箱码'"></winScanPack>
</view>
<view class="">
<button @click="openScanLocation">扫描库位</button>
<winScanLocation ref="scanLocationCodePopup" :title="'收货库位'"></winScanLocation>
</view>
<view class="">
<button @click="openScanNumber">扫描任务编号</button>
<winScanJobNumber ref="scanNumber" :title="'任务编号'"></winScanJobNumber>
</view>
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<!-- 任务组件 -->
<view>
<view class="title-1">
任务组件
</view>
<view style="uni-flex uni-col ">
<view>
<view class="title-2">任务编号 - jobNumer</view>
<view class="view-com">
<job-number :number="jobDataContent.Number"></job-number>
</view>
</view>
<view>
<view class="title-2">任务状态 - jobStatus</view>
<view class="view-com">
<job-status :jobStatus="jobDataContent.status"></job-status>
</view>
</view>
<view>
<view class="title-2">任务顶部 - jobTop</view>
<view class="view-com">
<job-top :dataContent="jobDataContent"></job-top>
</view>
</view>
<view>
<view class="title-2">任务底部 - jobBottom</view>
<view class="view-com">
<job-bottom :dataContent="jobDataContent"></job-bottom>
</view>
</view>
<view>
<view class="title-2">任务其它属性 - jobProperty</view>
<view class="view-com">
<job-property></job-property>
</view>
</view>
<view>
<view class="title-2">任务卡片 - jobCard</view>
<view class="view-com">
<job-card :dataContent="jobDataContent"></job-card>
</view>
</view>
</view>
</view>
<!-- 数量组件 -->
<u-gap height="5" bg-color="#bbb"></u-gap>
<view>
<view class="title-1">
数量组件
</view>
<view style="uni-flex uni-col ">
<view class="">
<button @click="openRecommendQtyEdit">任务数量编辑 recommendQtyEdit</button>
<recommend-qty-edit ref="recommendQtyEdit" :dataContent="detailDataContent"
:handleQty="recordDataContent.qty">
</recommend-qty-edit>
</view>
<view class="">
<button @click="openBalanceQtyEdit">库存数量编辑 balanceQtyEdit</button>
<balance-qty-edit ref="balanceQtyEdit" :dataContent="balancDataContent"></balance-qty-edit>
</view>
</view>
<view class="">
<view class="uni-flex uni-column content">
<text>数量组件通用属性</text>
<text> isShowStatus:显示状态</text>
<text> isShowStdPack:显示标包</text>
</view>
<view class="title-2">默认数量 qty</view>
<view class="view-com">
<view class="uni-flex uni-row ">
<qty :dataContent='detailDataContent' :isShowStdPack="false"></qty>
</view>
</view>
<view class="title-2">推荐数量 recommendQty</view>
<view class="view-com">
<view class="uni-flex uni-row ">
<recommend-qty :dataContent="detailDataContent" :isShowStatus="true"></recommend-qty>
</view>
</view>
<view class="title-2">对比数量 compareQty</view>
<view class="view-com">
<view class="uni-flex uni-row ">
<compare-qty :dataContent="detailDataContent" :recommendQty="detailDataContent.qty"
:handleQty="100" :isShowStatus="true">
</compare-qty>
</view>
</view>
</view>
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<!-- 物料组件 -->
<view>
<view class="title-1">
物料组件
</view>
<view class="">
<view class="title-2">物料 item</view>
<view class="view-com">
<view class="uni-flex uni-row ">
<item :dataContent="detailDataContent"></item>
</view>
</view>
<view class="title-2">物料数量 itemQty</view>
<view class="view-com">
<item-qty :dataContent="detailDataContent" :handleQty="recordDataContent.qty"></item-qty>
</view>
<view class="title-2">物料数量 itemQty</view>
<view class="view-com">
<partCodeSelect :list="list"></partCodeSelect>
</view>
</view>
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<view>
<view class="title-1">
卡片组件
</view>
<view class="">
<view class="title-2">箱码 pack</view>
<view class="view-com">
<pack :packingCode="detailDataContent.packingNumber"></pack>
</view>
<view class="title-2">托码 暂无</view>
<view class="view-com">
</view>
<view class="title-2">批次 batch</view>
<view class="view-com">
<batch :batch="detailDataContent.batch"></batch>
</view>
<view class="title-2">库位 location</view>
<view class="view-com">
<location :locationCode="detailDataContent.fromLocationCode"></location>
</view>
<view class="title-2">推荐卡片 recommend</view>
<view class="view-com">
<recommend :detail="detailDataContent" :isScaned="false"></recommend>
</view>
<view class="title-2">推荐卡片/实际/已扫描 recommend</view>
<view class="view-com">
<recommend :detail="detailDataContent"></recommend>
</view>
<view class="title-2">库存卡片 balance</view>
<view>
<radio-group>
<radio class="title-2" checked="true" @click="compareQtyClick">对比数量</radio>
<radio class="title-2" @click="defaultQtyClick">默认数量</radio>
</radio-group>
</view>
<view class="view-com">
<balance :dataContent="detailDataContent"></balance>
</view>
<view class="title-2">单箱管理 </view>
<view class="view-com">
<balance :dataContent="detailDataContent"></balance>
</view>
<view class="title-2">批次管理 </view>
<view class="view-com">
<balance :dataContent="detailDataContent" :isShowPack="false"></balance>
</view>
<view class="title-2">批量管理 </view>
<view class="view-com">
<balance :dataContent="detailDataContent" :isShowPack="false" :isShowBatch="false"
:isShowStdPack="false"></balance>
</view>
</view>
</view>
<u-gap height="10" bg-color="#bbb"></u-gap>
<view class="">
<view class="title-1">
消息框-comMessage
</view>
<view>
<u-button @click="openMessage">
信息提示弹窗-showMessage
</u-button>
<u-button @click="openSuccess">
成功提示弹窗-showSuccessMessage
</u-button>
<u-button @click="openError">
错误提示弹窗-showErrorMessage
</u-button>
<u-button @click="openWarn">
警告提示弹窗-showWarningMessage
</u-button>
<u-button @click="openGray">
问题选择弹窗-showQuestionMessage
</u-button>
<com-message ref="message"></com-message>
</view>
</view>
<view class="">
<view class="title-1">
库存状态组件-balanceStatus
</view>
<view class="view-com">
<status status="kcztINSP"></status>
<balance-status ref="balanceStatus" status="kcztINSP"></balance-status>
</view>
</view>
<view class="">
<view class="title-1">
物料状态组件-itemStatus
</view>
<view class="uni-flex uni-row space-between" style="margin:20rpx">
<item-status status="wpztENABLE"></item-status>
<item-status status="wpztHOLD"></item-status>
<item-status status="wpztNEW"></item-status>
<item-status status="wpztPLAN"></item-status>
</view>
</view>
<u-gap height="10" bg-color="#bbb"></u-gap>
<view class="">
<view class="" style=" font-size: 40rpx; padding: 20rpx;font-weight: 600;">
无数据
</view>
<comEmptyView></comEmptyView>
</view>
<u-gap height="10" bg-color="#bbb"></u-gap>
<view class="">
<view class="" style=" font-size: 40rpx; padding: 20rpx;font-weight: 600;">
库位相关组件
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<u-gap height="5" bg-color="#bbb"></u-gap>
<view class="">
<view class="" style="font-size: 35rpx; padding: 10rpx;">
选择库位
</view>
<locationDrop :listLode="listLode"></locationDrop>
<view class="" style="font-size: 35rpx; padding: 100rpx;">
下拉列表
<pullDown label="所在城市市111" @change="change" v-model="value1" :options="candidates1"
@confirm="pullDownConfirm" :height="100" />
</view>
<pullDown label="所在城市市111" @change="change" v-model="value1" :options="candidates2" :isSearch="true"
@confirm="pullDownConfirm" />
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
</view>
<u-gap height="10" bg-color="#bbb"></u-gap>
</view>
</template>
<script>
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import locationDrop from '@/mycomponents/location/locationDrop.vue'
import partCodeSelect from '@/mycomponents/partCode/partCodeSelect.vue'
import partCode from "@/mycomponents/partCode/partCode.vue"
import winScanJobNumber from "@/mycomponents/scan/winScanJobNumber.vue"
import jobNumber from '@/mycomponents/job/jobNumber.vue'
import jobStatus from '@/mycomponents/job/jobStatus.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import jobBottom from '@/mycomponents/job/jobBottom.vue'
import jobProperty from '@/mycomponents/job/jobProperty.vue'
import jobCard from '@/mycomponents/job/jobCard.vue'
import qty from '@/mycomponents/qty/qty.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
import item from '@/mycomponents/item/item.vue'
import itemQty from '@/mycomponents/item/itemQty.vue'
import itemStatus from '@/mycomponents/item/itemStatus.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import batch from '@/mycomponents/balance/batch.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import status from '@/mycomponents/status/status.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import statusEdit from '@/mycomponents/status/statusEdit.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
export default {
components: {
winScanPack,
winScanJobNumber,
comEmptyView,
jobFilter,
locationDrop,
partCodeSelect,
partCode,
jobNumber,
jobStatus,
jobTop,
jobBottom,
jobProperty,
jobCard,
qty,
recommendQty,
compareQty,
recommendQtyEdit,
balanceQtyEdit,
item,
itemQty,
itemStatus,
pack,
batch,
location,
balance,
recommend,
comMessage,
status,
balanceStatus,
statusEdit,
comBlankView,
winScanButton,
winScanLocation
},
data() {
return {
value1: '',
candidates1: ['北京1', '南京1', '东京1', '西京1'],
candidates2: ['北京', '南京', '东京', '西京'],
jobDataContent: {
Number: '0000001',
status: "JOB_PENDING",
creatorName: 'admin',
creationTime: '2023-07-27 10:30:00'
},
detailDataContent: {
itemCode: "LJH16540NAA",
itemName: "门板金属螺丝钉",
itemDesc1: "门板金属螺丝",
stdPackQty: 1000,
stdPackUnit: '箱',
uom: 'EA',
qty: 3000,
inventoryStatus: 2,
packingNumber: "516456579",
batch: "20230510",
fromLocationCode: "B0101",
locationCode: "B0101",
record: {
qty: 1000
}
},
recordDataContent: {
itemCode: "LJH16540NAA",
itemName: "门板金属螺丝钉",
itemDesc1: "门板金属螺丝",
stdPackQty: 1000,
stdPackUnit: 'EA',
uom: 'EA',
qty: 500,
inventoryStatus: 2,
packingNumber: "516456579",
batch: "20230510",
toLocationCode: "B0101",
},
balancDataContent: {
itemCode: "LJH16540NAA",
itemName: "门板金属螺丝钉",
itemDesc1: "门板金属螺丝",
stdPackQty: 1000,
stdPackUnit: 'EA',
uom: 'EA',
qty: 1000,
UsableQty: 500,
inventoryStatus: 2,
packingNumber: "516456579",
batch: "20230510",
locationCode: "B0101",
},
dataList: [{
title: "供应商",
content: "一汽富维东阳"
},
{
title: "订单号",
content: "1652899744"
},
{
title: "到货单",
content: "05689113577"
},
{
title: "发货单",
content: "96851521215"
},
{
title: "要货计划单",
content: "558484812"
},
{
title: "预计到货时间",
content: "2022/02/22 9:58:00"
},
{
title: "时间窗口",
content: "2022/02/25 11:3:00"
}
],
listLode: [{
value: 1,
label: '库区',
children: [{
value: 2,
label: '库位组',
children: [{
value: 3,
label: 'D0101'
},
{
value: 4,
label: 'D0202'
}
]
},
{
value: 5,
label: 'KQ1',
children: [{
value: 6,
label: 'KW2'
},
{
value: 7,
label: 'D2525'
}
]
}
]
},
{
value: 8,
label: 'KQ2',
children: [{
value: 9,
label: 'KWZ2',
children: [{
value: 10,
label: 'D3000'
}]
}]
}
],
list: [{
value: 1,
label: 'LJH1654005NAA'
},
{
value: 2,
label: 'VC800D0A411AB'
}
],
};
},
onLoad() {},
methods: {
change(index, item) {
this.$u.toast(`点击了第${index}项---${item}`);
},
goScan() {
this.$u.toast(`弹出扫描窗体`);
},
pullDownConfirm(item) {
this.$u.toast(`回车校验---${item}`);
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
openScanLocation() {
this.$refs.scanLocationCodePopup.openScanPopup();
},
openRecommendQtyEdit() {
this.$refs.recommendQtyEdit.openEditPopup()
},
openBalanceQtyEdit() {
this.$refs.balanceQtyEdit.openEditPopup()
},
stockCountEditBtn() {
this.$refs.stockCountEdit.openScanPopup()
},
updateState(state) {
this.state = state;
},
filter() {
this.$refs.filter.openFilter();
},
defaultQtyClick() {
this.detailDataContent.record.qty = 0;
},
compareQtyClick() {
this.detailDataContent.record.qty = 1000;
},
scanedClick() {
this.detailDataContent.scaned = true;
},
unScanedClick() {
this.detailDataContent.scaned = false;
},
openMessage() {
this.$refs.message.showMessage("消息", res => {
});
},
openSuccess() {
this.$refs.message.showSuccessMessage("提交成功", res => {
});
},
openWarn() {
this.$refs.message.showWarningMessage("警告对话框", res => {
});
},
openError() {
this.$refs.message.showErrorMessage("库存余额不足", res => {
});
},
openGray() {
this.$refs.message.showQuestionMessage("是否确定", res => {
this.$u.toast(`点击了` + res);
});
},
openScanNumber() {
this.$refs.scanNumber.openScanPopup()
},
takePhoto() {
uni.chooseImage({
count: 6, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //album camera 使
success: function(res) {
console.log(JSON.stringify(res.tempFilePaths)); //
}
});
}
}
}
</script>
<style lang="scss">
.content {
font-size: 30rpx;
padding: 20rpx;
}
.title-1 {
font-size: 40rpx;
font-weight: 600;
padding: 20rpx;
}
.title-2 {
font-size: 30rpx;
font-weight: 600;
padding: 20rpx;
}
.view-com {
padding: 0rpx 20rpx;
}
</style>

496
pages/index/index.vue

@ -1,496 +0,0 @@
<template>
<view class="u-wrap">
<!-- <view class="u-search-box"> -->
<!-- <view class="u-search-inner">
<u-icon name="search" color="#909399" :size="28"></u-icon>
<text class="u-search-text">搜索</text>
</view> -->
<!-- </view> -->
<view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
:scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
@scroll="rightScroll">
<view class="page-view" style="margin-bottom: 200rpx;">
<view class="class-item" :id="'item' + index" v-for="(item , index) in tabbar" :key="index">
<view class="item-title">
<text>{{item.name}}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item.children" :key="index1"
@click="openCheck(item1.path)">
<view class="" style="position: relative; ">
<!-- <u-badge class="item-menu-badge" v-if="item1.count>0" type="error" :count="item1.count" :offset="position"
:showZero="false"></u-badge> -->
<text class="item-menu-badge"
v-if="item1.count>0">{{item1.count>9?'9+':item1.count}}</text>
<image class="item-menu-image" :src="'/static/menus/'+item1.componentName" mode="">
</image>
<view class="">
<text class="item-menu-name">{{item1.name}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getDictionaryItem,
getMainMessage
} from '@/api/request2.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import classifyData from '@/common/classify.data.js';
import {
useStore
} from "vuex" //vuex
export default {
components: {
comMessage
},
data() {
return {
title: 'WMS仓库管理系统',
scrollTop: 0, //tab
oldScrollTop: 0,
current: 0, //
menuHeight: 0, //
menuItemHeight: 0, // item
itemId: '', // scroll-viewid
tabbar: [],
menuItemPos: [],
arr: [],
scrollRightTop: 0, // scroll-view
timer: null, //
forcedLogin: false,
count: 1,
position: [-10, -10],
timer: null,
menusCount: {}
}
},
onLoad() {
if (sessionStorage.getItem("hasLogin")) {
uni.showLoading({
title: "正在获取菜单...",
mask: true
})
this.$store.dispatch('getPermissionInfo').then(res => {
uni.hideLoading()
if (res.menus.length > 0) {
var menus = res.menus.filter(item => item.name == "PDA菜单管理")
if (menus.length > 0) {
var tab = menus[0].children.filter(res => res.visible == true)
tab.forEach(res => {
for (var i = 0; i < res.children.length; i++) {
if (res.children[i].visible == false) {
res.children.splice(i, 1)
}
}
})
this.tabbar = tab;
var i = 0;
this.tabbar.forEach(res => {
res.children.forEach(res => {
i++
console.log(res.name, i)
})
})
this.getDictory()
this.timerRefresh();
} else {
this.showMessage("获取菜单失败")
}
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
});
}
},
onReady() {
if (sessionStorage.getItem("hasLogin")) {
this.getMenuItemTop()
}
},
onHide() {
this.stopRefresh();
},
onShow() {
if (sessionStorage.getItem("hasLogin") == null || sessionStorage.getItem("hasLogin") == false) {
uni.showModal({
title: '未登录',
content: '您未登录 , 需要登录后才能继续', //
showCancel: !this.forcedLogin,
success: (res) => {
if (res.confirm) {
//使reLanch
if (this.forcedLogin) {
uni.reLaunch({
url: '../login/index'
})
} else {
uni.navigateTo({
url: '../login/index'
})
}
}
}
})
} else {
this.timerRefresh();
}
},
onUnload() {
this.stopRefresh();
},
mounted() {},
methods: {
timerRefresh() {
this.getMainMessage();
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getMainMessage();
console.log('刷新菜单');
}, 1000 * 60)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getMainMessage() {
getMainMessage().then(res => {
this.menusCount = res.data;
this.tabbar.forEach(item => {
item.children.forEach(rightItem => {
var count = this.menusCount[rightItem.component]
if (count != undefined) {
rightItem.count = count;
}
})
})
this.$forceUpdate()
}).catch(res=>{
console.log("获取消息失败",res)
});
},
findList(tab) {
let res = null
for (let i = 0; i < tab.length; i++) {
if (tab[i].visible === true) {
res = tab[i]
return tab[i]
} else if (tab[i].children && tab[i].children.length > 0) {
res = findList(tab[i].children)
}
if (res) break
}
return res
},
//
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
this.scrollRightTop = this.arr[index];
this.current = index;
this.leftMenuStatus(index);
})
},
//
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({
size: true
}, res => {
// resnull
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
resolve();
}).exec();
})
},
//
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// scroll-viewiditemxxright-box
// .right-box
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
})
},
//
async leftMenuStatus(index) {
this.current = index;
// 0
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// item
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
// item
getMenuItemTop() {
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
// rects[](selectAll)
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop();
}, 10);
return;
}
rects.forEach((rect) => {
// rects[0].top()
this.arr.push(rect.top - rects[0].top);
resolve();
})
}).exec()
})
},
//
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
setTimeout(() => { //
this.timer = null;
// scrollHeight
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i];
let height2 = this.arr[i + 1];
// height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i);
return;
}
}
}, 10)
},
getDictory() {
var params = {
types: ["job_status", "location_type", "item_status","item_type","uom",
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",
"count_stage","inspect_result"
]
}
getDictionaryItem(params).then(res => {
if (res.data.length > 0) {
uni.setStorageSync("dictionary", res.data)
}
}).catch(res=>{
console.log("获取字典失败",res)
})
},
openCheck(url) {
uni.navigateTo({
url: "/" + url
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
.u-search-box {
padding: 18rpx 30rpx;
}
.u-menu-wrap {
flex: 1;
display: flex;
overflow: hidden;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: $u-tips-color;
margin-left: 10rpx;
}
.u-tab-view {
width: 180rpx;
height: 100%;
}
.u-tab-item {
height: 110rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #000;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: "";
position: absolute;
border-left: 4px solid $u-type-primary;
height: 32rpx;
left: 0;
top: 39rpx;
}
.u-tab-view {
height: 100%;
}
.right-box {
background-color: rgb(250, 250, 250);
}
.page-view {
padding: 16rpx;
}
.class-item {
margin-bottom: 30rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.class-item:last-child {
min-height: 100vh;
}
.item-title {
font-size: 32rpx;
color: $u-main-color;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 28rpx;
color: $u-main-color;
width: 120rpx;
// word-wrap: break-word;
// word-break: break-all;
// white-space: pre-wrap;
}
.item-container {
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
text-align: center;
}
.item-menu-image {
width: 32px;
height: 32px;
}
.item-menu-badge {
width: 36rpx;
height: 36rpx;
align-items: center;
// top: -5px;
// right: -5px;
font-size: 0.6rem;
background-color: #fa3534;
position: absolute;
right: 0;
color: #fff;
text-align: center;
line-height: 36rpx;
border-radius: 50%;
}
</style>

156
pages/inspect/coms/comInspectDetailCard.vue

@ -1,156 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)">
<recommend :detail="item" ></recommend>
<view :class="item.scaned?'scan_view':'' ">
<view class="" style="font-size: 30rpx;">
不合格数量 : {{item.FailedQty}}
</view>
<view class="" style="font-size: 30rpx;margin-top: 10rpx;">
不合格原因 : {{item.FailedReason}}
</view>
</view>
<u-line />
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<inspectQtyEdit ref="qtyEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</inspectQtyEdit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="message"></comMessage>
</view>
</template>
<script>
import Batch from "@/mycomponents/Batch/Batch.vue"
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import inspectQtyEdit from '@/mycomponents/qty/inspectQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption
} from '@/common/array.js';
export default {
components: {
Batch,
itemQty,
recommend,
inspectQtyEdit,
jobDetailPopup,
comMessage
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: []
}
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
// dataContent: {
// handler(newName, oldName) {},
// immediate: true,
// deep: true
// }
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
// this.scanOptions = getDetailEditRemoveOption();
if (this.settingParam.allowModifyQty == 1) {
this.scanOptions = getDetailEditRemoveOption();
} else {
this.scanOptions = getDetailRemoveOption();
}
}
},
methods: {
openDetailCardPopup() {
this.$refs.winHint.openScanPopup()
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.record, item.record.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus;
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty,faileQty,reasonInfo) {
this.editItem.record.qty = qty;
this.editItem.record.FailedQty = faileQty;
this.editItem.FailedQty = faileQty;
this.editItem.FailedReason = reasonInfo.text;
this.editItem.record.FailedReason = reasonInfo.text;
this.$emit('updateData', this.editItem)
}
}
}
</script>
<style>
</style>

237
pages/inspect/coms/inspectComDetailCard.vue

@ -1,237 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<view class="">
<view class="">
<view class="cell_box uni-flex uni-row">
<!-- <view class="cell_info">
<view class="text_lightblue">类型</view>
<view>{{getInspectType(jobContent.inspectType)}}</view>
</view> -->
<view class="cell_info">
<view class="text_lightblue">收货数</view>
<view>{{jobContent.receiveQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">检验数</view>
<view>{{jobContent.sampleQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">不合格数</view>
<view style="color: #F56C6C;">{{jobContent.failedQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">报废数</view>
<view style="color: #EC9C00">{{jobContent.crackQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
</view>
<!-- <u-line /> -->
</view>
</view>
<u-line />
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)"
:isShowStdPack="false">
</item-compare-qty>
<view class="" style="margin-left: 20rpx; ">
<batch :batch="jobContent.batch"></batch>
</view>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :isShowPack="true" :isShowBatch="isShowBatch"
:isShowFromLocation="isShowLocation" style=' border-bottom: 0upx solid #fff;'></recommend>
<view v-if="item.failedQty>0||item.crackQty>0" :class="item.scaned?'scan_view':''"
style="font-size: 32rpx;padding-left: 2px;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
不合格
</view>
<view style="padding-left: 12rpx;color: #F56C6C;">
{{item.failedQty}}
</view>
</view>
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
报废
</view>
<view style="padding-left: 12rpx;color: #EC9C00">
{{item.crackQty}}
</view>
</view>
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
合格
</view>
<view style="padding-left: 12rpx;color: #34C759">
{{item.goodQty}}
</view>
</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line />
</view>
</uni-collapse-item>
</uni-collapse>
<inspectEdit ref='inspectEdit' @getInspectResult='getInspectResult'>
</inspectEdit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import batch from '@/mycomponents/balance/batch.vue'
import inspectEdit from "@/pages/inspect/coms/inspectEdit.vue"
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
import {
getUnitInfo,
getInspectType
} from '@/common/directory.js';
export default {
components: {
itemCompareQty,
recommend,
comMessage,
jobDetailPopup,
batch,
inspectEdit
},
props: {
dataContent: {
type: Object,
default: {}
},
jobContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
jobType: {
type: String,
default: ""
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {},
editIndex: 0,
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
},
methods: {
getInspectType(value) {
return getInspectType(value)
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item, index)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item, index) {
this.editIndex = index;
this.editItem = item;
this.$refs.inspectEdit.openEditPopup(this.editItem);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.failedQty = 0;
item.crackQty = 0;
item.sampleQty = 0;
item.notPassedQty = 0;
item.inspectResult = ""
item.failedReason = ""
// item.handleQty = 0;
item.handleQty = null;
item.photos = ""
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.$emit('updateData')
},
getInspectResult(result) {
this.dataContent.subList[this.editIndex] = result;
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
this.$emit('updateData', )
},
getUnitInfo(value) {
return getUnitInfo(value).label
},
}
}
</script>
<style>
</style>

293
pages/inspect/coms/inspectEdit.vue

@ -1,293 +0,0 @@
<template>
<view class="">
<uni-popup ref="editPopup" class="nopadpop camera_pop" :maskClick="false">
<view class="uni-list popuni_list camera_list">
<view class="list_cell uni-flex uni-row space-between">
<view class="title">箱码</view>
<text class="info">{{dataContent.packingNumber}}</text>
</view>
<view class="list_cell uni-flex uni-row space-between">
<view class="title">收货数量</view>
<view class="uni-flex uni-row u-col-center">
<text class="info">{{dataContent.qty}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<view class="list_cell uni-flex uni-row space-between">
<view class="title">不合格数量</view>
<view class="uni-flex uni-row u-col-center" style="">
<input class="qty_inspect_input" v-model="dataContent.failedQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<view class="list_cell uni-flex uni-row space-between">
<view class="title">报废数量</view>
<view class="uni-flex uni-row u-col-center" style="">
<input class="qty_inspect_input" v-model="dataContent.crackQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<view class="list_cell uni-flex uni-row space-between">
<view class="title">不合格原因</view>
<view class="info" style="padding: 0;">
<uni-data-picker :class="disabled===true?'disabled':''" :border="false" placeholder="请选择原因"
popup-title="不合格原因" :localdata="failedReasonArray" v-model="dataContent.failedReason">
</uni-data-picker>
</view>
</view>
<view class="list_cell uni-flex uni-row space-between">
<view class="title">检验结果</view>
<view class="info" style="padding: 0;">
<uni-data-picker :class="disabled===true?'disabled':''" :border="false" placeholder="请选择检验结果"
popup-title="检验结果" :localdata="inspectResultArray" v-model="dataContent.inspectResult">
</uni-data-picker>
</view>
</view>
<uploadCamera ref="uploadImage" style="margin: 10rpx;" :disabled="disabled" @delete="deleteImg"
@select="select"></uploadCamera>
</view>
<view class="pop_btn uni-flex uni-row space-between" v-if="!disabled">
<button class="cancel" @click="back">返回</button>
<button class="save" @click="save">保存</button>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getInspectFailedReasonList,
getInspectResultList
} from '@/common/directory.js';
import {
deepCopyData,
} from '@/common/basic.js';
import {
calc,
} from '@/common/calc.js';
import {
uploadFile,
getFileList,
deleteFileById
} from '@/api/request2.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import uploadCamera from '@/pages/inspect/coms/uploadCamera.vue'
import uom from '@/mycomponents/qty/uom.vue'
export default {
components: {
uploadCamera,
comMessage,
uom
},
name: 'receipt_check',
data() {
return {
id: '',
failedReasonIndex: 0,
failedReasonArray: [],
dataContent: {},
inspectResultArray: [],
picInfoList: [],
maxlength: 10
}
},
props: {
// dataContent: {
// type: Object,
// value: null
// },
disabled: {
type: Boolean,
value: true
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup(item) {
this.failedReasonArray = getInspectFailedReasonList();
this.inspectResultArray =getInspectResultList()
//
this.dataContent = deepCopyData(item);
this.getFileList();
this.$refs['editPopup'].open("bottom");
},
getFileList() {
getFileList("jobInspectDetail", this.dataContent.id).then(res => {
if(res.data){
var imageFiles = [];
res.data.forEach(item=>{
var image = this.createImage(item.id, item.url, item.path, item.size)
imageFiles.push(image)
})
}
if (imageFiles.length > 0) {
this.$nextTick(function() {
this.$refs.uploadImage.setFiles(imageFiles);
this.setPhotosInfo();
})
}
})
},
setPhotosInfo(){
var list = this.$refs.uploadImage.getFiles()
var photoItem = "";
for (var i = 0; i < list.length; i++) {
if (list.length - 1 == i) {
photoItem = photoItem + list[i].url
} else {
photoItem = photoItem + list[i].url + ","
}
}
this.dataContent.photos = photoItem;
},
createImage(id, url, fileName, size) {
let image = {
id: id,
name: fileName,
extname: "png",
fileType: "image",
url: url,
size: size,
image: {
width: 175,
height: 175,
location: url,
},
path: url,
progress: 100,
status: "ready"
}
return image;
},
deleteImg(content) {
var id = content.id
if (id != undefined) {
deleteFileById(id).then(res => {
if (res.data) {
uni.showToast({
title: "删除成功"
})
}
}).catch(error => {
console.log(error)
})
} else {
this.getFileList();
}
},
select(content) {
this.uploadFile(content);
},
back() {
this.$refs['editPopup'].close();
// this.afterSave()
},
maskClick() {
},
afterSave() {
this.$emit('getInspectResult', this.dataContent)
this.$refs['editPopup'].close();
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
// this.afterCloseMessage()
}
});
},
save() {
var failedQty = Number(this.dataContent.failedQty);
var crackQty = Number(this.dataContent.crackQty);
var qty = Number(this.dataContent.qty);
if (calc.add(crackQty,failedQty)> qty) {
var total = calc.add(crackQty,failedQty)
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
qty + "]")
return
}
if (failedQty > 0 || crackQty > 0) {
if (this.dataContent.failedReason == null||this.dataContent.failedReason == "") {
this.showMessage("请选择不合格原因")
return
}
}
if(this.dataContent.inspectResult == null||this.dataContent.inspectResult == ""){
this.showMessage("请选择检验结果")
return;
}
this.dataContent.failedQty = failedQty;
this.dataContent.crackQty = crackQty
var temp=calc.sub(this.dataContent.handleQty,failedQty);
this.dataContent.goodQty =calc.sub(temp,failedQty,crackQty);
this.afterSave()
},
uploadFile(content) {
uploadFile("jobInspectDetail", this.dataContent.id, content.path, res => {
if (res != undefined) {
uni.showToast({
title: "上传成功"
})
} else {
uni.showToast({
title: "上传失败"
})
}
this.getFileList();
})
}
}
}
</script>
<style scoped lang="scss">
.disabled {
pointer-events: none;
}
</style>

529
pages/inspect/job/inspectDetail.vue

@ -1,529 +0,0 @@
<template>
<view class="page-wraper">
<view style="margin: 5px;">
<job-top :dataContent="jobContent"></job-top>
<view>
<view class="card_content"> 检验类型 : {{getInspectType(jobContent.inspectType)}}</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<inspect-com-detail-card :dataContent="item" :jobContent="jobContent" @remove="updateData"
:isShowBatch="false" @updateData='updateData'>
</inspect-com-detail-card>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
takeInspectJob,
cancleTakeInspectJob,
getInspectJobDetail,
inspectJobSubmit,
getFileList,
deleteFileByTable
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
navigateBack
} from '@/common/basic.js';
import {
getInventoryStatusName,
getDirectoryItemArray,
getInspectType
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import inspectComDetailCard from "@/pages/inspect/coms/inspectComDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'returnDetail',
components: {
winScanButton,
winScanPack,
requiredLocation,
winScanPackAndLocation,
comMessage,
inspectComDetailCard,
jobTop
},
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
businessTypeInfo: {},
fromInventoryStatuses: "",
managementList: [],
selectedItem: {},
failedQty: 0,
crackQty: 0,
};
},
onLoad(option) {
this.id = option.id;
this.failedQty = option.failedQty;
this.crackQty = option.crackQty;
if (this.id != undefined) {
// //
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
deleteFileByTable(id) {
debugger
deleteFileByTable("jobInspectDetail", id).then(res=>{
})
},
clearPicList(subList) {
subList.forEach(item => {
this.deleteFileByTable(item.id)
})
},
//
receive(callback) {
uni.showLoading({
title: "加载中....",
mask: true
});
if (this.id != null) {
takeInspectJob(this.id).then(res => {
uni.hideLoading();
callback();
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getInspectJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobContent.failedQty = this.failedQty
that.jobContent.crackQty = this.crackQty;
that.subList = res.data.subList;
this.clearPicList(that.subList);
that.subList.forEach(res => {
res.batch = that.jobContent.batch
res.goodQty = 0;
res.failedQty = 0;
res.crackQty = 0;
res.sampleQty = 0;
res.notPassedQty = 0;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
})
that.fromInventoryStatuses = that.jobContent.outInventoryStatuses
that.detailSource = getDataSource(that.subList);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan()
this.$forceUpdate();
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续检验?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.balance = result.balance;
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.balance = result.balance;
itemDetail.handleQty = Number(result.balance.qty)
this.calcHandleQty();
}
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log("提交参数", JSON.stringify(params));
inspectJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成到货检验记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
setParams() {
var list = []
this.detailSource.forEach(res => {
res.subList.forEach(detail => {
if (detail.scaned) {
detail.sampleQty = detail.qty;
detail.failedQty = detail.failedQty;
detail.crackQty = detail.crackQty;
detail.notPassedQty = detail.failedQty;
detail.goodQty = detail.handleQty - detail.failedQty - detail.crackQty;
detail.inspectUser = this.$store.state.user.id
//==
if (detail.goodQty == detail.handleQty) {
detail.toInventoryStatus = "OK"
} else {
//=
//>0
if (detail.crackQty > 0) {
detail.toInventoryStatus = "SCRAP"
} else {
detail.toInventoryStatus = "NOK"
}
}
}
// else {
// detail.sampleQty = detail.qty;
// detail.failedQty = 0;
// detail.crackQty = 0;
// detail.notPassedQty = 0;
// detail.handleQty = 0;
// detail.goodQty = detail.qty;
// detail.inspectUser = this.$store.state.user.id
// detail.toInventoryStatus = "OK"
// }
list.push(detail)
})
})
this.jobContent.subList = list
this.jobContent.nextAction = "PARTIAL_OK";
return this.jobContent;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(2);
})
},
getInspectType(value) {
return getInspectType(value)
}
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

551
pages/inspect/job/inspectFullDetail.vue

@ -1,551 +0,0 @@
<template>
<view class="page-wraper">
<view style="margin: 5px;">
<job-top :dataContent="jobContent"></job-top>
<view>
<view class="card_content"> 检验类型 : {{getInspectType(jobContent.inspectType)}}</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<inspect-com-detail-card :dataContent="item" :jobContent="jobContent" @remove="updateData"
:isShowBatch="false" @updateData='updateData'>
</inspect-com-detail-card>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
takeInspectJob,
cancleTakeInspectJob,
getInspectJobDetail,
inspectJobSubmit,
deleteFileById,
getFileList,
deleteFileByTable
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
navigateBack
} from '@/common/basic.js';
import {
getInventoryStatusName,
getDirectoryItemArray,
getInspectType
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import inspectComDetailCard from "@/pages/inspect/coms/inspectComDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'returnDetail',
components: {
winScanButton,
winScanPack,
requiredLocation,
winScanPackAndLocation,
comMessage,
inspectComDetailCard,
jobTop
},
data() {
return {
id: '',
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
businessTypeInfo: {},
fromInventoryStatuses: "",
managementList: [],
selectedItem: {},
jobStatus:""
};
},
onLoad(option) {
this.id = option.id;
if (this.id != undefined) {
// //
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
deleteFileByTable(id) {
deleteFileByTable("jobInspectDetail", id).then(res=>{
})
},
clearPicList(subList) {
subList.forEach(item => {
this.deleteFileByTable(item.id)
})
},
//
receive(callback) {
uni.showLoading({
title: "加载中....",
mask: true
});
if (this.id != null) {
takeInspectJob(this.id).then(res => {
uni.hideLoading();
callback();
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getInspectJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
this.jobContent.failedQty = 0;
this.jobContent.crackQty = 0;
this.jobContent.notPassedQty = 0;
that.subList = res.data.subList;
this.clearPicList(that.subList);
that.subList.forEach(res => {
res.batch = that.jobContent.batch
res.goodQty = 0;
res.failedQty = 0;
res.crackQty = 0;
res.sampleQty = 0;
res.notPassedQty = 0;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
})
that.fromInventoryStatuses = that.jobContent.outInventoryStatuses
that.detailSource = getDataSource(that.subList);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.calcJobQty();
this.continueScan()
this.$forceUpdate();
},
calcJobQty() {
var failedQty = 0;
var crackQty = 0;
for (let item of this.detailSource) {
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
failedQty= calc.add(failedQty,detail.failedQty)
crackQty= calc.add(crackQty,detail.crackQty)
}
}
}
this.jobContent.failedQty = failedQty;
this.jobContent.crackQty = crackQty;
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续检验?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.balance = result.balance;
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.balance = result.balance;
itemDetail.handleQty = Number(result.balance.qty)
this.calcHandleQty();
}
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
} else {
if (this.scanCount == this.subList.length) {
this.submitJob();
} else {
//-------:nxt 20231213
if (this.jobContent.allowPartialComplete == "TRUE") {
this.submitJob();
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
if (res) {
this.openScanPopup();
}
});
}
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log("提交参数", JSON.stringify(params));
inspectJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成到货检验记录" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
setParams() {
var list = []
this.detailSource.forEach(res => {
res.subList.forEach(detail => {
if (detail.scaned) {
detail.sampleQty = detail.qty;
detail.failedQty = detail.failedQty;
detail.crackQty = detail.crackQty;
detail.notPassedQty = detail.failedQty;
var tempQty = calc.sub(detail.handleQt,detail.failedQty)
detail.goodQty = calc.sub(tempQty,detail.crackQty) ;
detail.inspectUser = this.$store.state.user.id
//==
if (detail.goodQty == detail.handleQty) {
detail.toInventoryStatus = "OK"
} else {
//=
//>0
if (detail.crackQty > 0) {
detail.toInventoryStatus = "SCRAP"
} else {
detail.toInventoryStatus = "NOK"
}
}
} else {
detail.sampleQty = detail.qty;
detail.failedQty = 0;
detail.crackQty = 0;
detail.notPassedQty = 0;
detail.goodQty = detail.qty;
detail.inspectUser = this.$store.state.user.id
detail.toInventoryStatus = "OK"
}
list.push(detail)
})
})
this.jobContent.notPassedQty = Number(this.jobContent.failedQty) + Number(this.jobContent.crackQty)
this.jobContent.subList = list
this.jobContent.nextAction = "PARTIAL_OK";
return this.jobContent;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1);
})
},
getInspectType(value) {
return getInspectType(value)
}
}
}
</script>
<style scoped lang="scss">
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;
}
</style>

298
pages/inspect/job/inspectJob.vue

@ -1,298 +0,0 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-inspect-job-card :dataContent="item" @click='openJobDetail(item)'></com-inspect-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
<inspectInfoPopup ref='jobInfoPopup'></inspectInfoPopup>
<com-inspect-job-list ref="comReceiptJobList" @selectedItem="selectedItem"></com-inspect-job-list>
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
cancleTakeInspectJob,
getInspectJobList,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import inspectInfoPopup from '@/pages/Inspect/coms/inspectInfoPopup.vue'
import comInspectJobCard from '@/pages/Inspect/coms/comInspectJobCard.vue'
import comInspectJobList from '@/pages/Inspect/coms/comInspectJobList.vue'
export default {
name: 'receipt',
components: {
comEmptyView,
jobFilter,
comInspectJobCard,
inspectInfoPopup,
comInspectJobList,
comMessage,
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList('refresh');
},
onReady() {
const rightButtonEle2 = document.getElementsByClassName('uni-page-head-btn')[2]
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getInspectJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("到货检验(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("到货检验");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
// uni.navigateTo({
// url: './inspectDetail?id=' + item.id + '&status=' + item.status
// });
if(item.inspectType=="FULL"){
uni.navigateTo({
url: './inspectFullDetail?id=' + item.id + '&status=' + item.status
});
}else {
uni.navigateTo({
url: './inspectResult?id=' + item.id + '&status=' + item.status
});
}
},
showItemList(itemList) {
this.$refs.comReceiptJobList.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeInspectJob(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "放弃任务成功"
})
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getInspectJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

578
pages/inspect/job/inspectResult.vue

@ -1,578 +0,0 @@
<template>
<view class="" v-if="jobContent!=null">
<view class="pda-list">
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">类型</view>
</view>
<view class="pda-list-cell-db">
{{getInspectName(jobContent.inspectType) }}
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">物料号</view>
</view>
<view class="pda-list-cell-db">
<view class="uni-flex space-between">
<input class="display-input" type="text" :disabled="true" v-model="jobContent.itemCode" />
</view>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">批次</view>
</view>
<view class="pda-list-cell-db">
<input class="display-input" type="text" :disabled="true" v-model="jobContent.batch" />
</view>
</view>
<view class="pda-list-cell" style="margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="pda-list-cell-left">
<view class="uni-label">收货数量</view>
</view>
<view class="pda-list-cell-db">
<text>{{jobContent.receiveQty}} {{getUnitInfo(jobContent.uom)}}</text>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">检验数量</view>
</view>
<view class="pda-list-cell-db">
<text>{{jobContent.sampleQty}} {{getUnitInfo(jobContent.uom)}}</text>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">下一步动作</view>
</view>
<view class="pda-list-cell-db">
<uni-data-picker class='uni-data-picker' placeholder="请选择下一步动作" popup-title="下一步动作"
@change="nextStepChange" :localdata="nextActionList" v-model="nextAction">
</uni-data-picker>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">不合格数量</view>
</view>
<view class="pda-list-cell-db">
<uni-easyinput :inputBorder="true" type="number" placeholder="请输入数字" v-model="jobContent.failedQty"
@clear="clearFailedQty" @blur="failedQtyConfirm" class="count-input">
</uni-easyinput>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">报废数量</view>
</view>
<view class="pda-list-cell-db">
<uni-easyinput placeholder="请输入数字" type="number" v-model="jobContent.crackQty" @blur=""
@clear="clearCrackQty" class="count-input">
</uni-easyinput>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">最终不合格</view>
</view>
<view class="pda-list-cell-db">
<uni-easyinput placeholder="待计算" type="number" :disabled="true" v-model="jobContent.notPassedQty"
class="count-input">
</uni-easyinput>
</view>
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">备注</view>
</view>
<view class="pda-list-cell-db">
<uni-easyinput placeholder="请输入备注" type="text" autoHeight v-model="jobContent.remark"
class="count-input">
</uni-easyinput>
</view>
</view>
</view>
<view class="" v-if="false">
<uni-collapse>
<uni-collapse-item title="库位列表" style='font-size: 40rpx;' :open='true'>
<view style="">
<scroll-view scroll-y="true" class="scroll-detail">
<view class=""
style="font-size: 35rpx;display: flex;flex-direction: row;align-items: center;width: 100%;"
v-for="(item, index) in detailList" :key="item.id">
<text style="font-size: 35rpx;margin-right: 20rpx;">{{index+1}}.</text>
<view class="">
<view class="">
箱码:{{item.packingNumber}}
</view>
<view class="">
库位:{{item.fromLocationCode}}
</view>
<u-line />
</view>
</view>
</scroll-view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view class="bottom" style="padding-bottom: 20rpx;">
<button :disabled="submitting" type="primary" class="save-button" @click="commit">提交</button>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInspectJobDetail,
takeInspectJob,
cancleTakeInspectJob,
inspectJobSubmit
} from '@/api/request2.js';
import {
getInspectFailedReasonList,
getNextActionList,
getInspectType,
getUnitInfo
} from '@/common/directory.js';
import {
goHome,
navigateBack
} from '@/common/basic.js';
export default {
components: {
comMessage
},
data() {
return {
id: '',
status: "",
itemDetail: {},
inspectType: '', //
failedReasonIndex: 0,
failedReasonArray: [],
nextStep: '',
submitting: false,
locations: [],
value: ['0'],
jobContent: {}, //
detailList: [], //details
detailSource: [], //
nextActionList: [],
nextAction: null,
jobStatus:""
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onLoad(option) {
this.id = option.id;
this.status = option.status;
this.nextActionList = getNextActionList();
if (this.id != undefined) {
// //
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
methods: {
//
receive(callback) {
uni.showLoading({
title: "加载中....",
mask: true
});
if (this.id != null) {
takeInspectJob(this.id).then(res => {
uni.hideLoading();
callback();
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getInspectJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.detailList = res.data.subList;
that.jobStatus = res.data.status
that.inspectType = that.jobContent.inspectType;
that.jobContent.goodQty = null, //
that.jobContent.failedQty = null, //
that.jobContent.crackQty = null, //
that.jobContent.notPassedQty = null; //
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
// this.afterCloseMessage()
}
});
},
//
failedQtyConfirm(value) {
// if (value.detail.value > this.jobContent.receiveQty) {
// this.jobContent.failedQty = null
// this.showMessage("[" + value.detail.value + "][" + this.jobContent.receiveQty + "]")
// return
// }
// if (value.detail.value+ this.jobContent.crackQty> this.jobContent.receiveQty) {
// this.jobContent.failedQty = null
// this.showMessage("[" + value.detail.value +"+["+this.jobContent.crackQty+ "][" + this.jobContent.receiveQty + "]")
// return
// }
this.calcNotPassQty()
},
getInspectName(value) {
return getInspectType(value)
},
getUnitInfo(value) {
return getUnitInfo(value).label
},
nextStepChange(e) {
if (e.detail.value.length > 0) {
this.nextAction = e.detail.value[0].value;
this.calcNotPassQty();
}
},
calcNotPassQty() {
var failedQty = Number(this.jobContent.failedQty == null ? 0 : this.jobContent.failedQty)
//()
if (this.inspectType == 'FUll') {
//
this.jobContent.notPassedQty = failedQty
} else if (this.inspectType == 'SAMPLING') {
//
//
//
if (this.nextAction == "FULL_INSPECT" || this.nextAction == "PARTIAL_OK") {
// =
this.jobContent.notPassedQty = failedQty
} else if (this.nextAction == "ALL_NOK") {
//=-
this.jobContent.notPassedQty = Number(this.jobContent.receiveQty) - Number(this.jobContent
.crackQty == null ? 0 : this.jobContent.crackQty)
}
}
},
clearFailedQty() {
this.jobContent.failedQty = null;
},
clearCrackQty() {
this.jobContent.crackQty = null
},
commit() {
if (this.nextAction == null) {
this.showMessage("请选择下一步动作")
return
}
if (this.nextAction == "ALL_OK") {
//
this.jobContent.subList.forEach(res => {
res.handleQty = res.qty //
res.failedQty = 0;
res.notPassedQty = 0;
res.crackQty = 0;
res.goodQty = res.qty;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
res.toInventoryStatus = "OK"
res.inspectUser = this.$store.state.user.id
})
this.jobContent.goodQty = this.jobContent.receiveQty
this.jobContent.nextAction = this.nextAction;
this.submitJob(this.jobContent)
} else if (this.nextAction == "ALL_NOK") {
//
this.jobContent.subList.forEach(res => {
res.handleQty = res.qty
res.failedQty = res.qty;
res.notPassedQty = res.failedQty;
res.crackQty = 0;
res.goodQty = 0;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
res.toInventoryStatus = "NOK"
res.inspectUser = this.$store.state.user.id
})
this.jobContent.nextAction = this.nextAction;
this.jobContent.goodQty = 0
this.submitJob(this.jobContent)
} else if (this.nextAction == "PARTIAL_OK") {
//
if (this.jobContent.failedQty == null) {
this.showMessage("请输入不合格数量")
return
}
if (this.jobContent.crackQty == null) {
this.showMessage("请输入报废数量")
return
}
var receiveQty = Number(this.jobContent.receiveQty)
var failedQty = Number(this.jobContent.failedQty);
var crackQty = Number(this.jobContent.crackQty);
if (crackQty + failedQty > receiveQty) {
var total = crackQty + failedQty;
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
receiveQty + "]")
return
}
uni.navigateTo({
url: './inspectDetail?id=' + this.id +
'&status=' + this.status +
'&failedQty=' + this.jobContent.failedQty +
'&crackQty=' + this.jobContent.crackQty
});
} else if (this.nextAction == "FULL_INSPECT") {
//
this.jobContent.subList.forEach(res => {
res.handleQty = res.qty
res.failedQty = 0;
res.notPassedQty = res.failedQty;
res.crackQty = 0;
// res.goodQty = res.qty;
res.goodQty = 0;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
res.toInventoryStatus = "OK"
res.inspectUser = this.$store.state.user.id
})
this.jobContent.goodQty = this.jobContent.receiveQty
this.jobContent.nextAction = this.nextAction;
this.submitJob(this.jobContent)
}
//==0()
// if (failedQty == 0) {
// if (crackQty == 0) {
// if (this.nextAction == "ALL_NOK") {
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = res.qty;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = 0;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "NOK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = this.nextAction;
// this.jobContent.goodQty = 0
// this.submitJob(this.jobContent)
// }else {
// //==0
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = 0;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = res.qty;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "OK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = "";
// this.jobContent.goodQty = this.jobContent.receiveQty
// this.submitJob(this.jobContent)
// }
// } else {
// //0
// //
// uni.navigateTo({
// url: './inspectDetail?id=' + this.id +
// '&status=' + this.status +
// '&failedQty=' + this.jobContent.failedQty +
// '&crackQty=' + this.jobContent.crackQty
// });
// }
// } else {
// //>0
// //
// if (this.nextAction == null) {
// this.showMessage("")
// return
// }
// //
// if (this.nextAction == "ALL_NOK") {
// //
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = res.qty;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = 0;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "NOK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = this.nextAction;
// this.jobContent.goodQty = 0
// this.submitJob(this.jobContent)
// //
// } else if (this.nextAction == "PARTIAL_OK") {
// //
// uni.navigateTo({
// url: './inspectDetail?id=' + this.id +
// '&status=' + this.status +
// '&failedQty=' + this.jobContent.failedQty +
// '&crackQty=' + this.jobContent.crackQty
// });
// //
// } else if (this.nextAction == "FULL_INSPECT") {
// //
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = 0;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = res.qty;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "OK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.goodQty = this.jobContent.receiveQty
// this.jobContent.nextAction = this.nextAction;
// this.submitJob(this.jobContent)
// }
// }
},
submitJob(params) {
uni.showLoading({
title: "提交中....",
mask: true
});
console.log("提交参数", JSON.stringify(params));
inspectJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
var hint = "";
if (this.jobContent.nextAction == "FULL_INSPECT") {
hint = "提交成功<br>生成到货检验任务<br>" + res.data
} else {
hint = "提交成功<br>生成到货检验记录<br>" + res.data
}
this.showCommitSuccessMessage(hint)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
}
}
</script>
<style>
</style>

382
pages/inspect/request/inspectRequest.vue

@ -1,382 +0,0 @@
<template>
<view>
<com-empty-view v-if="requestList.length==0"></com-empty-view>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<comInspectRequestCard :dataContent="item" @click='openRequestDetail(item)'>
</comInspectRequestCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" v-if="requestList.length>0" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import requestFilter from '@/mycomponents/request/requestFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comInspectRequestCard from '@/pages/inspect/coms/comInspectRequestCard.vue'
import requestInfoPopup from '@/pages/inspect/coms/requestInfoPopup.vue'
import {
goHome,
updateTitle,
clearTirmAndWrap
} from '@/common/basic.js';
import {
getInspectRequestList,
inspectRequestClose,
inspectRequestApprove,
inspectRequestApproveAgree,
inspectRequestApproveRefused,
inspectRequestHandle,
inspectRequestAddAgain
} from '@/api/request2.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndAddAndCloseOption,
getAddAgainOption
} from '@/common/array.js';
export default {
components: {
comEmptyView,
requestFilter,
comMessage,
comInspectRequestCard,
requestInfoPopup,
},
data() {
return {
requestList: [],
pageNo: 1,
pageSize: 10,
status: "1,2,3,4,5,6",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndAddAndCloseOption: [],
addAgainOption:[],
showOptions: [],
fromType: "requestType",
loadingType: "nomore",
};
},
onLoad() {
this.detailOptions = getDetailOption();
this.addAgainOption = getAddAgainOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndAddAndCloseOption = getDetailAndAddAndCloseOption()
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
onShow() {
this.getList('refresh');
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
mounted() {
},
methods: {
openRequestDetail(item) {
uni.navigateTo({
url: './inspectRequestDetail?id=' + item.id
});
},
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndAddAndCloseOption;
} else if(status == "5"){
this.showOptions = this.addAgainOption;
}else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getInspectRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle("检验单申请(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle("检验单申请");
uni.hideLoading();
that.showMessage(error)
})
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?",res=>{
this.inspectRequestHandle(dataContent.id)
})
} else if (text == "提交审批") {
this.showQuestionMessage("确定要审批当前申请吗?",res=>{
this.inspectRequestApprove(dataContent.id)
})
} else if (text=="审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{
this.inspectRequestApproveAgree(dataContent.id)
})
} else if (text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{
this.inspectRequestApproveRefused(dataContent.id)
})
} else if (text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{
this.inspectRequestClose(dataContent.id)
})
}else if(text == "重新添加"){
this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{
this.inspectRequestAddAgain(dataContent.id)
})
}
},
showQuestionMessage(hint,callBack){
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getInspectRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的检验单申请');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
inspectRequestApprove(id) {
inspectRequestApprove(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请提交审批成功"
})
this.getList("refresh")
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
inspectRequestClose(id) {
inspectRequestClose(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请关闭成功"
})
this.getList("refresh")
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
inspectRequestAddAgain(id) {
inspectRequestAddAgain(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请重新添加成功"
})
this.getList("refresh")
} else {
this.showMessage("申请重新添加失败")
}
}).catch(error => {
this.showMessage(error)
})
},
inspectRequestApproveAgree(id) {
inspectRequestApproveAgree(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批通过成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
inspectRequestApproveRefused(id) {
inspectRequestApproveRefused(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请审批驳回成功"
})
this.getList("refresh")
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
inspectRequestHandle(id) {
inspectRequestHandle(id).then(res => {
if (res.data) {
uni.showToast({
title: "申请处理成功"
})
this.getList("refresh")
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
}
}
</script>
<style>
</style>

132
pages/inspect/request/inspectRequestDetail.vue

@ -1,132 +0,0 @@
<template>
<view class="page-wraper">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="" style="background-color: #fff; padding-left: 20rpx;padding-right: 20rpx; padding-top: 10rpx;padding-bottom: 10rpx;">
<view class="" style="font-size: 35rpx;">
单据号 : {{requestContent.number}}
</view>
<view class="" style="font-size: 35rpx;">
<text>供应商代码 : {{requestContent.supplierCode}} </text>
</view>
</view>
<u-line />
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRequestDetailCard :dataContent="item"
:isShowBatch ="false"
@openDetail="openDetail">
</comRequestDetailCard>
</view>
</view>
</scroll-view>
</view>
<requestDetailInfoPopup ref="jobDetailPopup"></requestDetailInfoPopup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getInspectRequestDetail,
} from '@/api/request2.js';
import {
goHome,
} from '@/common/basic.js';
import {
getDataSource,
} from '@/common/detail.js';
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
import requestDetailInfoPopup from '@/pages/productPutaway/coms/requestDetailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
comRequestDetailCard,
requestDetailInfoPopup,
comMessage,
},
data() {
return {
id: '',
requestContent: {}, //
subList: [], //details
detailSource: [], //
};
},
onLoad(option) {
this.id = option.id;
this.getDetail();
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getInspectRequestDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.requestContent = res.data;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
// that.subList = res.data[0];
// that.subList.forEach(res=>{
// res.packingNumber =res.toPackingNumber
// res.batch =res.fromBatch
// })
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
openDetail(item) {
this.$refs.jobDetailPopup.openPopup(item)
},
}
}
</script>
<style scoped lang="scss">
</style>

144
pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -1,144 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)">
<recommend :detail="item" :isShowFromLocation="true" :isShowToLocation="true"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<u-line />
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
balanceQtyEdit,
detailInfoPopup,
comMessage,
winScanLocation
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
},
detailOptions: [],
scanOptions: []
}
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
// dataContent: {
// handler(newName, oldName) {},
// immediate: true,
// deep: true
// }
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
},
methods: {
openDetailCardPopup() {
this.$refs.winHint.openScanPopup()
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.$emit('updateData')
},
}
}
</script>
<style>
</style>

411
pages/inventoryMove/coms/comMove.vue

@ -1,411 +0,0 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<u-line />
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-move-record :dataContent="item" :index="index" @removeData="removeData"
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'
:allowEditStatus="allowEditStatus">
</com-move-record>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="toLocationTypeArray" :isShowEdit="toLocationCode==''"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
inventoryMoveRecordSubmit,
} from '@/api/request2.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
export default {
components: {
comEmptyView,
winScanButton,
requiredLocation,
comMoveRecord,
comBlankView,
winScanLocation,
winScanPackAndLocation,
comMessage
},
props: {
// fromInventoryStatus: {
// type: String,
// default: ""
// },
// toInventoryStatus: {
// type: String,
// default: ""
// },
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
},
businessTypeCode: {
type: String,
default: "Move"
}, //
toLocationCode: {
type: String,
default: ""
},
},
data() {
return {
fromLocationCode: "",
// toLocationCode: "",
toLocationInfo: {},
toLocationTypeArray: [],
toInventoryStatus: "",
businessType: {}, //
detailSource: [], //
title: "",
dataContent: {},
toWarehouseCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
}
},
mounted() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
this.updateTitle();
},
onLoad() {
},
methods: {
updateTitle() {
if (this.businessTypeCode == "Move") {
this.title = "库存转移记录";
this.toInventoryStatus = "OK"
} else if (this.businessTypeCode == "HoldToOk") {
this.title = "隔离转合格记录";
this.toInventoryStatus = "OK"
} else if (this.businessTypeCode == "HoldToScrap") {
this.title = "隔离转报废记录";
this.toInventoryStatus = "SCRAP"
} else if (this.businessTypeCode == "OkToHold") {
this.title = "合格转隔离记录";
this.toInventoryStatus = "HOLD"
} else if (this.businessTypeCode == "OktoScrap") {
this.title = "合格转报废记录";
this.toInventoryStatus = "SCRAP"
} else if (this.businessTypeCode == "ScrapToHold") {
this.title = "报废转隔离记录";
this.toInventoryStatus = "HOLD"
}
uni.setNavigationBarTitle({
title: this.title
})
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
getLocation(location) {
this.getfromLocationCode(location)
},
getfromLocationCode(location) {
this.fromLocationCode = location.code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toWarehouseCode = location.warehouseCode
this.toLocationCode = code;
},
getScanResult(result) {
this.getDataSource(result)
},
getDataSource(result) {
var balance = result.balance;
var pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus
item.subList.push(newDetail);
} else {
this.showErrorMessage(balance.packingNumber + "已经在列表中")
}
}
calcHandleQty(this.detailSource);
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
updateData() {
calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
removeData(item) {
for (let i = 0; i < this.detailSource.length; i++) {
if (this.detailSource[i].itemCode == item.itemCode) {
this.detailSource.splice(i, 1)
}
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData()
})
},
clearData() {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "记录<br>" +
res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.fromInventoryStatus = detail.inventoryStatus;
// detail.toInventoryStatus = this.toInventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
this.dataContent.businessType = this.businessTypeCode;
return this.dataContent;
},
}
}
</script>
<style>
</style>

324
pages/inventoryMove/coms/comMoveJob.vue

@ -1,324 +0,0 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-inventory-job-card :dataContent="item" @click='openJobDetail(item)'>
</com-inventory-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getInventoryMoveJobList,
cancleTakeInventoryMoveJob
} from '@/api/request2.js';
import {
goHome,
getCurrDate
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comInventoryJobCard from '@/pages/inventoryMove/coms/comInventoryJobCard.vue'
import jobListPopup from '@/pages/inventoryMove/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/inventoryMove/coms/jobInfoPopup.vue'
export default {
name: 'receipt',
components: {
comEmptyView,
jobFilter,
comMessage,
comInventoryJobCard,
jobListPopup,
jobInfoPopup,
},
props: {
businessTypeCode: {
type: String,
default: "Move"
} //
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
titleName:""
};
},
onShow() {
},
mounted() {
this.getList('refresh');
},
onReady() {
const rightButtonEle2 = document.getElementsByClassName('uni-page-head-btn')[2]
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
methods: {
updateTitle() {
var title = ""
var name = ""
if (this.businessTypeCode == "Move") {
name = "库存转移";
} else if (this.businessTypeCode == "HoldToOk") {
name = "隔离转合格";
} else if (this.businessTypeCode == "HoldToScrap") {
name = "隔离转报废";
} else if (this.businessTypeCode == "OkToHold") {
name = "合格转隔离";
} else if (this.businessTypeCode == "OktoScrap") {
name = "合格转报废";
} else if (this.businessTypeCode == "ScrapToHold") {
name = "报废转隔离";
}
this.titleName =name;
if (this.totalCount > 0) {
title = name + "(" + this.totalCount + ")";
} else {
title = name;
}
uni.setNavigationBarTitle({
title: title
})
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.receiptList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "business_type",
action: "==",
value: this.businessTypeCode
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getInventoryMoveJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
this.updateTitle();
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './inventoryMoveDetail?id=' + item.id + '&status=' + item.status+'&businessTypeCode='+this.businessTypeCode
});
},
showItemList(itemList) {
this.$refs.comReceiptJobList.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeInventoryMoveJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getInventoryMoveJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
openFilter() {
this.$refs.filter.openFilter();
},
toHome() {
goHome()
},
refresh(){
this.getList("refresh")
}
}
}
</script>
<style scoped lang="scss">
</style>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save