Compare commits
156 Commits
Author | SHA1 | Date |
---|---|---|
|
95ebe667dd | 4 weeks ago |
|
4d96be6fc5 | 4 months ago |
|
6970f449cb | 4 months ago |
|
b93760a7ea | 4 months ago |
|
6a92979ea6 | 4 months ago |
|
5ae892cfa1 | 4 months ago |
|
7cafa3cde7 | 4 months ago |
|
1fd32c0baf | 4 months ago |
|
47163bceda | 4 months ago |
|
832b4a7957 | 5 months ago |
|
15ddca54ba | 5 months ago |
|
713b695567 | 5 months ago |
|
8b8c5e1684 | 6 months ago |
|
8b72fc0976 | 6 months ago |
|
271bd1efdb | 6 months ago |
|
7837a5158b | 6 months ago |
|
850378c9e8 | 6 months ago |
|
d85d90e7a4 | 6 months ago |
|
5f972da99f | 6 months ago |
|
4f481fe597 | 6 months ago |
|
eaddb48660 | 6 months ago |
|
6a00b34729 | 7 months ago |
|
4c416a665f | 7 months ago |
|
cfa40a5141 | 7 months ago |
|
f25a3eb375 | 8 months ago |
|
a558576b0a | 8 months ago |
|
49f27a2a06 | 9 months ago |
|
af9a037873 | 9 months ago |
|
d0245a2e5d | 10 months ago |
|
a0fe3df852 | 10 months ago |
|
0702474e76 | 10 months ago |
|
a57512a854 | 10 months ago |
|
bbaee459f1 | 10 months ago |
|
c8504ca1a6 | 10 months ago |
|
f149f349cd | 10 months ago |
|
7d81c4a941 | 10 months ago |
|
bd942a944e | 10 months ago |
|
5ac8b1a3b4 | 10 months ago |
|
51dff0cde3 | 10 months ago |
|
b00ed60112 | 10 months ago |
|
b9ba3596a4 | 10 months ago |
|
051474839e | 10 months ago |
|
508c8d9917 | 10 months ago |
|
70b88dec79 | 10 months ago |
|
6c58bdfaa7 | 10 months ago |
|
79ce07c863 | 10 months ago |
|
2d7bb5873e | 10 months ago |
|
a1d93336d6 | 11 months ago |
|
001d9b9500 | 11 months ago |
|
3bc073a1d6 | 11 months ago |
|
5c5395cf0c | 11 months ago |
|
6fbea88d39 | 11 months ago |
|
c286acdd11 | 11 months ago |
|
b2d174e0c5 | 11 months ago |
|
6e91fcff03 | 11 months ago |
|
956c72e8c8 | 11 months ago |
|
63d264436e | 11 months ago |
|
cd817ad0e1 | 11 months ago |
|
f66a56a8c4 | 11 months ago |
|
12bf2c4ba2 | 11 months ago |
|
48f784bbbe | 11 months ago |
|
f6d6a8c98a | 11 months ago |
|
18f1fb7790 | 11 months ago |
|
2e4ad01568 | 11 months ago |
|
4411c4f4db | 11 months ago |
|
c4a5b00527 | 12 months ago |
|
4939310121 | 12 months ago |
|
89b1d41d9a | 12 months ago |
|
07d42f801a | 12 months ago |
|
a0c9a5f03a | 12 months ago |
|
5b56f239b3 | 12 months ago |
|
18c06fb1c3 | 12 months ago |
|
6c64f8445f | 12 months ago |
|
fa09d58535 | 12 months ago |
|
7dfc6cad79 | 1 year ago |
|
7265199dff | 1 year ago |
|
ddba65569d | 1 year ago |
|
7b9f024519 | 1 year ago |
|
0817c935cc | 1 year ago |
|
a1afc2def2 | 1 year ago |
|
29ce0dbca2 | 1 year ago |
|
c8a2181ab8 | 1 year ago |
|
7d30846621 | 1 year ago |
|
99a8b6f042 | 1 year ago |
|
aea783cc80 | 1 year ago |
|
baac3101fc | 1 year ago |
|
cd51b20703 | 1 year ago |
|
a751395376 | 1 year ago |
|
ceeb3ebfe2 | 1 year ago |
|
7140d537fd | 1 year ago |
|
eb01565661 | 1 year ago |
|
94c5be44aa | 1 year ago |
|
2ec0d6b694 | 1 year ago |
|
bb9507061e | 1 year ago |
|
19d5a73376 | 1 year ago |
|
2113f0ab07 | 1 year ago |
|
06c5d5606b | 1 year ago |
|
8e05072441 | 1 year ago |
|
90fa922ae3 | 1 year ago |
|
35471f201d | 1 year ago |
|
b9d6c09fd6 | 1 year ago |
|
71438834a8 | 1 year ago |
|
ebb4c19a05 | 2 years ago |
|
bcc6792640 | 2 years ago |
|
dca5f418dc | 2 years ago |
|
719e8f8610 | 2 years ago |
|
e34c215530 | 2 years ago |
|
4dfc8ccec9 | 2 years ago |
|
1204be4271 | 2 years ago |
|
e19e5b48e8 | 2 years ago |
|
7bc799a181 | 2 years ago |
|
506b7821cc | 2 years ago |
|
09251c39dd | 2 years ago |
|
e383b6cc09 | 2 years ago |
|
3da4f049bf | 2 years ago |
|
a398fdbf89 | 2 years ago |
|
0b3208e327 | 2 years ago |
|
2c0b29427a | 2 years ago |
|
d8f34bfb42 | 2 years ago |
|
2793c8f2c1 | 2 years ago |
|
e001141e66 | 2 years ago |
|
f152b00e92 | 2 years ago |
|
201df55a1b | 2 years ago |
|
46cd8a9cae | 2 years ago |
|
6a91ce592c | 2 years ago |
|
282cfef2ef | 2 years ago |
|
502f67926e | 2 years ago |
|
08a3a0ad4d | 2 years ago |
|
54cfa5bc64 | 2 years ago |
|
5e03b8473c | 2 years ago |
|
e02bd0fe1c | 2 years ago |
|
76ff242b63 | 2 years ago |
|
69a02eb854 | 2 years ago |
|
9e01ab5c86 | 2 years ago |
|
8c981e7a90 | 2 years ago |
|
8bbe00da88 | 2 years ago |
|
30b4ab8bbc | 2 years ago |
|
db8be367bf | 2 years ago |
|
192b294ae5 | 2 years ago |
|
9416024f7e | 2 years ago |
|
d065ea50c2 | 2 years ago |
|
4ad3b37b3b | 2 years ago |
|
e05290311e | 2 years ago |
|
bf1f8c866e | 2 years ago |
|
783059eacd | 2 years ago |
|
1dc505dc31 | 2 years ago |
|
d2d9669986 | 2 years ago |
|
c68231a498 | 2 years ago |
|
af7db6a417 | 2 years ago |
|
9b5812aca1 | 2 years ago |
|
498ef365ba | 2 years ago |
|
deb623fa3f | 2 years ago |
|
3aa416edd9 | 2 years ago |
|
385d869157 | 2 years ago |
|
b1cb070ce6 | 2 years ago |
|
57db857418 | 2 years ago |
465 changed files with 77224 additions and 6394 deletions
@ -1,39 +1,106 @@ |
|||||
# uniproject |
<p align="center"> |
||||
|
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;"> |
||||
|
</p> |
||||
|
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3> |
||||
|
<h3 align="center">多平台快速开发的UI框架</h3> |
||||
|
|
||||
#### 介绍 |
|
||||
{**以下是 Gitee 平台说明,您可以替换此简介** |
|
||||
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 |
|
||||
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} |
|
||||
|
|
||||
#### 软件架构 |
## 说明 |
||||
软件架构说明 |
|
||||
|
|
||||
|
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 |
||||
|
|
||||
#### 安装教程 |
## 特性 |
||||
|
|
||||
1. xxxx |
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序 |
||||
2. xxxx |
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用 |
||||
3. xxxx |
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨 |
||||
|
- 众多的常用页面和布局,让您专注逻辑,事半功倍 |
||||
|
- 详尽的文档支持,现代化的演示效果 |
||||
|
- 按需引入,精简打包体积 |
||||
|
|
||||
#### 使用说明 |
|
||||
|
|
||||
1. xxxx |
## 安装 |
||||
2. xxxx |
|
||||
3. xxxx |
|
||||
|
|
||||
#### 参与贡献 |
```bash |
||||
|
# npm方式安装 |
||||
|
npm i uview-ui |
||||
|
``` |
||||
|
|
||||
1. Fork 本仓库 |
## 快速上手 |
||||
2. 新建 Feat_xxx 分支 |
|
||||
3. 提交代码 |
|
||||
4. 新建 Pull Request |
|
||||
|
|
||||
|
1. `main.js`引入uView库 |
||||
|
```js |
||||
|
// main.js |
||||
|
import uView from 'uview-ui'; |
||||
|
Vue.use(uView); |
||||
|
``` |
||||
|
|
||||
#### 特技 |
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持) |
||||
|
```css |
||||
|
/* App.vue */ |
||||
|
<style lang="scss"> |
||||
|
@import "uview-ui/index.scss"; |
||||
|
</style> |
||||
|
``` |
||||
|
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md |
3. `uni.scss`引入全局scss变量文件 |
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) |
```css |
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 |
/* uni.scss */ |
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 |
@import "uview-ui/theme.scss"; |
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) |
``` |
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) |
|
||||
|
4. `pages.json`配置easycom规则(按需引入) |
||||
|
|
||||
|
```js |
||||
|
// pages.json |
||||
|
{ |
||||
|
"easycom": { |
||||
|
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/" |
||||
|
// npm安装方式 |
||||
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" |
||||
|
// 下载安装方式 |
||||
|
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" |
||||
|
}, |
||||
|
// 此为本身已有的内容 |
||||
|
"pages": [ |
||||
|
// ...... |
||||
|
] |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 |
||||
|
|
||||
|
## 使用方法 |
||||
|
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 |
||||
|
|
||||
|
```html |
||||
|
<template> |
||||
|
<u-button>按钮</u-button> |
||||
|
</template> |
||||
|
``` |
||||
|
|
||||
|
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 |
||||
|
|
||||
|
## 链接 |
||||
|
|
||||
|
- [官方文档](https://uviewui.com/) |
||||
|
- [更新日志](https://uviewui.com/components/changelog.html) |
||||
|
- [升级指南](https://uviewui.com/components/changelog.html) |
||||
|
- [关于我们](https://uviewui.com/cooperation/about.html) |
||||
|
|
||||
|
## 预览 |
||||
|
|
||||
|
您可以通过**微信**扫码,查看最佳的演示效果。 |
||||
|
<br> |
||||
|
<br> |
||||
|
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" > |
||||
|
|
||||
|
<!-- ## 捐赠uView的研发 |
||||
|
|
||||
|
uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。 |
||||
|
|
||||
|
<img src="https://uviewui.com/common/wechat.png" width="220" > |
||||
|
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" > |
||||
|
--> |
||||
|
## 版权信息 |
||||
|
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 |
||||
|
File diff suppressed because it is too large
@ -0,0 +1,17 @@ |
|||||
|
/* 解决js计算精度问题 */ |
||||
|
import { Decimal } from 'decimal.js';//引入
|
||||
|
class Calc { |
||||
|
add(num1,num2) { |
||||
|
return new Decimal(num1).add(new Decimal(num2)).toNumber() |
||||
|
} |
||||
|
sub(num1,num2) { |
||||
|
return new Decimal(num1).sub(new Decimal(num2)).toNumber() |
||||
|
} |
||||
|
mul(num1,num2) { |
||||
|
return new Decimal(num1).mul(new Decimal(num2)).toNumber() |
||||
|
} |
||||
|
div(num1,num2) { |
||||
|
return new Decimal(num1).div(new Decimal(num2)).toNumber() |
||||
|
} |
||||
|
} |
||||
|
export const calc = new Calc(); |
@ -0,0 +1,42 @@ |
|||||
|
const defaultData = { |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
name: '' |
||||
|
} |
||||
|
/**模拟后端请求*/ |
||||
|
export const simulationReqGetList = function(data = defaultData) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
let list = [] |
||||
|
if (data.pageIndex > 3) { |
||||
|
return resolve(list) |
||||
|
} |
||||
|
const startIndex = data.pageIndex * data.pageSize - data.pageSize |
||||
|
for (let i = startIndex; i < data.pageIndex * data.pageSize; i++) { |
||||
|
if (data.name) { |
||||
|
list.push({ |
||||
|
name: `第${data.name}${i + 1}条数据`, |
||||
|
code: `${i}-${i + 1}` |
||||
|
}) |
||||
|
} else { |
||||
|
list.push({ |
||||
|
name: `第${i + 1}条数据`, |
||||
|
code: `${i}-${i + 1}` |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
setTimeout(() => { |
||||
|
return resolve(list) |
||||
|
}, 1000) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export const getDataList = function() { |
||||
|
let list = [] |
||||
|
for (let i = 0; i < 200; i++) { |
||||
|
list.push({ |
||||
|
name: `第${i + 1}条数据`, |
||||
|
code: `${i}-${i + 1}` |
||||
|
}) |
||||
|
} |
||||
|
return list |
||||
|
} |
@ -1,5 +1,7 @@ |
|||||
let maxPageSize = 10; |
let maxPageSize = 10; |
||||
|
let version ="1.0" |
||||
|
|
||||
export default{ |
export default{ |
||||
maxPageSize |
maxPageSize, |
||||
|
version |
||||
} |
} |
File diff suppressed because it is too large
@ -1,59 +0,0 @@ |
|||||
<template> |
|
||||
<text style="text-decoration:underline" :href="href" @click="openURL" :inWhiteList="inWhiteList">{{text}}</text> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
/** |
|
||||
* @description u-link是一个外部网页超链接组件,在小程序内打开内部web-view组件或复制url,在app内打开外部浏览器,在h5端打开新网页 |
|
||||
* @property {String} href 点击后打开的外部网页url,小程序中必须以https://开头 |
|
||||
* @property {String} text 显示的文字 |
|
||||
* @property {Boolean} inWhiteList 是否在小程序白名单中,如果在的话,在小程序端会直接打开内置web-view,否则会只会复制url,提示在外部打开 |
|
||||
* @example * <u-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn" :inWhiteList="true"></u-link> |
|
||||
*/ |
|
||||
export default { |
|
||||
name: 'u-link', |
|
||||
props: { |
|
||||
href: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
text: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
inWhiteList: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
openURL() { |
|
||||
// #ifdef APP-PLUS |
|
||||
plus.runtime.openURL(this.href) //这里默认使用外部浏览器打开而不是内部web-view组件打开 |
|
||||
// #endif |
|
||||
// #ifdef H5 |
|
||||
window.open(this.href) |
|
||||
// #endif |
|
||||
// #ifdef MP |
|
||||
if (this.inWhiteList) { //如果在小程序的网址白名单中,会走内置webview打开,否则会复制网址提示在外部浏览器打开 |
|
||||
uni.navigateTo({ |
|
||||
url: '/pages/component/web-view/web-view?url=' + this.href |
|
||||
}); |
|
||||
} else { |
|
||||
uni.setClipboardData({ |
|
||||
data: this.href |
|
||||
}); |
|
||||
uni.showModal({ |
|
||||
content: '本网址无法直接在小程序内打开。已自动复制网址,请在手机浏览器里粘贴该网址', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
// #endif |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style> |
|
||||
|
|
||||
</style> |
|
@ -0,0 +1,39 @@ |
|||||
|
## 1.0.8(2024-03-28) |
||||
|
- 修复 在vue2下:style动态绑定导致编译失败的bug |
||||
|
## 1.0.7(2024-01-20) |
||||
|
- 修复 长文本回显超过容器的bug,超过容器部分显示省略号 |
||||
|
## 1.0.6(2023-04-12) |
||||
|
- 修复 微信小程序点击时会改变背景颜色的 bug |
||||
|
## 1.0.5(2023-02-03) |
||||
|
- 修复 禁用时会显示清空按钮 |
||||
|
## 1.0.4(2023-02-02) |
||||
|
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果 |
||||
|
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue |
||||
|
## 1.0.3(2023-01-16) |
||||
|
- 修复 不关联服务空间报错的问题 |
||||
|
## 1.0.2(2023-01-14) |
||||
|
- 新增 属性 `format` 可用于格式化显示选项内容 |
||||
|
## 1.0.1(2022-12-06) |
||||
|
- 修复 当where变化时,数据不会自动更新的问题 |
||||
|
## 0.1.9(2022-09-05) |
||||
|
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框 |
||||
|
## 0.1.8(2022-08-29) |
||||
|
- 修复 点击的位置不准确 |
||||
|
## 0.1.7(2022-08-12) |
||||
|
- 新增 支持 disabled 属性 |
||||
|
## 0.1.6(2022-07-06) |
||||
|
- 修复 pc端宽度异常的bug |
||||
|
## 0.1.5 |
||||
|
- 修复 pc端宽度异常的bug |
||||
|
## 0.1.4(2022-07-05) |
||||
|
- 优化 显示样式 |
||||
|
## 0.1.3(2022-06-02) |
||||
|
- 修复 localdata 赋值不生效的 bug |
||||
|
- 新增 支持 uni.scss 修改颜色 |
||||
|
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用) |
||||
|
## 0.1.2(2022-05-08) |
||||
|
- 修复 当 value 为 0 时选择不生效的 bug |
||||
|
## 0.1.1(2022-05-07) |
||||
|
- 新增 记住上次的选项(仅 collection 存在时有效) |
||||
|
## 0.1.0(2022-04-22) |
||||
|
- 初始化 |
@ -0,0 +1,562 @@ |
|||||
|
<template> |
||||
|
<view class="uni-stat__select"> |
||||
|
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span> |
||||
|
<view class="uni-stat-box" :class="{'uni-stat__actived': current}"> |
||||
|
<view class="uni-select" :class="{'uni-select--disabled':disabled}"> |
||||
|
<view class="uni-select__input-box" @click="toggleSelector"> |
||||
|
<view v-if="current" class="uni-select__input-text">{{textShow}}</view> |
||||
|
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view> |
||||
|
<view v-if="current && clear && !disabled" @click.stop="clearVal"> |
||||
|
<uni-icons type="clear" color="#c0c4cc" size="24" /> |
||||
|
</view> |
||||
|
<view v-else> |
||||
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" /> |
||||
|
<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector"> |
||||
|
<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view> |
||||
|
<scroll-view scroll-y="true" class="uni-select__selector-scroll"> |
||||
|
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0"> |
||||
|
<text>{{emptyTips}}</text> |
||||
|
</view> |
||||
|
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index" |
||||
|
@click="change(item)"> |
||||
|
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/** |
||||
|
* DataChecklist 数据选择器 |
||||
|
* @description 通过数据渲染的下拉框组件 |
||||
|
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select |
||||
|
* @property {String} value 默认值 |
||||
|
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}] |
||||
|
* @property {Boolean} clear 是否可以清空已选项 |
||||
|
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效 |
||||
|
* @property {String} label 左侧标题 |
||||
|
* @property {String} placeholder 输入框的提示文字 |
||||
|
* @property {Boolean} disabled 是否禁用 |
||||
|
* @property {String} placement 弹出位置 |
||||
|
* @value top 顶部弹出 |
||||
|
* @value bottom 底部弹出(default) |
||||
|
* @event {Function} change 选中发生变化触发 |
||||
|
*/ |
||||
|
|
||||
|
export default { |
||||
|
name: "uni-data-select", |
||||
|
mixins: [uniCloud.mixinDatacom || {}], |
||||
|
props: { |
||||
|
localdata: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
value: { |
||||
|
type: [String, Number], |
||||
|
default: '' |
||||
|
}, |
||||
|
modelValue: { |
||||
|
type: [String, Number], |
||||
|
default: '' |
||||
|
}, |
||||
|
label: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
placeholder: { |
||||
|
type: String, |
||||
|
default: '请选择' |
||||
|
}, |
||||
|
emptyTips: { |
||||
|
type: String, |
||||
|
default: '无选项' |
||||
|
}, |
||||
|
clear: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
defItem: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
disabled: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}" |
||||
|
format: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
placement: { |
||||
|
type: String, |
||||
|
default: 'bottom' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
showSelector: false, |
||||
|
current: '', |
||||
|
mixinDatacomResData: [], |
||||
|
apps: [], |
||||
|
channels: [], |
||||
|
cacheKey: "uni-data-select-lastSelectedValue", |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.debounceGet = this.debounce(() => { |
||||
|
this.query(); |
||||
|
}, 300); |
||||
|
if (this.collection && !this.localdata.length) { |
||||
|
this.debounceGet(); |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
typePlaceholder() { |
||||
|
const text = { |
||||
|
'opendb-stat-app-versions': '版本', |
||||
|
'opendb-app-channels': '渠道', |
||||
|
'opendb-app-list': '应用' |
||||
|
} |
||||
|
const common = this.placeholder |
||||
|
const placeholder = text[this.collection] |
||||
|
return placeholder ? |
||||
|
common + placeholder : |
||||
|
common |
||||
|
}, |
||||
|
valueCom() { |
||||
|
// #ifdef VUE3 |
||||
|
return this.modelValue; |
||||
|
// #endif |
||||
|
// #ifndef VUE3 |
||||
|
return this.value; |
||||
|
// #endif |
||||
|
}, |
||||
|
textShow() { |
||||
|
// 长文本显示 |
||||
|
let text = this.current; |
||||
|
if (text.length > 10) { |
||||
|
return text.slice(0, 25) + '...'; |
||||
|
} |
||||
|
return text; |
||||
|
}, |
||||
|
getOffsetByPlacement() { |
||||
|
switch (this.placement) { |
||||
|
case 'top': |
||||
|
return "bottom:calc(100% + 12px);"; |
||||
|
case 'bottom': |
||||
|
return "top:calc(100% + 12px);"; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
localdata: { |
||||
|
immediate: true, |
||||
|
handler(val, old) { |
||||
|
if (Array.isArray(val) && old !== val) { |
||||
|
this.mixinDatacomResData = val |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
valueCom(val, old) { |
||||
|
this.initDefVal() |
||||
|
}, |
||||
|
mixinDatacomResData: { |
||||
|
immediate: true, |
||||
|
handler(val) { |
||||
|
if (val.length) { |
||||
|
this.initDefVal() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
debounce(fn, time = 100) { |
||||
|
let timer = null |
||||
|
return function(...args) { |
||||
|
if (timer) clearTimeout(timer) |
||||
|
timer = setTimeout(() => { |
||||
|
fn.apply(this, args) |
||||
|
}, time) |
||||
|
} |
||||
|
}, |
||||
|
// 执行数据库查询 |
||||
|
query() { |
||||
|
this.mixinDatacomEasyGet(); |
||||
|
}, |
||||
|
// 监听查询条件变更事件 |
||||
|
onMixinDatacomPropsChange() { |
||||
|
if (this.collection) { |
||||
|
this.debounceGet(); |
||||
|
} |
||||
|
}, |
||||
|
initDefVal() { |
||||
|
let defValue = '' |
||||
|
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) { |
||||
|
defValue = this.valueCom |
||||
|
} else { |
||||
|
let strogeValue |
||||
|
if (this.collection) { |
||||
|
strogeValue = this.getCache() |
||||
|
} |
||||
|
if (strogeValue || strogeValue === 0) { |
||||
|
defValue = strogeValue |
||||
|
} else { |
||||
|
let defItem = '' |
||||
|
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) { |
||||
|
defItem = this.mixinDatacomResData[this.defItem - 1].value |
||||
|
} |
||||
|
defValue = defItem |
||||
|
} |
||||
|
if (defValue || defValue === 0) { |
||||
|
this.emit(defValue) |
||||
|
} |
||||
|
} |
||||
|
const def = this.mixinDatacomResData.find(item => item.value === defValue) |
||||
|
this.current = def ? this.formatItemName(def) : '' |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* @param {[String, Number]} value |
||||
|
* 判断用户给的 value 是否同时为禁用状态 |
||||
|
*/ |
||||
|
isDisabled(value) { |
||||
|
let isDisabled = false; |
||||
|
|
||||
|
this.mixinDatacomResData.forEach(item => { |
||||
|
if (item.value === value) { |
||||
|
isDisabled = item.disable |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
return isDisabled; |
||||
|
}, |
||||
|
|
||||
|
clearVal() { |
||||
|
this.emit('') |
||||
|
if (this.collection) { |
||||
|
this.removeCache() |
||||
|
} |
||||
|
}, |
||||
|
change(item) { |
||||
|
if (!item.disable) { |
||||
|
this.showSelector = false |
||||
|
this.current = this.formatItemName(item) |
||||
|
this.emit(item.value) |
||||
|
} |
||||
|
}, |
||||
|
emit(val) { |
||||
|
this.$emit('input', val) |
||||
|
this.$emit('update:modelValue', val) |
||||
|
this.$emit('change', val) |
||||
|
if (this.collection) { |
||||
|
this.setCache(val); |
||||
|
} |
||||
|
}, |
||||
|
toggleSelector() { |
||||
|
if (this.disabled) { |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
this.showSelector = !this.showSelector |
||||
|
}, |
||||
|
formatItemName(item) { |
||||
|
let { |
||||
|
text, |
||||
|
value, |
||||
|
channel_code |
||||
|
} = item |
||||
|
channel_code = channel_code ? `(${channel_code})` : '' |
||||
|
|
||||
|
if (this.format) { |
||||
|
// 格式化输出 |
||||
|
let str = ""; |
||||
|
str = this.format; |
||||
|
for (let key in item) { |
||||
|
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]); |
||||
|
} |
||||
|
return str; |
||||
|
} else { |
||||
|
return this.collection.indexOf('app-list') > 0 ? |
||||
|
`${text}(${value})` : |
||||
|
( |
||||
|
text ? |
||||
|
text : |
||||
|
`未命名${channel_code}` |
||||
|
) |
||||
|
} |
||||
|
}, |
||||
|
// 获取当前加载的数据 |
||||
|
getLoadData() { |
||||
|
return this.mixinDatacomResData; |
||||
|
}, |
||||
|
// 获取当前缓存key |
||||
|
getCurrentCacheKey() { |
||||
|
return this.collection; |
||||
|
}, |
||||
|
// 获取缓存 |
||||
|
getCache(name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
return cacheData[name]; |
||||
|
}, |
||||
|
// 设置缓存 |
||||
|
setCache(value, name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
cacheData[name] = value; |
||||
|
uni.setStorageSync(this.cacheKey, cacheData); |
||||
|
}, |
||||
|
// 删除缓存 |
||||
|
removeCache(name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
delete cacheData[name]; |
||||
|
uni.setStorageSync(this.cacheKey, cacheData); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
$uni-base-color: #6a6a6a !default; |
||||
|
$uni-main-color: #333 !default; |
||||
|
$uni-secondary-color: #909399 !default; |
||||
|
$uni-border-3: #e5e5e5; |
||||
|
|
||||
|
/* #ifndef APP-NVUE */ |
||||
|
@media screen and (max-width: 500px) { |
||||
|
.hide-on-phone { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* #endif */ |
||||
|
.uni-stat__select { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
// padding: 15px; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.uni-stat-box { |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.uni-stat__actived { |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
// outline: 1px solid #2979ff; |
||||
|
} |
||||
|
|
||||
|
.uni-label-text { |
||||
|
font-size: 14px; |
||||
|
font-weight: bold; |
||||
|
color: $uni-base-color; |
||||
|
margin: auto 0; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.uni-select { |
||||
|
font-size: 14px; |
||||
|
border: 1px solid $uni-border-3; |
||||
|
box-sizing: border-box; |
||||
|
border-radius: 4px; |
||||
|
padding: 0 5px; |
||||
|
padding-left: 10px; |
||||
|
position: relative; |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
user-select: none; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
border-bottom: solid 1px $uni-border-3; |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
height: 35px; |
||||
|
|
||||
|
&--disabled { |
||||
|
background-color: #f5f7fa; |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.uni-select__label { |
||||
|
font-size: 16px; |
||||
|
// line-height: 22px; |
||||
|
height: 35px; |
||||
|
padding-right: 10px; |
||||
|
color: $uni-secondary-color; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-box { |
||||
|
height: 35px; |
||||
|
position: relative; |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex: 1; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input { |
||||
|
flex: 1; |
||||
|
font-size: 14px; |
||||
|
height: 22px; |
||||
|
line-height: 22px; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-plac { |
||||
|
font-size: 14px; |
||||
|
color: $uni-secondary-color; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
box-sizing: border-box; |
||||
|
/* #endif */ |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
border: 1px solid #EBEEF5; |
||||
|
border-radius: 6px; |
||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
||||
|
z-index: 3; |
||||
|
padding: 4px 0; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-scroll { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
max-height: 200px; |
||||
|
box-sizing: border-box; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
/* #ifdef H5 */ |
||||
|
@media (min-width: 768px) { |
||||
|
.uni-select__selector-scroll { |
||||
|
max-height: 600px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* #endif */ |
||||
|
|
||||
|
.uni-select__selector-empty, |
||||
|
.uni-select__selector-item { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
line-height: 35px; |
||||
|
font-size: 14px; |
||||
|
text-align: center; |
||||
|
/* border-bottom: solid 1px $uni-border-3; */ |
||||
|
padding: 0px 10px; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-item:hover { |
||||
|
background-color: #f9f9f9; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-empty:last-child, |
||||
|
.uni-select__selector-item:last-child { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
border-bottom: none; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector__disabled { |
||||
|
opacity: 0.4; |
||||
|
cursor: default; |
||||
|
} |
||||
|
|
||||
|
/* picker 弹出层通用的指示小三角 */ |
||||
|
.uni-popper__arrow_bottom, |
||||
|
.uni-popper__arrow_bottom::after, |
||||
|
.uni-popper__arrow_top, |
||||
|
.uni-popper__arrow_top::after, |
||||
|
{ |
||||
|
position: absolute; |
||||
|
display: block; |
||||
|
width: 0; |
||||
|
height: 0; |
||||
|
border-color: transparent; |
||||
|
border-style: solid; |
||||
|
border-width: 6px; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_bottom { |
||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||
|
top: -6px; |
||||
|
left: 10%; |
||||
|
margin-right: 3px; |
||||
|
border-top-width: 0; |
||||
|
border-bottom-color: #EBEEF5; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_bottom::after { |
||||
|
content: " "; |
||||
|
top: 1px; |
||||
|
margin-left: -6px; |
||||
|
border-top-width: 0; |
||||
|
border-bottom-color: #fff; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_top { |
||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||
|
bottom: -6px; |
||||
|
left: 10%; |
||||
|
margin-right: 3px; |
||||
|
border-bottom-width: 0; |
||||
|
border-top-color: #EBEEF5; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_top::after { |
||||
|
content: " "; |
||||
|
bottom: 1px; |
||||
|
margin-left: -6px; |
||||
|
border-bottom-width: 0; |
||||
|
border-top-color: #fff; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.uni-select__input-text { |
||||
|
// width: 280px; |
||||
|
width: 100%; |
||||
|
color: $uni-main-color; |
||||
|
white-space: nowrap; |
||||
|
text-overflow: ellipsis; |
||||
|
-o-text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-placeholder { |
||||
|
color: $uni-base-color; |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
|
||||
|
.uni-select--mask { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,86 @@ |
|||||
|
{ |
||||
|
"id": "uni-data-select", |
||||
|
"displayName": "uni-data-select 下拉框选择器", |
||||
|
"version": "1.0.8", |
||||
|
"description": "通过数据驱动的下拉框选择器", |
||||
|
"keywords": [ |
||||
|
"uni-ui", |
||||
|
"select", |
||||
|
"uni-data-select", |
||||
|
"下拉框", |
||||
|
"下拉选" |
||||
|
], |
||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||
|
"engines": { |
||||
|
"HBuilderX": "^3.1.1" |
||||
|
}, |
||||
|
"directories": { |
||||
|
"example": "../../temps/example_temps" |
||||
|
}, |
||||
|
"dcloudext": { |
||||
|
"sale": { |
||||
|
"regular": { |
||||
|
"price": "0.00" |
||||
|
}, |
||||
|
"sourcecode": { |
||||
|
"price": "0.00" |
||||
|
} |
||||
|
}, |
||||
|
"contact": { |
||||
|
"qq": "" |
||||
|
}, |
||||
|
"declaration": { |
||||
|
"ads": "无", |
||||
|
"data": "无", |
||||
|
"permissions": "无" |
||||
|
}, |
||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", |
||||
|
"type": "component-vue" |
||||
|
}, |
||||
|
"uni_modules": { |
||||
|
"dependencies": ["uni-load-more"], |
||||
|
"encrypt": [], |
||||
|
"platforms": { |
||||
|
"cloud": { |
||||
|
"tcb": "y", |
||||
|
"aliyun": "y", |
||||
|
"alipay": "n" |
||||
|
}, |
||||
|
"client": { |
||||
|
"App": { |
||||
|
"app-vue": "u", |
||||
|
"app-nvue": "n" |
||||
|
}, |
||||
|
"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", |
||||
|
"阿里": "u", |
||||
|
"百度": "u", |
||||
|
"字节跳动": "u", |
||||
|
"QQ": "u", |
||||
|
"京东": "u" |
||||
|
}, |
||||
|
"快应用": { |
||||
|
"华为": "u", |
||||
|
"联盟": "u" |
||||
|
}, |
||||
|
"Vue": { |
||||
|
"vue2": "y", |
||||
|
"vue3": "y" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
## DataSelect 下拉框选择器 |
||||
|
> **组件名:uni-data-select** |
||||
|
> 代码块: `uDataSelect` |
||||
|
|
||||
|
当选项过多时,使用下拉菜单展示并选择内容 |
||||
|
|
||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select) |
||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
@ -0,0 +1,562 @@ |
|||||
|
<template> |
||||
|
<view class="uni-stat__select"> |
||||
|
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span> |
||||
|
<view class="uni-stat-box" :class="{'uni-stat__actived': current}"> |
||||
|
<view class="uni-select" :class="{'uni-select--disabled':disabled}"> |
||||
|
<view class="uni-select__input-box" @click="toggleSelector"> |
||||
|
<view v-if="current" class="uni-select__input-text">{{textShow}}</view> |
||||
|
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view> |
||||
|
<view v-if="current && clear && !disabled" @click.stop="clearVal"> |
||||
|
<uni-icons type="clear" color="#c0c4cc" size="24" /> |
||||
|
</view> |
||||
|
<view v-else> |
||||
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" /> |
||||
|
<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector"> |
||||
|
<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view> |
||||
|
<scroll-view scroll-y="true" class="uni-select__selector-scroll"> |
||||
|
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0"> |
||||
|
<text>{{emptyTips}}</text> |
||||
|
</view> |
||||
|
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index" |
||||
|
@click="change(item)"> |
||||
|
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
/** |
||||
|
* DataChecklist 数据选择器 |
||||
|
* @description 通过数据渲染的下拉框组件 |
||||
|
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select |
||||
|
* @property {String} value 默认值 |
||||
|
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}] |
||||
|
* @property {Boolean} clear 是否可以清空已选项 |
||||
|
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效 |
||||
|
* @property {String} label 左侧标题 |
||||
|
* @property {String} placeholder 输入框的提示文字 |
||||
|
* @property {Boolean} disabled 是否禁用 |
||||
|
* @property {String} placement 弹出位置 |
||||
|
* @value top 顶部弹出 |
||||
|
* @value bottom 底部弹出(default) |
||||
|
* @event {Function} change 选中发生变化触发 |
||||
|
*/ |
||||
|
|
||||
|
export default { |
||||
|
name: "uni-data-select", |
||||
|
mixins: [uniCloud.mixinDatacom || {}], |
||||
|
props: { |
||||
|
localdata: { |
||||
|
type: Array, |
||||
|
default () { |
||||
|
return [] |
||||
|
} |
||||
|
}, |
||||
|
value: { |
||||
|
type: [String, Number], |
||||
|
default: '' |
||||
|
}, |
||||
|
modelValue: { |
||||
|
type: [String, Number], |
||||
|
default: '' |
||||
|
}, |
||||
|
label: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
placeholder: { |
||||
|
type: String, |
||||
|
default: '请选择' |
||||
|
}, |
||||
|
emptyTips: { |
||||
|
type: String, |
||||
|
default: '无选项' |
||||
|
}, |
||||
|
clear: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
defItem: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
disabled: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}" |
||||
|
format: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
placement: { |
||||
|
type: String, |
||||
|
default: 'bottom' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
showSelector: false, |
||||
|
current: '', |
||||
|
mixinDatacomResData: [], |
||||
|
apps: [], |
||||
|
channels: [], |
||||
|
cacheKey: "uni-data-select-lastSelectedValue", |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.debounceGet = this.debounce(() => { |
||||
|
this.query(); |
||||
|
}, 300); |
||||
|
if (this.collection && !this.localdata.length) { |
||||
|
this.debounceGet(); |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
typePlaceholder() { |
||||
|
const text = { |
||||
|
'opendb-stat-app-versions': '版本', |
||||
|
'opendb-app-channels': '渠道', |
||||
|
'opendb-app-list': '应用' |
||||
|
} |
||||
|
const common = this.placeholder |
||||
|
const placeholder = text[this.collection] |
||||
|
return placeholder ? |
||||
|
common + placeholder : |
||||
|
common |
||||
|
}, |
||||
|
valueCom() { |
||||
|
// #ifdef VUE3 |
||||
|
return this.modelValue; |
||||
|
// #endif |
||||
|
// #ifndef VUE3 |
||||
|
return this.value; |
||||
|
// #endif |
||||
|
}, |
||||
|
textShow() { |
||||
|
// 长文本显示 |
||||
|
let text = this.current; |
||||
|
if (text.length > 10) { |
||||
|
return text.slice(0, 25) + '...'; |
||||
|
} |
||||
|
return text; |
||||
|
}, |
||||
|
getOffsetByPlacement() { |
||||
|
switch (this.placement) { |
||||
|
case 'top': |
||||
|
return "bottom:calc(100% + 12px);"; |
||||
|
case 'bottom': |
||||
|
return "top:calc(100% + 12px);"; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
localdata: { |
||||
|
immediate: true, |
||||
|
handler(val, old) { |
||||
|
if (Array.isArray(val) && old !== val) { |
||||
|
this.mixinDatacomResData = val |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
valueCom(val, old) { |
||||
|
this.initDefVal() |
||||
|
}, |
||||
|
mixinDatacomResData: { |
||||
|
immediate: true, |
||||
|
handler(val) { |
||||
|
if (val.length) { |
||||
|
this.initDefVal() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
debounce(fn, time = 100) { |
||||
|
let timer = null |
||||
|
return function(...args) { |
||||
|
if (timer) clearTimeout(timer) |
||||
|
timer = setTimeout(() => { |
||||
|
fn.apply(this, args) |
||||
|
}, time) |
||||
|
} |
||||
|
}, |
||||
|
// 执行数据库查询 |
||||
|
query() { |
||||
|
this.mixinDatacomEasyGet(); |
||||
|
}, |
||||
|
// 监听查询条件变更事件 |
||||
|
onMixinDatacomPropsChange() { |
||||
|
if (this.collection) { |
||||
|
this.debounceGet(); |
||||
|
} |
||||
|
}, |
||||
|
initDefVal() { |
||||
|
let defValue = '' |
||||
|
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) { |
||||
|
defValue = this.valueCom |
||||
|
} else { |
||||
|
let strogeValue |
||||
|
if (this.collection) { |
||||
|
strogeValue = this.getCache() |
||||
|
} |
||||
|
if (strogeValue || strogeValue === 0) { |
||||
|
defValue = strogeValue |
||||
|
} else { |
||||
|
let defItem = '' |
||||
|
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) { |
||||
|
defItem = this.mixinDatacomResData[this.defItem - 1].value |
||||
|
} |
||||
|
defValue = defItem |
||||
|
} |
||||
|
if (defValue || defValue === 0) { |
||||
|
this.emit(defValue) |
||||
|
} |
||||
|
} |
||||
|
const def = this.mixinDatacomResData.find(item => item.value === defValue) |
||||
|
this.current = def ? this.formatItemName(def) : '' |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* @param {[String, Number]} value |
||||
|
* 判断用户给的 value 是否同时为禁用状态 |
||||
|
*/ |
||||
|
isDisabled(value) { |
||||
|
let isDisabled = false; |
||||
|
|
||||
|
this.mixinDatacomResData.forEach(item => { |
||||
|
if (item.value === value) { |
||||
|
isDisabled = item.disable |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
return isDisabled; |
||||
|
}, |
||||
|
|
||||
|
clearVal() { |
||||
|
this.emit('') |
||||
|
if (this.collection) { |
||||
|
this.removeCache() |
||||
|
} |
||||
|
}, |
||||
|
change(item) { |
||||
|
if (!item.disable) { |
||||
|
this.showSelector = false |
||||
|
this.current = this.formatItemName(item) |
||||
|
this.emit(item.value) |
||||
|
} |
||||
|
}, |
||||
|
emit(val) { |
||||
|
this.$emit('input', val) |
||||
|
this.$emit('update:modelValue', val) |
||||
|
this.$emit('change', val) |
||||
|
if (this.collection) { |
||||
|
this.setCache(val); |
||||
|
} |
||||
|
}, |
||||
|
toggleSelector() { |
||||
|
if (this.disabled) { |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
this.showSelector = !this.showSelector |
||||
|
}, |
||||
|
formatItemName(item) { |
||||
|
let { |
||||
|
text, |
||||
|
value, |
||||
|
channel_code |
||||
|
} = item |
||||
|
channel_code = channel_code ? `(${channel_code})` : '' |
||||
|
|
||||
|
if (this.format) { |
||||
|
// 格式化输出 |
||||
|
let str = ""; |
||||
|
str = this.format; |
||||
|
for (let key in item) { |
||||
|
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]); |
||||
|
} |
||||
|
return str; |
||||
|
} else { |
||||
|
return this.collection.indexOf('app-list') > 0 ? |
||||
|
`${text}(${value})` : |
||||
|
( |
||||
|
text ? |
||||
|
text : |
||||
|
`未命名${channel_code}` |
||||
|
) |
||||
|
} |
||||
|
}, |
||||
|
// 获取当前加载的数据 |
||||
|
getLoadData() { |
||||
|
return this.mixinDatacomResData; |
||||
|
}, |
||||
|
// 获取当前缓存key |
||||
|
getCurrentCacheKey() { |
||||
|
return this.collection; |
||||
|
}, |
||||
|
// 获取缓存 |
||||
|
getCache(name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
return cacheData[name]; |
||||
|
}, |
||||
|
// 设置缓存 |
||||
|
setCache(value, name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
cacheData[name] = value; |
||||
|
uni.setStorageSync(this.cacheKey, cacheData); |
||||
|
}, |
||||
|
// 删除缓存 |
||||
|
removeCache(name = this.getCurrentCacheKey()) { |
||||
|
let cacheData = uni.getStorageSync(this.cacheKey) || {}; |
||||
|
delete cacheData[name]; |
||||
|
uni.setStorageSync(this.cacheKey, cacheData); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
$uni-base-color: #6a6a6a !default; |
||||
|
$uni-main-color: #333 !default; |
||||
|
$uni-secondary-color: #909399 !default; |
||||
|
$uni-border-3: #e5e5e5; |
||||
|
|
||||
|
/* #ifndef APP-NVUE */ |
||||
|
@media screen and (max-width: 500px) { |
||||
|
.hide-on-phone { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* #endif */ |
||||
|
.uni-stat__select { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
// padding: 15px; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.uni-stat-box { |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.uni-stat__actived { |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
// outline: 1px solid #2979ff; |
||||
|
} |
||||
|
|
||||
|
.uni-label-text { |
||||
|
font-size: 14px; |
||||
|
font-weight: bold; |
||||
|
color: $uni-base-color; |
||||
|
margin: auto 0; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.uni-select { |
||||
|
font-size: 14px; |
||||
|
border: 1px solid $uni-border-3; |
||||
|
box-sizing: border-box; |
||||
|
border-radius: 4px; |
||||
|
padding: 0 5px; |
||||
|
padding-left: 10px; |
||||
|
position: relative; |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
user-select: none; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
border-bottom: solid 1px $uni-border-3; |
||||
|
width: 100%; |
||||
|
flex: 1; |
||||
|
height: 35px; |
||||
|
|
||||
|
&--disabled { |
||||
|
background-color: #f5f7fa; |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.uni-select__label { |
||||
|
font-size: 16px; |
||||
|
// line-height: 22px; |
||||
|
height: 35px; |
||||
|
padding-right: 10px; |
||||
|
color: $uni-secondary-color; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-box { |
||||
|
height: 35px; |
||||
|
position: relative; |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex: 1; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input { |
||||
|
flex: 1; |
||||
|
font-size: 14px; |
||||
|
height: 22px; |
||||
|
line-height: 22px; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-plac { |
||||
|
font-size: 14px; |
||||
|
color: $uni-secondary-color; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
box-sizing: border-box; |
||||
|
/* #endif */ |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
background-color: #FFFFFF; |
||||
|
border: 1px solid #EBEEF5; |
||||
|
border-radius: 6px; |
||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
||||
|
z-index: 3; |
||||
|
padding: 4px 0; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-scroll { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
max-height: 200px; |
||||
|
box-sizing: border-box; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
/* #ifdef H5 */ |
||||
|
@media (min-width: 768px) { |
||||
|
.uni-select__selector-scroll { |
||||
|
max-height: 600px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* #endif */ |
||||
|
|
||||
|
.uni-select__selector-empty, |
||||
|
.uni-select__selector-item { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
line-height: 35px; |
||||
|
font-size: 14px; |
||||
|
text-align: center; |
||||
|
/* border-bottom: solid 1px $uni-border-3; */ |
||||
|
padding: 0px 10px; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-item:hover { |
||||
|
background-color: #f9f9f9; |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector-empty:last-child, |
||||
|
.uni-select__selector-item:last-child { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
border-bottom: none; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
.uni-select__selector__disabled { |
||||
|
opacity: 0.4; |
||||
|
cursor: default; |
||||
|
} |
||||
|
|
||||
|
/* picker 弹出层通用的指示小三角 */ |
||||
|
.uni-popper__arrow_bottom, |
||||
|
.uni-popper__arrow_bottom::after, |
||||
|
.uni-popper__arrow_top, |
||||
|
.uni-popper__arrow_top::after, |
||||
|
{ |
||||
|
position: absolute; |
||||
|
display: block; |
||||
|
width: 0; |
||||
|
height: 0; |
||||
|
border-color: transparent; |
||||
|
border-style: solid; |
||||
|
border-width: 6px; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_bottom { |
||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||
|
top: -6px; |
||||
|
left: 10%; |
||||
|
margin-right: 3px; |
||||
|
border-top-width: 0; |
||||
|
border-bottom-color: #EBEEF5; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_bottom::after { |
||||
|
content: " "; |
||||
|
top: 1px; |
||||
|
margin-left: -6px; |
||||
|
border-top-width: 0; |
||||
|
border-bottom-color: #fff; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_top { |
||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||
|
bottom: -6px; |
||||
|
left: 10%; |
||||
|
margin-right: 3px; |
||||
|
border-bottom-width: 0; |
||||
|
border-top-color: #EBEEF5; |
||||
|
} |
||||
|
|
||||
|
.uni-popper__arrow_top::after { |
||||
|
content: " "; |
||||
|
bottom: 1px; |
||||
|
margin-left: -6px; |
||||
|
border-bottom-width: 0; |
||||
|
border-top-color: #fff; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.uni-select__input-text { |
||||
|
// width: 280px; |
||||
|
width: 100%; |
||||
|
color: $uni-main-color; |
||||
|
white-space: nowrap; |
||||
|
text-overflow: ellipsis; |
||||
|
-o-text-overflow: ellipsis; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.uni-select__input-placeholder { |
||||
|
color: $uni-base-color; |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
|
||||
|
.uni-select--mask { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,249 @@ |
|||||
|
<!-- 这个文件是虚拟列表中的实际cell --> |
||||
|
<template> |
||||
|
<view class="item"> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item :right-options="options" :auto-close="false" @click="swipeClick($event,item)"> |
||||
|
<view class="detail-content common_card"> |
||||
|
<view class="choose_main"> |
||||
|
<view class="ljh_box"> |
||||
|
<view class="ljh_info"> |
||||
|
<view class="tit_ljh">{{index+1+'.'+item.itemCode }}</view> |
||||
|
<view class="label_xm font_sm fr">{{ item.packingCode }}</view> |
||||
|
</view> |
||||
|
<view class="desc_card uni-flex space-between"> |
||||
|
<view class="desc_ljh"> |
||||
|
<view class="font_xs text_lightblue"> {{ item.itemName }}</view> |
||||
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="list_form"> |
||||
|
<view> |
||||
|
<uni-table style="overflow-x: hidden; "> |
||||
|
<uni-tr> |
||||
|
<uni-th width="100"></uni-th> |
||||
|
<uni-th width="100" align="center">库存</uni-th> |
||||
|
<uni-th width="100" align="center">盘点</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="100">数量({{item.uom}})</uni-th> |
||||
|
<uni-th width="100" align="center"> |
||||
|
<text class="text_black">{{item.inventoryQty}}</text> |
||||
|
</uni-th> |
||||
|
<uni-th width="100" align="center"> |
||||
|
<view class="flex" style="align-items: center;justify-content: center;" |
||||
|
v-if="item.scaned && item.packingCode"> |
||||
|
<text class="text_black">{{item.countQty}} </text> |
||||
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
||||
|
<text class="fl font_xs">修改</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="flex" style=" align-items: center;justify-content: center;" |
||||
|
v-if="item.packingCode==''"> |
||||
|
<text class="text_black">{{item.countQty}} </text> |
||||
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
||||
|
<text class="fl font_xs">修改</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="" v-else-if="!item.scaned"> |
||||
|
<text class="text_black">{{item.countQty}}</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
</uni-table> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="margin:0 20rpx 20rpx;"> |
||||
|
<view class="uni-flex uni-row bot_card"> |
||||
|
<view class="bot_card_item"> |
||||
|
<label class="icon_bg icon_bg_kw" style="text-align: center;"> |
||||
|
<text |
||||
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">库</text> |
||||
|
</label> |
||||
|
<text>{{ item.locationCode }}</text> |
||||
|
</view> |
||||
|
<view class="bot_card_item"> |
||||
|
<label class="icon_bg icon_bg_pc"> |
||||
|
<text |
||||
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">批</text> |
||||
|
</label> |
||||
|
<text>{{item.lot}}</text> |
||||
|
</view> |
||||
|
<view class="bot_card_item" style="width: 25%;"> |
||||
|
<view class="uni-flex" v-if="item.isNew "> |
||||
|
<!-- picker的index默认是0 --> |
||||
|
<picker picker @change="bindPickerChange($event,item)" :value="item.status-1" |
||||
|
:range="statusArray"> |
||||
|
<view class="uni-flex " style="padding:5px 0px;"> |
||||
|
<text class="state_point" |
||||
|
:class="statusStyle(item.status)">{{statusArray[item.status-1]}}</text> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_down.svg"> |
||||
|
</image> |
||||
|
</view> |
||||
|
</picker> |
||||
|
</view> |
||||
|
<text v-else class="state_point" :class=" statusStyle(item.status)"> |
||||
|
{{ statusColor(item.status )}} |
||||
|
</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" |
||||
|
v-if="item.scaned || item.packingCode==''"> |
||||
|
<text class="font_xs" |
||||
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
||||
|
<view class="photo_btn fr" @click="openEditCountDesc(item)"> |
||||
|
<text class="fl font_xs" style="width:65px;">盘点描述</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view v-if="item.scaned" class="choose_marked_count" |
||||
|
style="background-color: #5FCB94; opacity: 0.65"> |
||||
|
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;"> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getInventoryStatusDesc, |
||||
|
getInventoryTypeStyle |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusArray |
||||
|
} from '@/common/array.js' |
||||
|
|
||||
|
export default { |
||||
|
name: "virtual-list-test-cell", |
||||
|
props: { |
||||
|
item: null, |
||||
|
index: 0, |
||||
|
extraData: null |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
type: '', |
||||
|
id: '', |
||||
|
datacontent: {}, |
||||
|
details: [], |
||||
|
allDetails: [], //所以的明细 |
||||
|
currentItem: {}, |
||||
|
editDescItem: {}, |
||||
|
editCountItem: {}, |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
scanResult: {}, |
||||
|
allCount: 0, |
||||
|
newCount: 0, |
||||
|
scanCount: 0, |
||||
|
options: [{ |
||||
|
text: '移除', |
||||
|
style: { |
||||
|
backgroundColor: '#F56C6C' |
||||
|
} |
||||
|
}], |
||||
|
location: null, |
||||
|
topItem: '', |
||||
|
isShowScanPopup: false, |
||||
|
statusArray: [], |
||||
|
allStatusArray: [], |
||||
|
ipage: 1, |
||||
|
iSize: 20, |
||||
|
testList: [], |
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
titleClick(title) { |
||||
|
//如果要把点击事件传给页面,可以通过给extraData中添加对应的函数,然后在当前组件中触发这个函数,在页面中监听即可 |
||||
|
//注意,微信小程序中无法通过props传递事件,在微信小程序中可以使用uni.$emit、uni.$on代替 |
||||
|
// if (this.extraData.titleClickedCallback) { |
||||
|
// this.extraData.titleClickedCallback(title); |
||||
|
// } |
||||
|
}, |
||||
|
openEditCount(item) { |
||||
|
this.$emit("openEditCount") |
||||
|
}, |
||||
|
openEditCountDesc(item) { |
||||
|
this.$emit("openEditCountDesc") |
||||
|
}, |
||||
|
openEditCountDesc(item) { |
||||
|
this.$emit("bindPickerChange") |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
|
||||
|
statusColor(val) { |
||||
|
return getInventoryStatusDesc(val); |
||||
|
}, |
||||
|
statusStyle(val) { |
||||
|
return getInventoryTypeStyle(val); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.item { |
||||
|
position: relative; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
padding: 20rpx 30rpx; |
||||
|
} |
||||
|
|
||||
|
.item-content { |
||||
|
flex: 1; |
||||
|
margin-left: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.header { |
||||
|
background-color: red; |
||||
|
font-size: 24rpx; |
||||
|
text-align: center; |
||||
|
padding: 20rpx 0rpx; |
||||
|
color: white; |
||||
|
} |
||||
|
|
||||
|
.item-image { |
||||
|
height: 150rpx; |
||||
|
width: 150rpx; |
||||
|
background-color: #eeeeee; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.item-title { |
||||
|
background-color: red; |
||||
|
color: white; |
||||
|
font-size: 26rpx; |
||||
|
border-radius: 5rpx; |
||||
|
padding: 5rpx 10rpx; |
||||
|
} |
||||
|
|
||||
|
.item-detail { |
||||
|
margin-top: 10rpx; |
||||
|
border-radius: 10rpx; |
||||
|
font-size: 28rpx; |
||||
|
color: #aaaaaa; |
||||
|
word-break: break-all; |
||||
|
} |
||||
|
|
||||
|
.item-line { |
||||
|
position: absolute; |
||||
|
bottom: 0rpx; |
||||
|
left: 0rpx; |
||||
|
height: 1px; |
||||
|
width: 100%; |
||||
|
background-color: #eeeeee; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,41 @@ |
|||||
|
<!-- 当虚拟列表兼容模式渲染的时候,列表中实际上渲染的是这个组件,并且会把当前的item,index和extraData(附加数据)通过props传给这个组件 --> |
||||
|
<!-- 如果有多个不同的虚拟列表,它们会共用这个组件,这时候可以通过extraData来区分不同的页面 --> |
||||
|
<template> |
||||
|
<view> |
||||
|
<!-- 数组qwq{{index}} --> |
||||
|
<!-- 这里的extraData.id在virtual-list-compatibility-demo设置的是test1 --> |
||||
|
<virtual-list-test-cell :item="item" :index="index" :extraData="extraData" @openEditCount="openEditCount" @openEditCountDesc="<!-- #ifdef APP --> |
||||
|
|
||||
|
<!-- #endif -->openEditCountDesc"/> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: "zp-public-virtual-cell", |
||||
|
props: { |
||||
|
item: null, |
||||
|
index: 0, |
||||
|
// 这里的extraData是在页面中通过:extraData给z-paging组件传的对象 |
||||
|
extraData: null |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
openEditCount(item) { |
||||
|
this.$emit("openEditCount") |
||||
|
}, |
||||
|
openEditCountDesc(item) { |
||||
|
this.$emit("openEditCountDesc") |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,38 @@ |
|||||
|
<template> |
||||
|
<view class="ljh_box"> |
||||
|
<view class="tit_ljh">{{ itemData.itemCode }}</view> |
||||
|
<view class="ljh_left desc_ljh"> |
||||
|
<view class="font_xs text_lightblue">{{ itemData.itemName }}</view> |
||||
|
<view class="font_xs text_lightblue">{{ itemData.itemDesc1 }}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'comBaseItem', |
||||
|
components: {}, |
||||
|
props: { |
||||
|
itemData: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
filters: { |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,107 @@ |
|||||
|
<!-- 收货任务详情 --> |
||||
|
<template> |
||||
|
<view class="device-detail" style="padding-bottom: 0 !important;"> |
||||
|
<comRequestTopInfo :requestContent="dataContent"></comRequestTopInfo> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<!-- <view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.injectionIssueRequestNumber}}</text> |
||||
|
<text>申请单:{{dataContent.deliverRequestNumber}}</text> |
||||
|
</view> --> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>ERP料号 :{{dataContent.details[0].itemCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>料号描述 :{{dataContent.details[0].itemDesc1}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>位置码 :{{dataContent.details[0].positionCode}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>目标库位 :{{dataContent.details[0].toLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>叫料数量 :{{dataContent.details[0].notFinishQty}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>单位 :{{dataContent.details[0].uom}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>标包数 :{{dataContent.details[0].stdPackQty}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<!-- <image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> --> |
||||
|
<text>操作人 :{{dataContent.worker}}</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="" style="display: flex; justify-content: space-between; margin-bottom: 15rpx;"> |
||||
|
<view class=""> |
||||
|
|
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" |
||||
|
@click.stop="complete()">执行</button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
dateFormat, |
||||
|
showConfirmMsg |
||||
|
} from '@/common/basic.js'; |
||||
|
import comRequestTopInfo from '@/mycomponents/comRequest/comRequestTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
comRequestTopInfo |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
complete(){ |
||||
|
showConfirmMsg("是否确认执行?", callback => { |
||||
|
if (callback) { |
||||
|
this.$emit("handle",this.dataContent) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,41 @@ |
|||||
|
<!-- 收货任务详情 --> |
||||
|
<template> |
||||
|
<view class="device-detail" style="padding-bottom: 0 !important;"> |
||||
|
<comRequestTopInfo :requestContent="dataContent"></comRequestTopInfo> |
||||
|
<view class="" style="font-size: 32rpx;"> |
||||
|
发货单号 : {{dataContent.asnNumber}} |
||||
|
</view> |
||||
|
<view class="" style="font-size: 32rpx;"> |
||||
|
供应商代码 : {{dataContent.supplierCode}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import comRequestTopInfo from '@/mycomponents/comRequest/comRequestTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
comRequestTopInfo |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: {} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,54 @@ |
|||||
|
<!-- 收货任务详情 --> |
||||
|
<template> |
||||
|
<view class="task_num"> |
||||
|
<view class="ljh_box nopad"> |
||||
|
<view class="tit_ljh"> |
||||
|
<text class="state-style" :class="requestContent.requestStatus | requestStatusStyle"> |
||||
|
{{requestContent.requestStatus | requestStatusColor}} |
||||
|
</text> |
||||
|
<text class="text_bold" style="padding:4rpx 2rpx;">{{requestContent.number}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getRequestStatusDesc, |
||||
|
getRequestStatusStyle |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'comJobScanDetail', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
requestContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
filters: { |
||||
|
requestStatusStyle: function(val) { |
||||
|
return getRequestStatusStyle(val); |
||||
|
}, |
||||
|
requestStatusColor: function(val) { |
||||
|
return getRequestStatusDesc(val); |
||||
|
}, |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: {} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,100 @@ |
|||||
|
<!-- 收货任务详情 --> |
||||
|
<template> |
||||
|
<view class="device-detail" style="padding-bottom: 0 !important;"> |
||||
|
<comRequestTopInfo :requestContent="dataContent"></comRequestTopInfo> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<!-- <view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.injectionIssueRequestNumber}}</text> |
||||
|
<text>申请单:{{dataContent.deliverRequestNumber}}</text> |
||||
|
</view> --> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="" style="display: flex; justify-content: space-between; margin-bottom: 15rpx;"> |
||||
|
<view class=""> |
||||
|
|
||||
|
</view> |
||||
|
<view class="" style="float: right;" > |
||||
|
|
||||
|
<view class="uni-flex uni-row" v-if="dataContent.requestStatus==1||dataContent.requestStatus==5||dataContent.requestStatus==9" > |
||||
|
<!-- 新增,执行中 --> |
||||
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; margin-right: 20rpx;" |
||||
|
@click.stop="cancle()">取消</button> |
||||
|
<!-- 部分完成可以完成 --> |
||||
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; margin-right: 20rpx;" |
||||
|
@click.stop="finish()">完成</button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
dateFormat, |
||||
|
showConfirmMsg |
||||
|
} from '@/common/basic.js'; |
||||
|
import comRequestTopInfo from '@/mycomponents/comRequest/comRequestTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
comRequestTopInfo |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
finish() { |
||||
|
showConfirmMsg("是否确认完成?", callback => { |
||||
|
if (callback) { |
||||
|
this.$emit("finish", this.dataContent) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
cancle() { |
||||
|
showConfirmMsg("是否确认取消?", callback => { |
||||
|
if (callback) { |
||||
|
this.$emit("cancle", this.dataContent) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,109 @@ |
|||||
|
<!-- 收货任务详情 --> |
||||
|
<template> |
||||
|
<view class="device-detail" style="padding-bottom: 0 !important;"> |
||||
|
<com-job-top-info :jobContent="jobContent"></com-job-top-info> |
||||
|
<!-- <view class="ljh_box nopad"> |
||||
|
<text class="state-style fl margin_xs_top" :class="jobContent.jobStatus | statusStyle"> |
||||
|
{{ jobContent.jobStatus | statusColor }} |
||||
|
</text> |
||||
|
<text class="tit_ljh">{{ jobContent.number }}</text> |
||||
|
</view> --> |
||||
|
<view class="label_order"> |
||||
|
<text >OA单号:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.oaNumber}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<text >ERP储位:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.fromErpLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<text >ERP料号:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.itemCode}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >料号名称:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.itemName}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >料号描述:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.itemDesc1}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >正厂编码:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.itemDesc2}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >需求数量:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{jobContent.qty}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<text >扫描数量:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{scanCount}}</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
} from '@/common/basic.js'; |
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'comJobScanDetail', |
||||
|
components: { |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
props: { |
||||
|
jobContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
|
||||
|
allCount: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
scanCount: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
filters: { |
||||
|
statusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
calcCount(a,b){ |
||||
|
return calc.sub(a,b) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,105 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
数量 |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
|
||||
|
<view class="tab_info"> |
||||
|
<view class="conbox"> |
||||
|
<textarea v-model="content" trim="all" style="margin-left: 5px;" :focus="true" type="number"></textarea> |
||||
|
<!-- <uni-easyinput v-model="content" type="number" ></uni-easyinput> --> |
||||
|
</view> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="clear()">清空</button> |
||||
|
<button class="scan_btn" @click="confirm()">确定</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
showErrorMsg, |
||||
|
} from '@/common/basic.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
content: '', |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openPopup(content) { |
||||
|
this.content = content; |
||||
|
this.$refs['popup'].open("bottom"); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
this.$refs['popup'].close(); |
||||
|
}, |
||||
|
|
||||
|
confirm() { |
||||
|
if(!/^[0-9]+.?[0-9]*$/.test(this.content)){ |
||||
|
uni.showToast({ |
||||
|
title:"请输入数字" |
||||
|
}) |
||||
|
this.content="" |
||||
|
return |
||||
|
} |
||||
|
this.$emit("confirm", this.content); |
||||
|
this.$refs['popup'].close(); |
||||
|
}, |
||||
|
|
||||
|
clear() { |
||||
|
this.content = ''; |
||||
|
}, |
||||
|
|
||||
|
maskClick() { |
||||
|
this.$emit("confirm", true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- background-color: #fff; --> |
||||
|
<style scoped lang="scss"> |
||||
|
.center { |
||||
|
flex: auto; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
// align-items: center; |
||||
|
} |
||||
|
|
||||
|
.flex-item { |
||||
|
width: 50%; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.messageButton { |
||||
|
border-color: #F8F8F8; |
||||
|
} |
||||
|
|
||||
|
.messagePopup { |
||||
|
background-color: #fff; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .uni-input-input { |
||||
|
font-size: 20px; |
||||
|
height: 46px; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,62 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<uni-popup ref="popupItems" > |
||||
|
<scroll-view scroll-y="true" class="scroll" style=""> |
||||
|
<view class="uni-flex uni-column"> |
||||
|
<view class=" uni-center" style="margin: 15rpx;"> |
||||
|
采购订单: {{poNumber}} |
||||
|
</view> |
||||
|
<view class="" style=" margin: 10rpx;background-color:#EBEEF0;width: 100%;" |
||||
|
v-for="(item, index) in showList" :key="index"> |
||||
|
<view class="text-wrap"> |
||||
|
({{index+1}})箱码 : {{item}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
</uni-popup> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
components: {}, |
||||
|
data() { |
||||
|
return { |
||||
|
showList: [], |
||||
|
poNumber: '' |
||||
|
}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: {}, |
||||
|
filters: {}, |
||||
|
methods: { |
||||
|
openPopup(data, poNumber) { |
||||
|
this.showList = data; |
||||
|
this.poNumber = poNumber |
||||
|
this.$refs.popupItems.open('center'); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.text-wrap { |
||||
|
word-wrap: break-word; |
||||
|
word-break: break-all; |
||||
|
white-space: pre-line; |
||||
|
} |
||||
|
|
||||
|
.scroll { |
||||
|
border-radius: 20rpx; |
||||
|
background-color: #fff; |
||||
|
height: 80vh; |
||||
|
width:80vw; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</style> |
@ -0,0 +1,126 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<view class="detail-content"> |
||||
|
<view class="choose_main"> |
||||
|
<view class="ljh_box"> |
||||
|
<view class="tit_ljh">{{ dataContent.itemCode }}</view> |
||||
|
<view class="ljh_left desc_ljh"> |
||||
|
<view class="font_xs text_lightblue">{{ dataContent.itemName }}</view> |
||||
|
<view class="font_xs text_lightblue">{{ dataContent.itemDesc1 }}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
扫描{{dataContent.scaned}} |
||||
|
|
||||
|
<view class="list_form"> |
||||
|
<view class="uni-container"> |
||||
|
<uni-table style="overflow-x: hidden;"> |
||||
|
<uni-tr> |
||||
|
<!-- <uni-th width="90"></uni-th> |
||||
|
<uni-th width="100" align="center">推荐</uni-th> |
||||
|
<uni-th width="100" align="center">实际</uni-th> --> |
||||
|
<uni-th width="50"></uni-th> |
||||
|
<uni-th width="120" align="center">推荐</uni-th> |
||||
|
<uni-th width="120" align="center">实际</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">器具码</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_packingCode"> |
||||
|
{{ dataContent.recommendContainerCode }} |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="dataContent.scaned" class="text_packingCode"> |
||||
|
{{ dataContent.containerCode }} |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">数量</text></uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<text class="text_black">{{dataContent.recommendQty}}({{dataContent.uom}})</text> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="dataContent.scaned" |
||||
|
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
||||
|
|
||||
|
<com-number-box ref="comNumberBox" v-model="dataContent.handledQty" |
||||
|
:max="99999" :min="0" style='width: 100px;' |
||||
|
@change="qtyChanged($event,dataContent)"> |
||||
|
</com-number-box> |
||||
|
<text class="text_black">({{dataContent.uom}})</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
</uni-table> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="choose_marked" v-if="dataContent.scaned"> |
||||
|
<image src="@/static/image_marked.svg"></image> |
||||
|
</view> |
||||
|
<view class="fr" v-if="isShowPacking"> |
||||
|
<button class="btn_single" hover-class="btn_single_after" @click="unPacking(dataContent)">拆箱</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
<comUnPacking ref='comUnPacking' |
||||
|
@getvalue="getUnPackingCount" title="拆箱" @update="update"> |
||||
|
</comUnPacking> |
||||
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
||||
|
@afterCloseScanMessage='closeScanMessage'></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
||||
|
import comUnPacking from '@/mycomponents/coms/comUnPacking.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: "", |
||||
|
components: { |
||||
|
comNumberBox, |
||||
|
comUnPacking, |
||||
|
comMessage |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: {} |
||||
|
}, |
||||
|
isShowPacking: { |
||||
|
type: Boolean, |
||||
|
value: false |
||||
|
}, |
||||
|
}, |
||||
|
methods: { |
||||
|
update(newCode){ |
||||
|
this.showMessage("生成新的箱码【"+newCode+"】请到PC端打印标签"); |
||||
|
}, |
||||
|
unPacking(item) { |
||||
|
this.$refs.comUnPacking.openPopup3(item,item.handledQty,item.recommendQty,false); |
||||
|
}, |
||||
|
qtyChanged(value, item) { |
||||
|
if (value <= 0) { |
||||
|
this.showMessage('数量不能小于或等于0') |
||||
|
item.handledQty = item.defaultHandleQty |
||||
|
this.$refs.comNumberBox.setValue(item.handledQty); |
||||
|
} else if (value > item.defaultHandleQty) { |
||||
|
item.handledQty = item.defaultHandleQty |
||||
|
this.showMessage('数量不能大于库存数量:' + item.handledQty) |
||||
|
this.$refs.comNumberBox.setValue(item.handledQty); |
||||
|
} |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,418 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popupqtyedit" type="center"> |
||||
|
<view class="uni-popup-view" style="display: flex;flex-direction: column; width: 500rpx;"> |
||||
|
<view |
||||
|
style="display: flex; justify-content: center; align-items: center; padding: 10rpx;flex-direction: column;"> |
||||
|
<view style="padding: 10rpx; font-weight: bold; font-size: 35rpx;">{{title}}</view> |
||||
|
<view class="" style="width: 100%; background-color: black;height: 2rpx;"> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="padding: 6rpx;margin-left: 15rpx;font-size: 32rpx;">箱码 : {{dataContent.recommendPackingCode}}</view> |
||||
|
<view style="padding: 6rpx;margin-left: 15rpx;font-size: 32rpx;">ERP料号 : {{dataContent.itemCode}}</view> |
||||
|
<view style="padding: 6rpx;margin-left: 15rpx;font-size: 32rpx;">名称 : {{dataContent.itemName}}</view> |
||||
|
<view style="padding: 6rpx;margin-left: 15rpx;font-size: 32rpx;">描述 : {{dataContent.itemDesc1}}</view> |
||||
|
<view style="display: flex; justify-content: center;align-items: center; padding: 6rpx;margin-top: 10rpx;"> |
||||
|
<com-number-box v-model="value" :max="99999999" :min="0" style='margin: 0px 5px' /> |
||||
|
<view class=""> |
||||
|
({{dataContent.uom}}) |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-popup-button-box"> |
||||
|
<button @click="cancle" class="save-button" style="width: 220rpx;margin-top: 10rpx;margin-right: 10rpx; " type="default">取消</button> |
||||
|
<button @click="submit" class="save-button" style="width: 220rpx;margin-top: 10rpx;margin-left: 10rpx; " type="primary">确定</button> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<comMessage ref="refMessage" ></comMessage> |
||||
|
</uni-popup> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
showErrorMsg, |
||||
|
getCurrDateTime |
||||
|
} from '@/common/basic.js'; |
||||
|
import { |
||||
|
generateNewPacking, |
||||
|
unPacking, |
||||
|
getInventoryLabel, |
||||
|
unPackingByPurchase, |
||||
|
unPackingByIssue |
||||
|
} from '@/api/index.js'; |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
comMessage, |
||||
|
comNumberBox |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
value: 0, |
||||
|
defaultValue: 0, |
||||
|
vaildMaxValue: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
//允许小于等于0 |
||||
|
allowZero: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
dataContent: {}, |
||||
|
jobContent:{}, |
||||
|
jobType:"" |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openPopup(qty) { |
||||
|
this.value = qty; |
||||
|
this.defaultValue = qty; |
||||
|
this.$refs['popupqtyedit'].open("center"); |
||||
|
}, |
||||
|
//vaild,提交是是否校验数量 |
||||
|
openPopup1(qty, vaild) { |
||||
|
this.value = qty; |
||||
|
this.defaultValue = qty; |
||||
|
this.vaildMaxValue = vaild; |
||||
|
this.$refs['popupqtyedit'].open("center"); |
||||
|
}, |
||||
|
//vaildqty校验的数量,提交时与输入的值做比较 |
||||
|
openPopup2(qty, vaildqty) { |
||||
|
this.value = qty; |
||||
|
this.defaultValue = vaildqty; |
||||
|
this.vaildMaxValue = true; |
||||
|
this.$refs['popupqtyedit'].open("center"); |
||||
|
}, |
||||
|
//qty当前数量,vaildqty校验的最大数量 , isZero数量是否允许为0 |
||||
|
openPopup3(jobContent,item, qty, vaildqty, isZero) { |
||||
|
this.jobContent =jobContent |
||||
|
this.dataContent = item |
||||
|
this.jobType =jobContent.jobType |
||||
|
this.value = qty; |
||||
|
this.defaultValue = vaildqty; |
||||
|
this.vaildMaxValue = true; |
||||
|
this.allowZero = isZero; |
||||
|
this.$refs['popupqtyedit'].open("center"); |
||||
|
}, |
||||
|
//qty当前数量,不验证最大值,不允许为0 |
||||
|
openPopup4(qty, vaildMaxValue, isZero) { |
||||
|
this.value = qty; |
||||
|
this.defaultValue = qty; |
||||
|
this.vaildMaxValue = vaildMaxValue; |
||||
|
this.allowZero = isZero; |
||||
|
this.$refs['popupqtyedit'].open("center"); |
||||
|
}, |
||||
|
cancle(){ |
||||
|
this.$refs['popupqtyedit'].close(); |
||||
|
}, |
||||
|
//确定 |
||||
|
submit() { |
||||
|
let that = this; |
||||
|
if (that.value === "") { |
||||
|
this.showMessage('数量不能为空'); |
||||
|
that.value = that.defaultValue; |
||||
|
} else { |
||||
|
let qty = Number(that.value); |
||||
|
if (that.vaildMaxValue) { |
||||
|
if (qty >= that.defaultValue) { |
||||
|
that.value = that.defaultValue; |
||||
|
this.showMessage('数量不能大于等于' + that.defaultValue); |
||||
|
|
||||
|
} else { |
||||
|
if (!that.allowZero) //不允许0 |
||||
|
{ |
||||
|
if (qty == 0) { |
||||
|
this.showMessage('数量不能为0'); |
||||
|
that.value = that.value; |
||||
|
} else if (qty < 0) { |
||||
|
this.showMessage('数量不能小于0'); |
||||
|
that.value = that.value; |
||||
|
} else { |
||||
|
this.getDataInfo(qty) |
||||
|
} |
||||
|
} else { |
||||
|
this.getDataInfo(qty) |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
if (!that.allowZero) //不允许0 |
||||
|
{ |
||||
|
if (qty == 0) { |
||||
|
this.showMessage('数量不能为0'); |
||||
|
that.value = that.defaultValue; |
||||
|
} else if (qty < 0) { |
||||
|
this.showMessage('数量不能小于0'); |
||||
|
that.value = that.defaultValue; |
||||
|
} else { |
||||
|
this.getDataInfo(qty) |
||||
|
} |
||||
|
} else { |
||||
|
this.getDataInfo(qty) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
callBack(qty){ |
||||
|
var data =this.dataContent; |
||||
|
var params = { |
||||
|
fullBarcodeString:data.handledPackingCode , |
||||
|
itemCode: data.itemCode, |
||||
|
itemName: data.itemName, |
||||
|
itemDesc1:data.itemDesc1 , |
||||
|
itemDesc2: data.itemDesc2, |
||||
|
lot: data.handledLot, |
||||
|
supplierBatch: data.handledSupplierBatch, |
||||
|
arriveDate: data.handledArriveDate, |
||||
|
produceDate: data.handledProduceDate, |
||||
|
expireDate:data.handledExpireDate , |
||||
|
stdPackQty: data.stdPackQty, |
||||
|
uom: data.uom, |
||||
|
qty: data.handledQty, |
||||
|
labelStatus: 1, |
||||
|
recommendLocationCode:data.handledToLocationCode, |
||||
|
locationErpCode: data.handledToLocationErpCode, |
||||
|
containerCode:data.handledContainerCode , |
||||
|
supplierCode:this.jobContent.supplierCode , |
||||
|
poNumber:data.poNumber, |
||||
|
rpNumber:this.jobContent.rpNumber , |
||||
|
asnNumber: this.jobContent.asnNumber, |
||||
|
qLevel: "", |
||||
|
qualityFile:"" , |
||||
|
prodLine: "", |
||||
|
team: "", |
||||
|
shift: "", |
||||
|
specifications:"" , |
||||
|
supplierName: this.jobContent.supplierName, |
||||
|
supplierSimpleName: "", |
||||
|
supplierItemCode:"", |
||||
|
supplierItemName: "", |
||||
|
labelType: 1, |
||||
|
planArriveDate: this.jobContent.planArriveDate, |
||||
|
remark: data.remark |
||||
|
} |
||||
|
|
||||
|
|
||||
|
generateNewPacking(qty,params).then(res=>{ |
||||
|
if(res){ |
||||
|
var unPackingParams =this.setUnPackingParams(qty) |
||||
|
unPacking(unPackingParams).then(res=>{ |
||||
|
this.$emit("getvalue", qty); |
||||
|
this.$refs['popupqtyedit'].close(); |
||||
|
}).catch(error=>{ |
||||
|
this.showMessage(error.message) |
||||
|
}) |
||||
|
}else { |
||||
|
this.showMessage("生成新箱码失败") |
||||
|
} |
||||
|
}).catch(error=>{ |
||||
|
this.showMessage(error.message) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
async getDataInfo(qty){ |
||||
|
try{ |
||||
|
uni.showLoading({ |
||||
|
title:"正在加载中...", |
||||
|
mask:true |
||||
|
}) |
||||
|
var labelData = await getInventoryLabel(this.dataContent.recommendPackingCode) |
||||
|
if(!labelData){ |
||||
|
uni.hideLoading() |
||||
|
this.showMessage("箱码["+this.dataContent.recommendPackingCode+"]在标签表中不存在") |
||||
|
return; |
||||
|
} |
||||
|
var newPackingCodeParam = this.setNewPackingCodeParam(labelData,qty) |
||||
|
|
||||
|
var newPackingCodeData = await generateNewPacking(1,newPackingCodeParam); |
||||
|
var unPackingParams; |
||||
|
if(this.jobType==6){ |
||||
|
var unPackingParamsIssue= this.setUnPackingParamsByIssue(labelData,qty,newPackingCodeData[0].code) |
||||
|
var unPackingData = await unPackingByIssue(unPackingParamsIssue,this.dataContent.number,this.dataContent.recommendPackingCode,this.dataContent.recommendQty,newPackingCodeData[0].code,qty) |
||||
|
}else{ |
||||
|
var unPackingParamsPur= this.setUnPackingParamsByReceipt(labelData,qty,newPackingCodeData[0].code) |
||||
|
var unPackingData = await unPackingByPurchase(unPackingParamsPur,this.dataContent.number,this.dataContent.recommendPackingCode,this.dataContent.recommendQty,newPackingCodeData[0].code,qty) |
||||
|
} |
||||
|
uni.hideLoading() |
||||
|
// this.showMessage("生成新的箱码【"+newPackingCodeData[0].code+"】请到PC端打印标签") |
||||
|
this.$emit("update",newPackingCodeData[0].code) |
||||
|
this.cancle(); |
||||
|
}catch(error){ |
||||
|
uni.hideLoading() |
||||
|
this.showMessage(error) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
setNewPackingCodeParam(labelData,qty){ |
||||
|
var params =labelData; |
||||
|
params.qty = qty; |
||||
|
return params; |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.refMessage.showMessage(message); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
setUnPackingParamsByReceipt(labelData,qty,newPackingCode){ |
||||
|
var data = labelData; |
||||
|
var itemData =this.dataContent; |
||||
|
var param = { |
||||
|
tenantId: data.tenantId, |
||||
|
remark: "", |
||||
|
extraProperties: {}, |
||||
|
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
||||
|
activeDate: data.arriveDate, |
||||
|
confirmed: true, |
||||
|
confirmTime: getCurrDateTime(), |
||||
|
requestNumber:"", |
||||
|
jobNumber: "", |
||||
|
type: "SplitPacking", |
||||
|
useOnTheWayLocation: false, |
||||
|
details: [ |
||||
|
{ |
||||
|
remark: itemData.remark, |
||||
|
itemCode: itemData.itemCode, |
||||
|
itemName:itemData.itemName, |
||||
|
itemDesc1: itemData.itemDesc1, |
||||
|
itemDesc2:itemData.itemDesc2, |
||||
|
uom: itemData.uom, |
||||
|
qty: qty, |
||||
|
stdPackQty: itemData.stdPackQty, |
||||
|
fromPackingCode: itemData.recommendPackingCode, |
||||
|
fromContainerCode: itemData.recommendContainerCode, |
||||
|
fromLocationCode: itemData.recommendToLocationCode, |
||||
|
fromLocationArea: itemData.recommendToLocationArea, |
||||
|
fromLocationGroup: itemData.recommendToLocationGroup, |
||||
|
fromLocationErpCode: itemData.recommendToLocationErpCode, |
||||
|
fromWarehouseCode: itemData.recommendToWarehouseCode, |
||||
|
fromLot: itemData.recommendLot, |
||||
|
fromStatus: 1, |
||||
|
|
||||
|
toPackingCode: newPackingCode, |
||||
|
toContainerCode: itemData.recommendContainerCode, |
||||
|
toLocationCode: itemData.recommendToLocationCode, |
||||
|
toLocationArea: itemData.recommendToLocationArea, |
||||
|
toLocationGroup: itemData.recommendToLocationGroup, |
||||
|
toLocationErpCode: itemData.recommendToLocationErpCode, |
||||
|
toWarehouseCode: itemData.recommendToWarehouseCode, |
||||
|
toLot: itemData.recommendLot, |
||||
|
|
||||
|
toStatus: 1, |
||||
|
supplierBatch: data.supplierBatch, |
||||
|
arriveDate: data.arriveDate, |
||||
|
produceDate: data.produceDate, |
||||
|
expireDate: data.expireDate, |
||||
|
|
||||
|
onTheWayLocationCode: "", |
||||
|
reason: "" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
|
||||
|
return param; |
||||
|
}, |
||||
|
setUnPackingParamsByIssue(labelData,qty,newPackingCode){ |
||||
|
var data = labelData; |
||||
|
var itemData =this.dataContent; |
||||
|
var param = { |
||||
|
tenantId: data.tenantId, |
||||
|
remark: "", |
||||
|
extraProperties: {}, |
||||
|
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
||||
|
activeDate: data.arriveDate, |
||||
|
confirmed: true, |
||||
|
confirmTime: data.arriveDate, |
||||
|
requestNumber:"", |
||||
|
jobNumber: "", |
||||
|
type: "SplitPacking", |
||||
|
useOnTheWayLocation: false, |
||||
|
details: [ |
||||
|
{ |
||||
|
remark: itemData.remark, |
||||
|
itemCode: itemData.itemCode, |
||||
|
itemName:itemData.itemName, |
||||
|
itemDesc1: itemData.itemDesc1, |
||||
|
itemDesc2:itemData.itemDesc2, |
||||
|
uom: itemData.uom, |
||||
|
qty: qty, |
||||
|
stdPackQty: itemData.stdPackQty, |
||||
|
fromPackingCode: itemData.recommendPackingCode, |
||||
|
fromContainerCode: itemData.recommendContainerCode, |
||||
|
fromLocationCode: itemData.recommendFromLocationCode, |
||||
|
fromLocationArea: itemData.recommendFromLocationArea, |
||||
|
fromLocationGroup: itemData.recommendFromLocationGroup, |
||||
|
fromLocationErpCode: itemData.recommendFromLocationErpCode, |
||||
|
fromWarehouseCode: itemData.recommendFromWarehouseCode, |
||||
|
fromLot: itemData.recommendLot, |
||||
|
fromStatus: 2, |
||||
|
|
||||
|
toPackingCode: newPackingCode, |
||||
|
toContainerCode: itemData.recommendContainerCode, |
||||
|
toLocationCode: itemData.recommendFromLocationCode, |
||||
|
toLocationArea: itemData.recommendFromLocationArea, |
||||
|
toLocationGroup: itemData.recommendFromLocationGroup, |
||||
|
toLocationErpCode: itemData.recommendFromLocationErpCode, |
||||
|
toWarehouseCode: itemData.recommendFromWarehouseCode, |
||||
|
toLot: itemData.recommendLot, |
||||
|
|
||||
|
toStatus: 2, |
||||
|
supplierBatch: itemData.recommendSupplierBatch, |
||||
|
arriveDate: itemData.recommendArriveDate, |
||||
|
produceDate: itemData.recommendProduceDate, |
||||
|
expireDate: itemData.recommendExpireDate, |
||||
|
onTheWayLocationCode: "", |
||||
|
reason: "" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
|
||||
|
return param; |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- background-color: #fff; --> |
||||
|
<style scoped lang="scss"> |
||||
|
.center { |
||||
|
flex: auto; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
// align-items: center; |
||||
|
} |
||||
|
|
||||
|
.flex-item { |
||||
|
width: 50%; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.messageButton { |
||||
|
border-color: #F8F8F8; |
||||
|
} |
||||
|
|
||||
|
.messagePopup { |
||||
|
background-color: #fff; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .uni-input-input { |
||||
|
font-size: 20px; |
||||
|
height: 46px; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,276 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
ERP料号代码 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.itemCode" placeholder="请输入ERP料号代码" /> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
ERP料号名称 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.itemName" placeholder="请输入ERP料号名称" /> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
ERP料号描述1 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.itemDesc1" placeholder="请输入ERP料号描述1" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
ERP料号描述2 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.itemDesc2" placeholder="请输入ERP料号描述2" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
库位代码 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.locationCode" placeholder="请输入库位代码" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
ERP库位代码 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.locationErpCode" placeholder="请输入ERP库位代码" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
批次 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.lot" placeholder="请输入批次" /> |
||||
|
</view> --> |
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
<text style="color: red; font-weight: bold;">*</text> |
||||
|
数量 : |
||||
|
</view> |
||||
|
<uni-easyinput type="number" v-model="dataContent.qty" placeholder="请输入数量" /> |
||||
|
</view> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
单位 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.uom" placeholder="请输入单位" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
标包 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.stdPackQty" placeholder="请输入标包" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
库存状态 : |
||||
|
</view> |
||||
|
<u-select v-model="showStatus" :list="statusList" ></u-select> |
||||
|
<uni-combox :candidates="statusList" placeholder="请选择库存状态" v-model="dataContent.statusName"></uni-combox> |
||||
|
<!-- <uni-easyinput type="text" v-model="dataContent.inventoryStatuses" placeholder="请输入库存状态" /> --> |
||||
|
<!-- </view> --> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
要货计划单号 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.rpNumber" placeholder="请输入要货计划单号" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商发货单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.purchaseInfo_AsnNumber" placeholder="请输入供应商发货单" /> |
||||
|
</view> --> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
到货通知单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.arrivalNoticNumber" placeholder="请输入到货通知单" /> |
||||
|
</view> --> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
收货记录单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.receiptRecNumber" placeholder="请输入收货记录单" /> |
||||
|
</view> --> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
采购订单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.purchaseInfo_PoNumber" placeholder="请输入采购订单" /> |
||||
|
</view> --> |
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
上架单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.putOnShelfNumber" placeholder="请输入上架单" /> |
||||
|
</view> --> |
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
任务单 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.taskOrderNumber" placeholder="请输入任务单" /> |
||||
|
</view> --> |
||||
|
|
||||
|
|
||||
|
<!-- <view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商代码 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.supplierCode" placeholder="请输入供应商代码" /> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商名称 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.supplierName" placeholder="请输入供应商名称" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商简称 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.supplierSimpleName" placeholder="请输入供应商简称" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商物品代码 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.supplierItemCode" placeholder="请输入供应商物品代码" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
供应商物品名称 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.supplierItemName" placeholder="请输入供应商物品名称" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
备注 : |
||||
|
</view> |
||||
|
<uni-easyinput type="text" v-model="dataContent.remark" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
生产日期 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.produceDate" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
要求到货日期 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" return-type="timestamp" v-model="dataContent.planArriveDate" |
||||
|
placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
到货日期 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.arriveDate" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
过期时间 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.expireDate" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
生效日期 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.activeDate" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
创建时间 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.creationTime" placeholder="请输入备注" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row item" style="align-items: center; "> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
上次修改时间 : |
||||
|
</view> |
||||
|
<uni-datetime-picker type="datetime" v-model="dataContent.lastModificationTime" placeholder="请输入备注" /> |
||||
|
</view> --> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getCurrDateTime, |
||||
|
getInventoryStatusList, |
||||
|
getInventoryStatusDesc |
||||
|
} from '@/common/basic.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
showStatus:false, |
||||
|
statusList:[], |
||||
|
}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
}, |
||||
|
}, |
||||
|
filters: {}, |
||||
|
mounted() { |
||||
|
this.dataContent.statusName =this.inventoryStatusDesc(this.dataContent.inventoryStatuses) |
||||
|
this.statusList=getInventoryStatusList() |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
getDate(value) { |
||||
|
return getCurrDateTime(value) |
||||
|
}, |
||||
|
clickShowStatus(){ |
||||
|
this.showStatus=true |
||||
|
}, |
||||
|
inventoryStatusDesc(value){ |
||||
|
return getInventoryStatusDesc(value) |
||||
|
}, |
||||
|
selectStatus(item){ |
||||
|
// this.statusName=item[0].label |
||||
|
this.dataContent.inventoryStatuses=item[0].value |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.item { |
||||
|
margin: 5rpx; |
||||
|
padding: 5rpx; |
||||
|
font-size: 35rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,80 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail"> |
||||
|
<view class="card_task nopad"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<!-- <view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.injectionIssueRequestNumber}}</text> |
||||
|
<text>申请单:{{dataContent.deliverRequestNumber}}</text> |
||||
|
</view> --> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>ERP料号 :{{dataContent.details[0].itemCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>料号描述 :{{dataContent.details[0].itemDesc1}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>收容数 :{{dataContent.details[0].requestQty}} ({{dataContent.details[0].uom}})</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>目标库位 :{{dataContent.details[0].recommendToLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<!-- <image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> --> |
||||
|
<text>操作人 :{{dataContent.worker}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
export default { |
||||
|
name: "comDeliver", |
||||
|
components: { |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
statusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,84 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail issuelist"> |
||||
|
<!-- <view class="card_task issuecard nopad uni-flex space-between"> --> |
||||
|
<view class="card_task nopad space-between"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
<image v-if="dataContent.useOnTheWayLocation" class="tag_icon" src="@/static/icons_ui/icon_kw_use.svg"> |
||||
|
</image> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom" style="clear: both;"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.materialRequestNumber}}</text> |
||||
|
<!-- <text>申请单:{{dataContent.materialRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image> |
||||
|
<text>{{dataContent.prodLine}}</text> |
||||
|
<!-- <text>生产线:{{dataContent.prodLine}}</text> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
getInventoryTypeStyle, |
||||
|
getInventoryStatusDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comItemTop from '@/mycomponents/comItem/comItemTop.vue' |
||||
|
import comItemBottom from '@/mycomponents/comItem/comItemBottom.vue' |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: "comissue", |
||||
|
components: { |
||||
|
comItemTop, |
||||
|
comItemBottom, |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
computed: {}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
jobStatusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
jobStatusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
statusStyle: function(val) { |
||||
|
return getInventoryTypeStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getInventoryStatusDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,80 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail"> |
||||
|
<view class="card_task nopad"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<!-- <view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.injectionIssueRequestNumber}}</text> |
||||
|
<text>申请单:{{dataContent.deliverRequestNumber}}</text> |
||||
|
</view> --> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>ERP料号 :{{dataContent.details[0].itemCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>料号描述 :{{dataContent.details[0].itemDesc1}}</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>收容数 :{{dataContent.details[0].requestQty}} ({{dataContent.details[0].uom}})</text> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.details.length>0"> |
||||
|
<text>目标库位 :{{dataContent.details[0].recommendToLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<!-- <image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> --> |
||||
|
<text>操作人 :{{dataContent.worker}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
export default { |
||||
|
name: "comDeliver", |
||||
|
components: { |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
statusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,68 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail"> |
||||
|
<view class="card_task nopad"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.requestNumber}}</text> |
||||
|
<!-- <text>申请单:{{dataContent.deliverRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> |
||||
|
<!-- <text>客户:{{dataContent.customerCode}}</text> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
export default { |
||||
|
name: "comDeliver", |
||||
|
components: { |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
statusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,97 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail issuelist"> |
||||
|
<!-- <view class="card_task issuecard nopad uni-flex space-between"> --> |
||||
|
<view class="card_task nopad space-between"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
<image v-if="dataContent.useOnTheWayLocation" class="tag_icon" src="@/static/icons_ui/icon_kw_use.svg"> |
||||
|
</image> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom" style="clear: both;"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.requestNumber}}</text> |
||||
|
<!-- <text>申请单:{{dataContent.materialRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> |
||||
|
<!-- <text>客户:{{dataContent.customerCode}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order" v-if="dataContent.enumIssueSendType==1"> |
||||
|
<text>类型 : 按数量发料</text> |
||||
|
<!-- <text>申请单:{{dataContent.materialRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order" v-else> |
||||
|
<text>类型 : 按箱发料</text> |
||||
|
<!-- <text>申请单:{{dataContent.materialRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
|
||||
|
<!-- <view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image> |
||||
|
<text>{{dataContent.prodLine}}</text> |
||||
|
</view> --> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
getInventoryTypeStyle, |
||||
|
getInventoryStatusDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comItemTop from '@/mycomponents/comItem/comItemTop.vue' |
||||
|
import comItemBottom from '@/mycomponents/comItem/comItemBottom.vue' |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: "comissue", |
||||
|
components: { |
||||
|
comItemTop, |
||||
|
comItemBottom, |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
computed: {}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
jobStatusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
jobStatusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
statusStyle: function(val) { |
||||
|
return getInventoryTypeStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getInventoryStatusDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,97 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<view class="detail-list margin_top" > |
||||
|
<!-- 单选卡片 --> |
||||
|
<view class="detail-content"> |
||||
|
<view class="choose_main"> |
||||
|
<view class="ljh_box"> |
||||
|
<view class="tit_ljh">{{ dataContent.itemCode }}</view> |
||||
|
<view class="ljh_left"> |
||||
|
<view class="font_xs text_lightblue">{{ dataContent.itemName }}</view> |
||||
|
<view class="font_xs text_lightblue">{{ dataContent.itemDesc1 }}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="list_form hold_form"> |
||||
|
<view class="uni-container"> |
||||
|
<uni-table style="overflow-x: hidden;"> |
||||
|
<uni-tr> |
||||
|
<uni-th width="70"></uni-th> |
||||
|
<uni-th width="120" align="center">推荐</uni-th> |
||||
|
<uni-th width="120" align="center">实际</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="70">数量</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_black">{{dataContent.recommendQty}}({{dataContent.uom}})</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
<!-- --> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="" v-if="dataContent.scaned"> |
||||
|
<com-number-box :ref="'comNumberBox_'+index" v-model="dataContent.handledQty" |
||||
|
:max="99999" :min="0" @change="qtyChanged($event,dataContent,index)"> |
||||
|
</com-number-box> |
||||
|
</view> |
||||
|
<!-- <view v-if="dataContent.scaned" class="text_black"> |
||||
|
{{dataContent.handledQty}}({{dataContent.uom}}) |
||||
|
</view> --> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="70">来源库位</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_black">{{ dataContent.recommendFromLocationCode }}</view> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class=""> |
||||
|
<button v-if="dataContent.scaned" type="primary" size="mini" |
||||
|
style="margin-left: 30rpx;" @click="remove(dataContent,index)">移除</button> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
</uni-table> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
{{dataContent.scaned}} |
||||
|
<view class="choose_marked" v-if="dataContent.scaned"> |
||||
|
<image src="@/static/image_marked.svg"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: {} |
||||
|
} |
||||
|
}, |
||||
|
watch:{ |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
this.dataContent=newName; |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
remove() { |
||||
|
this.$emit("remove", dataContent) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,102 @@ |
|||||
|
<!--发料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail"> |
||||
|
<view class="card_task nopad"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> |
||||
|
<text>{{dataContent.requestNumber}}</text> |
||||
|
<!-- <text>申请单:{{dataContent.deliverRequestNumber}}</text> --> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image> |
||||
|
<text>{{dataContent.worker}}</text> |
||||
|
<!-- <text>客户:{{dataContent.customerCode}}</text> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="" style="display: flex; justify-content: space-between; margin-bottom: 15rpx;"> |
||||
|
<view class=""> |
||||
|
|
||||
|
</view> |
||||
|
<view class="" style="float: right;" v-if="dataContent.jobStatus==1||dataContent.jobStatus==2||dataContent.jobStatus==4"> |
||||
|
<view class="uni-flex uni-row"> |
||||
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; margin-right: 20rpx;" |
||||
|
@click.stop="finish()">完成</button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
dateFormat, |
||||
|
showConfirmMsg |
||||
|
} from '@/common/basic.js'; |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
export default { |
||||
|
name: "comDeliver", |
||||
|
components: { |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
statusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
finish() { |
||||
|
showConfirmMsg("是否确认完成?", callback => { |
||||
|
if (callback) { |
||||
|
this.$emit("finish", this.dataContent) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getScanCount(data){ |
||||
|
var count = 0; |
||||
|
this.dataContent.details.forEach(res => { |
||||
|
count = count + res.handledQty |
||||
|
}) |
||||
|
if (count == 0) { |
||||
|
return false |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,121 @@ |
|||||
|
<!--非生产领料任务卡片--> |
||||
|
<template> |
||||
|
<view class="device-detail issuelist"> |
||||
|
<!-- <view class="card_task issuecard nopad uni-flex space-between"> --> |
||||
|
<view class="card_task nopad space-between"> |
||||
|
<com-job-top-info :jobContent="dataContent"></com-job-top-info> |
||||
|
<image v-if="dataContent.useOnTheWayLocation" class="tag_icon" src="@/static/icons_ui/icon_kw_use.svg"> |
||||
|
</image> |
||||
|
</view> |
||||
|
<view class="margin_xs_bottom" style="clear: both;"> |
||||
|
<view class="label_order"> |
||||
|
<!-- <image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> --> |
||||
|
<text>OA单号:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.oaNumber}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<!-- <image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> --> |
||||
|
<text>单号:</text> |
||||
|
<text style="font-weight: bold; color:black" v-if="fromType=='pick'">{{dataContent.unplannedIssueRequestNumber}}</text> |
||||
|
<!-- <text>申请单:{{dataContent.materialRequestNumber}}</text> --> |
||||
|
<text style="font-weight: bold; color:black" v-else>{{dataContent.unplannedReceiptRequestNumber}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="" > |
||||
|
<view class="label_order"> |
||||
|
<text >ERP储位:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.fromErpLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class="label_order"> |
||||
|
<text >ERP料号:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.itemCode}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >料号名称:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.itemName}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >料号描述:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.itemDesc1}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="label_order"> |
||||
|
<text >正厂编码:</text> |
||||
|
<text style="font-weight: bold; color:black" >{{dataContent.itemDesc2}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
<view class="uni-flex uni-row receipt_bot"> |
||||
|
<view class="label_order"> |
||||
|
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg"> |
||||
|
</image> |
||||
|
<text |
||||
|
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
{{dataContent.worker}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getJobStatuStyle, |
||||
|
getJobStatuDesc, |
||||
|
getInventoryTypeStyle, |
||||
|
getInventoryStatusDesc, |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
import comItemTop from '@/mycomponents/comItem/comItemTop.vue' |
||||
|
import comItemBottom from '@/mycomponents/comItem/comItemBottom.vue' |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: "comissue", |
||||
|
components: { |
||||
|
comItemTop, |
||||
|
comItemBottom, |
||||
|
comJobTopInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
computed: {}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
value: null |
||||
|
}, |
||||
|
fromType:{ |
||||
|
type: String, |
||||
|
value: "pick" |
||||
|
} |
||||
|
}, |
||||
|
filters: { |
||||
|
jobStatusStyle: function(val) { |
||||
|
return getJobStatuStyle(val); |
||||
|
}, |
||||
|
jobStatusColor: function(val) { |
||||
|
return getJobStatuDesc(val); |
||||
|
}, |
||||
|
statusStyle: function(val) { |
||||
|
return getInventoryTypeStyle(val); |
||||
|
}, |
||||
|
statusColor: function(val) { |
||||
|
return getInventoryStatusDesc(val); |
||||
|
}, |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,128 @@ |
|||||
|
<template> |
||||
|
<view class="container"> |
||||
|
<u-popup ref="popup" v-model="showPopup" border-radius="15" style="width: 100%;" mode="center"> |
||||
|
<view class="" style="align-items: center;background-color: #fff; border-radius: 15rpx; margin: 20rpx;"> |
||||
|
<view class="uni-center popup-content" |
||||
|
style="font-weight: bold; font-size: 40rpx;padding-top: 20rpx; padding-bottom: 20rpx;"> |
||||
|
{{title}} |
||||
|
</view> |
||||
|
<view class="" style="background-color: black; height: 1rpx; "> |
||||
|
|
||||
|
</view> |
||||
|
<scroll-view scroll-y |
||||
|
style="background-color: #fff; align-items: center; border-radius: 10rpx; height: 600rpx; width: 100%"> |
||||
|
<view class="uni-flex " style="flex-direction: column; " v-for="(item,index) in dataList" :key="index"> |
||||
|
<view class="uni-flex " style="font-size: 38rpx; padding: 25rpx; flex-direction: row;" > |
||||
|
<view class="" style="font-size: 32rpx; font-weight: bold;"> |
||||
|
({{index+1}}). |
||||
|
</view> |
||||
|
<view class="" style="font-size: 32rpx;"> |
||||
|
<view class="" > |
||||
|
<text >ERP料号 :</text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemCode}}</text> |
||||
|
|
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >物料名称 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemName}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >料号描述 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemDesc1}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >箱码 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.packingCode}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >批次 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.lot}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >ERP储位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.locationErpCode}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >库位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.locationCode}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >数量 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.qty}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >单位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.uom}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<u-line></u-line> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</u-popup> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
showPopup:false |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
openScanPopup(list) { |
||||
|
this.dataList = list; |
||||
|
this.showPopup=true |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.showPopup=false |
||||
|
}, |
||||
|
select(item) { |
||||
|
this.closeScanPopup(); |
||||
|
this.$emit("select", item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.popup_box { |
||||
|
justify-content: center; |
||||
|
width: 100%; |
||||
|
margin-right: 50rpx; |
||||
|
padding-right: 50rpx; |
||||
|
height: 500rpx; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
.container { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
height: 100%; /* 需要确保父容器有足够的高度 */ |
||||
|
} |
||||
|
.popup-content { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
/* 其他样式 */ |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,128 @@ |
|||||
|
<template> |
||||
|
<view class="container"> |
||||
|
<u-popup ref="popup" v-model="showPopup" border-radius="15" style="width: 100%;" mode="center"> |
||||
|
<view class="" style="align-items: center;background-color: #fff; border-radius: 15rpx; margin: 20rpx;"> |
||||
|
<view class="uni-center popup-content" |
||||
|
style="font-weight: bold; font-size: 40rpx;padding-top: 20rpx; padding-bottom: 20rpx;"> |
||||
|
{{title}} |
||||
|
</view> |
||||
|
<view class="" style="background-color: black; height: 1rpx; "> |
||||
|
|
||||
|
</view> |
||||
|
<scroll-view scroll-y="" |
||||
|
style="background-color: #fff; align-items: center; border-radius: 10rpx; height: 600rpx; width: 100%"> |
||||
|
<view class="uni-flex " style="flex-direction: column; " v-for="(item,index) in dataList" :key="index"> |
||||
|
<view class="uni-flex " style="font-size: 38rpx; padding: 25rpx; flex-direction: row;" > |
||||
|
<view class="" style="font-size: 32rpx; font-weight: bold;"> |
||||
|
({{index+1}}). |
||||
|
</view> |
||||
|
<view class="" style="font-size: 32rpx;"> |
||||
|
<view class="" > |
||||
|
<text >ERP料号 :</text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemCode}}</text> |
||||
|
|
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >物料名称 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemName}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >料号描述 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.itemDesc1}}</text> |
||||
|
</view> |
||||
|
<view class="" v-if="item.recommendPackingCode"> |
||||
|
<text >箱码 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.recommendPackingCode}}</text> |
||||
|
</view> |
||||
|
<view class="" v-if="item.recommendLot"> |
||||
|
<text >批次 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.recommendLot}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >ERP储位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.recommendFromLocationErpCode}}</text> |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text >库位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.recommendFromLocationCode}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >数量 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.recommendQty}}</text> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text >单位 : </text> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">{{item.uom}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<u-line></u-line> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</u-popup> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
showPopup:false |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
openScanPopup(list) { |
||||
|
this.dataList = list; |
||||
|
this.showPopup=true |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.showPopup=false |
||||
|
}, |
||||
|
select(item) { |
||||
|
this.closeScanPopup(); |
||||
|
this.$emit("select", item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.popup_box { |
||||
|
justify-content: center; |
||||
|
width: 100%; |
||||
|
margin-right: 50rpx; |
||||
|
padding-right: 50rpx; |
||||
|
height: 500rpx; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
.container { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
height: 100%; /* 需要确保父容器有足够的高度 */ |
||||
|
} |
||||
|
.popup-content { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
/* 其他样式 */ |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,123 @@ |
|||||
|
<template> |
||||
|
<view class="container"> |
||||
|
<u-popup ref="popup" v-model="showPopup" border-radius="15" style="width: 100%;" mode="center"> |
||||
|
<view class="" style="align-items: center;background-color: #fff; border-radius: 15rpx; margin: 20rpx;"> |
||||
|
<view class="uni-center popup-content" |
||||
|
style="font-weight: bold; font-size: 40rpx;padding-top: 20rpx; padding-bottom: 20rpx;"> |
||||
|
{{title}} |
||||
|
</view> |
||||
|
<view class="" style="background-color: black; height: 1rpx; "> |
||||
|
|
||||
|
</view> |
||||
|
<scroll-view scroll-y="" |
||||
|
style="background-color: #fff; align-items: center; border-radius: 10rpx; height: 600rpx; width: 100%"> |
||||
|
<view class="uni-flex " style="flex-direction: column; " v-for="(item,index) in dataList" :key="index"> |
||||
|
<view class="uni-flex " style="font-size: 38rpx; padding: 25rpx; flex-direction: row;" > |
||||
|
<view class="" style="font-size: 32rpx; font-weight: bold;"> |
||||
|
({{index+1}}). |
||||
|
</view> |
||||
|
<view class="" style="font-size: 32rpx;"> |
||||
|
<view class="" > |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">ERP料号 :</text> |
||||
|
{{item.itemCode}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">物料名称 : </text> |
||||
|
{{item.itemName}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">料号描述 : </text> |
||||
|
{{item.itemDesc1}} |
||||
|
</view> |
||||
|
<view class="" v-if="item.packingCode"> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;"> 箱码 : </text> |
||||
|
{{item.packingCode}} |
||||
|
</view> |
||||
|
<view class="" v-if="item.lot"> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">批次 : </text> |
||||
|
{{item.lot}} |
||||
|
</view> |
||||
|
<view class="" > |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">库位 : </text> |
||||
|
{{item.locationCode}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">数量 : </text> |
||||
|
{{item.qty}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<text style="font-size: 32rpx; font-weight: bold;">单位 : </text> |
||||
|
{{item.uom}} |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<u-line></u-line> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</u-popup> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
showPopup:false |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
openScanPopup(list) { |
||||
|
this.dataList = list; |
||||
|
this.showPopup=true |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.showPopup=false |
||||
|
}, |
||||
|
select(item) { |
||||
|
this.closeScanPopup(); |
||||
|
this.$emit("select", item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.popup_box { |
||||
|
justify-content: center; |
||||
|
width: 100%; |
||||
|
margin-right: 50rpx; |
||||
|
padding-right: 50rpx; |
||||
|
height: 500rpx; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
.container { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
height: 100%; /* 需要确保父容器有足够的高度 */ |
||||
|
} |
||||
|
.popup-content { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
/* 其他样式 */ |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,58 @@ |
|||||
|
<template> |
||||
|
<view class="scan_float_top" @click="goScan('bottom')"> |
||||
|
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
||||
|
<view >{{title}}</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
value: "扫描" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
goScan(content) { |
||||
|
this.$emit("goScan", ''); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.scan_float_top{ |
||||
|
opacity: 0.4; |
||||
|
position: fixed; |
||||
|
z-index: 11; |
||||
|
left: 20rpx; |
||||
|
bottom: 25%; |
||||
|
width: 110rpx; |
||||
|
height: 110rpx; |
||||
|
color: #000; |
||||
|
background-color: #5A7CF3; |
||||
|
border-radius: 50%; |
||||
|
text-align: center; |
||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); |
||||
|
} |
||||
|
|
||||
|
.scan_float_top image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
margin-top: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.scan_float_top view { |
||||
|
color: #fff; |
||||
|
font-size: .725rem; |
||||
|
margin-top: -8rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,58 @@ |
|||||
|
<template> |
||||
|
<view class="scan_float_top" @click="goScan('bottom')"> |
||||
|
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
||||
|
<view >{{title}}</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
value: "扫描" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
goScan(content) { |
||||
|
this.$emit("goScan", ''); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.scan_float_top{ |
||||
|
opacity: 0.4; |
||||
|
position: fixed; |
||||
|
z-index: 11; |
||||
|
right: 20rpx; |
||||
|
bottom: 35%; |
||||
|
width: 110rpx; |
||||
|
height: 110rpx; |
||||
|
color: #000; |
||||
|
background-color: #5A7CF3; |
||||
|
border-radius: 50%; |
||||
|
text-align: center; |
||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); |
||||
|
} |
||||
|
|
||||
|
.scan_float_top image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
margin-top: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.scan_float_top view { |
||||
|
color: #fff; |
||||
|
font-size: .725rem; |
||||
|
margin-top: -8rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,58 @@ |
|||||
|
<template> |
||||
|
<view class="scan_float_top" @click="goScan('bottom')"> |
||||
|
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
||||
|
<view >{{title}}</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
value: "扫描" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
goScan(content) { |
||||
|
this.$emit("goScan", ''); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.scan_float_top{ |
||||
|
opacity: 0.4; |
||||
|
position: fixed; |
||||
|
z-index: 11; |
||||
|
right: 20rpx; |
||||
|
bottom: 15%; |
||||
|
width: 110rpx; |
||||
|
height: 110rpx; |
||||
|
color: #000; |
||||
|
background-color: #5A7CF3; |
||||
|
border-radius: 50%; |
||||
|
text-align: center; |
||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); |
||||
|
} |
||||
|
|
||||
|
.scan_float_top image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
margin-top: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.scan_float_top view { |
||||
|
color: #fff; |
||||
|
font-size: .725rem; |
||||
|
margin-top: -8rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,170 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
扫描器具码 |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
<view class="tab_info"> |
||||
|
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="器具码" |
||||
|
:clearResult="true"></win-com-scan> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="cancelClick()">清空</button> |
||||
|
<button class="scan_btn" @click="scanClick()">扫描</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winComScan from '@/mycomponents/wincom/winComScan.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import { |
||||
|
getContainerCodeInfo |
||||
|
} from '@/api/index.js'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'winScanByPack', |
||||
|
components: { |
||||
|
winComScan, |
||||
|
comMessage |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
scanResult: {}, |
||||
|
show: false, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup(content) { |
||||
|
this.$refs.popup.open('bottom'); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
this.$emit("close", ''); |
||||
|
}, |
||||
|
|
||||
|
scanClick() { |
||||
|
this.$refs.comscan.handelScanMsg(); |
||||
|
}, |
||||
|
cancelClick() { |
||||
|
this.$refs.comscan.clearScanValue(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
console.log("扫描",result.data.code) |
||||
|
if (result != null) { |
||||
|
if(result.data.code[0].toUpperCase()!="Q"){ |
||||
|
this.showMessage("标签格式不正确 : "+result.data.code) |
||||
|
return; |
||||
|
} |
||||
|
// uni.showLoading({ |
||||
|
// title: '扫描中...', |
||||
|
// mask: true |
||||
|
// }) |
||||
|
// getContainerCodeInfo(code).then(res=>{ |
||||
|
// uni.hideLoading(); |
||||
|
//this.scanResult=res.data |
||||
|
// }).catch(error=>{ |
||||
|
// uni.hideLoading(); |
||||
|
// this.showMessage(error.message) |
||||
|
// }) |
||||
|
var data = |
||||
|
{ |
||||
|
containerCode: "C19", |
||||
|
partCode: "TMDLYA0AFM6A", |
||||
|
partName: "P000000000000015", |
||||
|
partDesc: "MY前保总成件售后件(冲孔)", |
||||
|
basicUom: "PC", |
||||
|
locationCode: "W", |
||||
|
locationName: "原物料库位", |
||||
|
stdPackQty: 100, |
||||
|
remark: null, |
||||
|
tenantId: null, |
||||
|
concurrencyStamp: "b3f2cf7ba3e14166bb97dac768d91741", |
||||
|
lastModificationTime: null, |
||||
|
lastModifierId: null, |
||||
|
creationTime: "2024-02-28T14:47:08.6878607", |
||||
|
creatorId: null, |
||||
|
qty:0, |
||||
|
id: "4c40f72b-a86d-54be-aed2-3a1100a46436" |
||||
|
} |
||||
|
this.scanResult = data; |
||||
|
this.callBack() |
||||
|
// this.closeScanPopup() |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getLabelResult(label) { |
||||
|
let labelResult = { |
||||
|
sucess: true, |
||||
|
message: "", |
||||
|
data: label, |
||||
|
// data: { |
||||
|
// isPack: true, |
||||
|
// // scanType: null, |
||||
|
// itemCode: label.itemCode, |
||||
|
// itemName: label.itemName, |
||||
|
// itemDesc1: label.itemDesc1, |
||||
|
// itemDesc2: label.itemDesc2, |
||||
|
// lot: label.lot, |
||||
|
// qty: label.qty, |
||||
|
// uom: label.uom, |
||||
|
// poNumber: label.poNumber, |
||||
|
// // asn: null, |
||||
|
// packingCode: label.code, |
||||
|
// supplierBatch: label.supplierBatch, |
||||
|
// // order: null, |
||||
|
// // poLine: null, |
||||
|
// code: label.code, |
||||
|
// } |
||||
|
|
||||
|
}; |
||||
|
labelResult.data.isPack = true; |
||||
|
labelResult.data.packingCode = label.code; |
||||
|
return labelResult; |
||||
|
}, |
||||
|
|
||||
|
callBack() { |
||||
|
this.$refs.comscan.clear(); |
||||
|
this.$emit("getScanResult", this.scanResult); |
||||
|
}, |
||||
|
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> |
||||
|
</style> |
@ -0,0 +1,192 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
扫描位置码 |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
<view class="tab_info"> |
||||
|
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="位置码" |
||||
|
:clearResult="true"></win-com-scan> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="cancelClick()">清空</button> |
||||
|
<button class="scan_btn" @click="scanClick()">扫描</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winComScan from '@/mycomponents/wincom/winComScan.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import { |
||||
|
getPositionCodeInfo |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
getPositionCodeName |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
name: 'winScanByPack', |
||||
|
components: { |
||||
|
winComScan, |
||||
|
comMessage |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
codeType: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
scanResult: {}, |
||||
|
show: false, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup(content) { |
||||
|
this.$refs.popup.open('bottom'); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
this.$emit("close", ''); |
||||
|
}, |
||||
|
|
||||
|
scanClick() { |
||||
|
this.$refs.comscan.handelScanMsg(); |
||||
|
}, |
||||
|
cancelClick() { |
||||
|
this.$refs.comscan.clearScanValue(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
console.log("扫描",result.data.code) |
||||
|
if (result != null) { |
||||
|
// if(result.data.code[0].toUpperCase()!="W"){ |
||||
|
// this.showMessage("标签格式不正确") |
||||
|
// return; |
||||
|
// } |
||||
|
uni.showLoading({ |
||||
|
title: '扫描中...', |
||||
|
mask: true |
||||
|
}) |
||||
|
// var data = |
||||
|
// { |
||||
|
// code: "W19", |
||||
|
// partCode: "TMDLYA0AFM6A", |
||||
|
// partName: "P000000000000015", |
||||
|
// partDesc: "MY前保总成件售后件(冲孔)", |
||||
|
// basicUom: "PC", |
||||
|
// locationCode: "W", |
||||
|
// locationName: "原物料库位", |
||||
|
// stdPackQty: 100, |
||||
|
// remark: null, |
||||
|
// tenantId: null, |
||||
|
// extraProperties: {}, |
||||
|
// concurrencyStamp: "b3f2cf7ba3e14166bb97dac768d91741", |
||||
|
// lastModificationTime: null, |
||||
|
// lastModifierId: null, |
||||
|
// creationTime: "2024-02-28T14:47:08.6878607", |
||||
|
// creatorId: null, |
||||
|
// qty:0, |
||||
|
// id: "4c40f72b-a86d-54be-aed2-3a1100a46436" |
||||
|
// } |
||||
|
|
||||
|
getPositionCodeInfo(result.data.code).then(res=>{ |
||||
|
uni.hideLoading() |
||||
|
if(res){ |
||||
|
console.log("类型"+this.codeType) |
||||
|
if(res.type==this.codeType){ |
||||
|
this.scanResult = res; |
||||
|
this.scanResult.qty =1; |
||||
|
this.callBack() |
||||
|
this.closeScanPopup() |
||||
|
}else { |
||||
|
var type = |
||||
|
this.showMessage("位置码【"+res.code+"】的类型是["+getPositionCodeName(res.type) + "不是["+getPositionCodeName(this.codeType)+"]类型") |
||||
|
} |
||||
|
|
||||
|
}else { |
||||
|
this.showMessage("未查找到位置码【"+result.data.code+"】") |
||||
|
} |
||||
|
}).catch(error=>{ |
||||
|
uni.hideLoading() |
||||
|
this.showMessage(error.message) |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getLabelResult(label) { |
||||
|
let labelResult = { |
||||
|
sucess: true, |
||||
|
message: "", |
||||
|
data: label, |
||||
|
// data: { |
||||
|
// isPack: true, |
||||
|
// // scanType: null, |
||||
|
// itemCode: label.itemCode, |
||||
|
// itemName: label.itemName, |
||||
|
// itemDesc1: label.itemDesc1, |
||||
|
// itemDesc2: label.itemDesc2, |
||||
|
// lot: label.lot, |
||||
|
// qty: label.qty, |
||||
|
// uom: label.uom, |
||||
|
// poNumber: label.poNumber, |
||||
|
// // asn: null, |
||||
|
// packingCode: label.code, |
||||
|
// supplierBatch: label.supplierBatch, |
||||
|
// // order: null, |
||||
|
// // poLine: null, |
||||
|
// code: label.code, |
||||
|
// } |
||||
|
|
||||
|
}; |
||||
|
labelResult.data.isPack = true; |
||||
|
labelResult.data.packingCode = label.code; |
||||
|
return labelResult; |
||||
|
}, |
||||
|
|
||||
|
callBack() { |
||||
|
this.$refs.comscan.clear(); |
||||
|
this.$emit("getScanResult", this.scanResult); |
||||
|
}, |
||||
|
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> |
||||
|
</style> |
@ -0,0 +1,162 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
扫描{{title}} |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
<!-- <view class="uni-flex uni-row"> |
||||
|
<view class="tab_tit tab_tit_active">箱标签</view> |
||||
|
</view> --> |
||||
|
<view class="tab_info"> |
||||
|
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="箱标签" |
||||
|
:clearResult="true" :placeholder="title"></win-com-scan> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="cancelClick()">清空</button> |
||||
|
<button class="scan_btn" @click="scanClick()">扫描</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winComScan from '@/mycomponents/wincom/winComScan.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import { |
||||
|
getitems, |
||||
|
getMesBarCode |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
scanSuccessAudio, |
||||
|
scanFailedAudio |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'winScanByPack', |
||||
|
components: { |
||||
|
winComScan, |
||||
|
comMessage |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
scanResult: {}, |
||||
|
show: false, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup(content) { |
||||
|
this.$refs.popup.open('bottom'); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
this.$refs.popup.close(); |
||||
|
this.$emit("close", ''); |
||||
|
}, |
||||
|
|
||||
|
scanClick() { |
||||
|
this.$refs.comscan.handelScanMsg(); |
||||
|
}, |
||||
|
cancelClick() { |
||||
|
this.$refs.comscan.clearScanValue(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
if (result != null) { |
||||
|
uni.showLoading({ |
||||
|
title: '扫描中...', |
||||
|
mask: true |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
getMesBarCode(result.data.code).then(item=>{ |
||||
|
uni.hideLoading(); |
||||
|
if (item) { |
||||
|
//扫描完失去焦点,扫描完成后在业务里调用getfocus()方法 |
||||
|
this.scanResult = { |
||||
|
scanCode:result.data.code, |
||||
|
itemCode:item.itemCode, |
||||
|
itemName:item.itemName, |
||||
|
itemDesc1:item.itemDesc1, |
||||
|
stdPackQty: item.stdPackQty, |
||||
|
uom: item.uom, |
||||
|
qty:item.qty, |
||||
|
locationCode:item.locationCode |
||||
|
}; |
||||
|
this.callBack(); |
||||
|
} else { |
||||
|
scanFailedAudio() |
||||
|
this.losefocus(); |
||||
|
this.showMessage('单件码【' + result.data.code + '】,不存在') |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
scanFailedAudio() |
||||
|
uni.hideLoading(); |
||||
|
this.showMessage(err.message) |
||||
|
}); |
||||
|
|
||||
|
// getitems(result.data.code).then(item => { |
||||
|
// if (item) { |
||||
|
// this.losefocus(); //扫描完失去焦点,扫描完成后在业务里调用getfocus()方法 |
||||
|
// this.scanResult = { |
||||
|
// itemCode:item.code, |
||||
|
// itemName:item.name, |
||||
|
// itemDesc1:item.desc1, |
||||
|
// stdPackQty: item.stdPackQty, |
||||
|
// uom: item.basicUom |
||||
|
// }; |
||||
|
// uni.hideLoading(); |
||||
|
// this.callBack(); |
||||
|
// } else { |
||||
|
// this.showMessage('单件码【' + result.data.code + '】,在物料表中不存在') |
||||
|
// uni.hideLoading(); |
||||
|
// } |
||||
|
// }).catch(err => { |
||||
|
// uni.hideLoading(); |
||||
|
// this.showMessage(err.message) |
||||
|
// }); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
|
||||
|
callBack() { |
||||
|
this.$refs.comscan.clear(); |
||||
|
this.$emit("getScanResult", this.scanResult); |
||||
|
}, |
||||
|
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> |
||||
|
</style> |
@ -0,0 +1,111 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
扫描工位码 |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
<view class="tab_info"> |
||||
|
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="工位码" |
||||
|
:clearResult="true"></win-com-scan> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="cancelClick()">清空</button> |
||||
|
<button class="scan_btn" @click="scanClick()">扫描</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winComScan from '@/mycomponents/wincom/winComScan.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import { |
||||
|
getPositionCodeInfo |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
getPositionCodeName |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
name: 'winScanByPack', |
||||
|
components: { |
||||
|
winComScan, |
||||
|
comMessage |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
codeType: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
scanResult: {}, |
||||
|
show: false, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup(content) { |
||||
|
this.$refs.popup.open('bottom'); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
this.$emit("close", ''); |
||||
|
}, |
||||
|
|
||||
|
scanClick() { |
||||
|
this.$refs.comscan.handelScanMsg(); |
||||
|
}, |
||||
|
cancelClick() { |
||||
|
this.$refs.comscan.clearScanValue(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
console.log("扫描",result.data.code) |
||||
|
this.scanResult =result.data.code |
||||
|
this.callBack() |
||||
|
this.closeScanPopup() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
callBack() { |
||||
|
this.$refs.comscan.clear(); |
||||
|
this.$emit("getScanResult", this.scanResult); |
||||
|
}, |
||||
|
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> |
||||
|
</style> |
@ -1,29 +1,31 @@ |
|||||
{ |
{ |
||||
"name": "uniproject", |
"name": "uView", |
||||
"version": "1.0.0", |
"version": "1.8.6", |
||||
"description": "", |
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", |
||||
"main": "main.js", |
"main": "index.js", |
||||
|
"keywords": [ |
||||
|
"uview", |
||||
|
"ui", |
||||
|
"uni-app" |
||||
|
], |
||||
"scripts": { |
"scripts": { |
||||
"serve": "npm run dev", |
|
||||
"build": "npm run build", |
|
||||
"test": "echo \"Error: no test specified\" && exit 1" |
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
}, |
||||
"keywords": [], |
"repository": { |
||||
"author": "", |
"type": "git", |
||||
"license": "ISC", |
"url": "" |
||||
|
}, |
||||
"devDependencies": { |
"devDependencies": { |
||||
"sass": "^1.55.0", |
"node-sass": "^4.14.0", |
||||
"sass-loader": "^12.6.0" |
"sass-loader": "^8.0.2" |
||||
}, |
}, |
||||
"dependencies": { |
"author": "uView", |
||||
"axios": "^0.24.0", |
"license": "MIT", |
||||
"base-64": "^1.0.0", |
"id": "uview-v1", |
||||
"jwt-decode": "^3.1.2", |
"dcloudext": { |
||||
"moment": "^2.29.4", |
"category": [ |
||||
"uni-read-pages": "^1.0.5", |
"前端组件", |
||||
"uni-simple-router": "^1.5.5", |
"通用组件" |
||||
"vue-axios": "^3.5.1", |
] |
||||
"vue-barcode": "^1.3.0", |
|
||||
"vue-qrcode-reader": "^3.1.0" |
|
||||
} |
} |
||||
} |
} |
@ -0,0 +1,433 @@ |
|||||
|
<template> |
||||
|
<page-meta root-font-size="18px"></page-meta> |
||||
|
<view class=""> |
||||
|
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view> |
||||
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" |
||||
|
@scrolltolower="lower" @scroll="scroll" style="padding-bottom:150px"> |
||||
|
<view class="detail-list " v-for="(item, index) in itemList" :key="index"> |
||||
|
<view class="detail-content"> |
||||
|
<view class="" style=""> |
||||
|
<view class="uni-flex uni-row u-col-center"> |
||||
|
<view class="" style="margin-top: 20rpx; margin-left: 10rpx; font-weight: bold;"> |
||||
|
({{index+1}}). |
||||
|
</view> |
||||
|
<comItemCode :itemData="item"></comItemCode> |
||||
|
</view> |
||||
|
|
||||
|
<uni-table border stripe style=""> |
||||
|
<!-- <uni-tr> |
||||
|
<uni-td align="center">物品代码</uni-td> |
||||
|
<uni-td>{{item.itemCode}}</uni-td> |
||||
|
</uni-tr> --> |
||||
|
<uni-tr> |
||||
|
<uni-td align="center">单位</uni-td> |
||||
|
<uni-td>{{item.uom}}</uni-td> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-td align="center">标包数</uni-td> |
||||
|
<uni-td>{{item.stdPackQty}}</uni-td> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-td align="center">来源库位</uni-td> |
||||
|
<uni-td>{{item.fromLocationCode}}</uni-td> |
||||
|
</uni-tr> |
||||
|
|
||||
|
<uni-tr> |
||||
|
<uni-td align="center">数量</uni-td> |
||||
|
<uni-td> |
||||
|
<view class="uni-flex uni-row"> |
||||
|
<view class="uni-flex uni-row space-between" style="width: 100%;"> |
||||
|
<view class=""> |
||||
|
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty" |
||||
|
:max="99999" :min="0" @change="qtyChanged($event,item,index)"> |
||||
|
</com-number-box> |
||||
|
</view> |
||||
|
|
||||
|
<view class=""> |
||||
|
<button type="primary" size="mini" style="margin-left: 30rpx;" |
||||
|
@click="remove(item,index)">移除</button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-td> |
||||
|
</uni-tr> |
||||
|
</uni-table> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
|
||||
|
<div class="new_bot_box" v-show="itemList.length>0"> |
||||
|
<win-collapse-location ref="location" @getLocationCode='getToLocation' @clear='clear'> |
||||
|
</win-collapse-location> |
||||
|
<view class="new_btn_bot bot_pos uni-flex"> |
||||
|
<button class="new_clear_btn btn_double" @click="cancel()">清空</button> |
||||
|
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
||||
|
</view> |
||||
|
</div> |
||||
|
<win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> |
||||
|
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
||||
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
||||
|
<com-message ref="comMessage" @afterClose='afterCloseMessagg'></com-message> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
locations, |
||||
|
getBalancesByFilter, |
||||
|
completeTransfer |
||||
|
} from '@/api/index.js'; |
||||
|
|
||||
|
import { |
||||
|
showConfirmMsg, |
||||
|
goHome, |
||||
|
getRemoveOption, |
||||
|
scanSuccessAudio, |
||||
|
scanFailedAudio |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
||||
|
import comBalanceItem from '@/mycomponents/comItem/comBalanceItem.vue' |
||||
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
||||
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
||||
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
||||
|
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' |
||||
|
import comItemCode from '@/mycomponents/comItem/comItemCode.vue' |
||||
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
||||
|
|
||||
|
export default { |
||||
|
name: 'comtransfer', |
||||
|
components: { |
||||
|
winBlankView, |
||||
|
comBalanceItem, |
||||
|
comMessage, |
||||
|
winScanButton, |
||||
|
comBalance, |
||||
|
winCollapseLocation, |
||||
|
winScanByProductCode, |
||||
|
comItemCode, |
||||
|
comNumberBox |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
options: [], |
||||
|
itemList: [], |
||||
|
fromLocationCode: '', |
||||
|
fromLocationInfo: {}, |
||||
|
toLocationCode: '', |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
inventoryStatus: -1, |
||||
|
inventoryStatusArray: [], |
||||
|
isClearPackCode: false, //清除箱码 |
||||
|
isClearContainerCode: false, //清除托码 |
||||
|
isClearLot: false, //清除批次, |
||||
|
locationErpCode: '', |
||||
|
toLocationErpCode: '', |
||||
|
locationGotFocus: false, |
||||
|
transferType:"Transfer_Assemble" |
||||
|
}; |
||||
|
}, |
||||
|
props: { |
||||
|
// locationTypes: { |
||||
|
// type: [Array, String, Number], |
||||
|
// value: '' |
||||
|
// }, |
||||
|
byLocation: { |
||||
|
type: Boolean, |
||||
|
value: false |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
mounted: function() { |
||||
|
this.openScanPopup(); |
||||
|
this.options = getRemoveOption(); |
||||
|
|
||||
|
}, |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} else if (e.index === 1) { |
||||
|
window.location.reload(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
openScanPopup() { |
||||
|
this.$refs.scanPackPopup.openScanPopup() |
||||
|
}, |
||||
|
//提示是否移除选择的行? |
||||
|
swipeClick(e, index) { |
||||
|
let { |
||||
|
content |
||||
|
} = e; |
||||
|
if (content.text === '移除') { |
||||
|
uni.showModal({ |
||||
|
title: '提示', |
||||
|
content: '是否移除选择的行?', |
||||
|
success: res => { |
||||
|
if (res.confirm) { |
||||
|
this.itemList.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
remove(index) { |
||||
|
showConfirmMsg("确定移除?", res => { |
||||
|
if (res) { |
||||
|
this.itemList.splice(index, 1); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
let that = this; |
||||
|
let code = result.itemCode; |
||||
|
let datas = that.itemList.filter(r => { |
||||
|
return r.itemCode == code |
||||
|
}) |
||||
|
|
||||
|
if (datas.length > 0) { |
||||
|
scanFailedAudio() |
||||
|
showConfirmMsg('物料【' + code + '】已经存在,是否要重新扫描?', confirm => { |
||||
|
if (confirm) { |
||||
|
that.itemList.forEach((r, i) => { |
||||
|
if (r.packingCode == code) { |
||||
|
that.itemList.splice(i, 1); |
||||
|
return; |
||||
|
} |
||||
|
}); |
||||
|
// that.getBalance(code); |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
var item = { |
||||
|
itemCode: result.itemCode, |
||||
|
itemName: result.itemName, |
||||
|
itemDesc1: result.itemDesc1, |
||||
|
stdPackQty: result.stdPackQty, |
||||
|
uom: result.uom, |
||||
|
qty: result.stdPackQty, |
||||
|
fromLocationCode: result.locationCode, |
||||
|
fromStatus: 2, |
||||
|
toStatus:2 |
||||
|
} |
||||
|
|
||||
|
this.itemList.unshift(item); |
||||
|
this.$refs.scanPackPopup.closeScanPopup() |
||||
|
scanSuccessAudio() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
qtyChanged(value, item, index) { |
||||
|
if (value <= 0) { |
||||
|
this.showMessage('退货数量必须大于0') |
||||
|
item.handledQty = item.qty |
||||
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
||||
|
} |
||||
|
}, |
||||
|
getFromLocation(code, callBack) { |
||||
|
locations(code).then(res => { |
||||
|
if (res) { |
||||
|
this.fromLocationInfo = res; |
||||
|
callBack(true) |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
callBack(false) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
getToLocation(code) { |
||||
|
if (code == '') { |
||||
|
this.showMessage('目标库位不能为空'); |
||||
|
return; |
||||
|
} |
||||
|
uni.showLoading({ |
||||
|
title: "扫描中", |
||||
|
mask: true |
||||
|
}); |
||||
|
let that = this; |
||||
|
locations(code).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res) { |
||||
|
//不要待检、隔离、在途、 |
||||
|
if (res.type == 1 || res.type == 6 || res.type == 13) { |
||||
|
scanFailedAudio() |
||||
|
that.showMessage("目标库位不可以是待检、隔离、在途库位类型"); |
||||
|
} else { |
||||
|
scanSuccessAudio() |
||||
|
that.toLocationCode = code; |
||||
|
that.toLocationErpCode = res.erpLocationCode; |
||||
|
} |
||||
|
} else { |
||||
|
scanFailedAudio() |
||||
|
that.toLocationCode = '' |
||||
|
that.showMessage('目标库位【' + code + '】不存在'); |
||||
|
this.$refs.location.clearLocation() |
||||
|
this.locationGotFocus = true; |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
scanFailedAudio() |
||||
|
that.toLocationCode = '' |
||||
|
this.locationGotFocus = true; |
||||
|
that.showMessage(err.message); |
||||
|
uni.hideLoading(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
clear() { |
||||
|
this.location = null; |
||||
|
this.toLocationCode = ""; |
||||
|
}, |
||||
|
|
||||
|
submit() { |
||||
|
let that = this; |
||||
|
if (that.itemList.length === 0) { |
||||
|
this.showMessage('请选择要提交的零件'); |
||||
|
return; |
||||
|
} |
||||
|
if (that.toLocationCode === '') { |
||||
|
this.showMessage('请扫描目标库位'); |
||||
|
return; |
||||
|
} |
||||
|
this.getFromLocation(this.itemList[0].fromLocationCode, res => { |
||||
|
if (res) { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
let item = { |
||||
|
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage |
||||
|
.userName_CN, |
||||
|
warehouseCode: localStorage.warehouseCode, |
||||
|
jobNumber: "", |
||||
|
supplierCode: "", |
||||
|
company: localStorage.company, |
||||
|
number: "", |
||||
|
type: this.transferType, |
||||
|
details: [] |
||||
|
} |
||||
|
|
||||
|
this.itemList.forEach(r => { |
||||
|
r.toLocationCode = that.toLocationCode; |
||||
|
r.toLocationErpCode = this.toLocationErpCode |
||||
|
r.fromLot =""; |
||||
|
r.fromLocationArea = this.fromLocationInfo.areaCode; |
||||
|
r.fromLocationGroup = this.fromLocationInfo.locationGroupCode; |
||||
|
r.fromLocationErpCode = this.fromLocationInfo.erpLocationCode; |
||||
|
r.fromWarehouseCode = localStorage.warehouseCode; |
||||
|
|
||||
|
r.toLot =""; |
||||
|
r.fromPackingCode=""; |
||||
|
r.toPackingCode = ""; |
||||
|
|
||||
|
r.toWarehouseCode =localStorage.warehouseCode; |
||||
|
r.worker = localStorage.userName_CN == "" ? localStorage.userName : |
||||
|
localStorage.userName_CN |
||||
|
item.details.push(r); |
||||
|
}) |
||||
|
|
||||
|
let params = JSON.stringify(item); |
||||
|
console.log('params', params); |
||||
|
completeTransfer(params) |
||||
|
.then(res => { |
||||
|
that.showCommitSuccess(); |
||||
|
that.clearInfo(); |
||||
|
uni.hideLoading(); |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
that.showMessage(err.message); |
||||
|
uni.hideLoading(); |
||||
|
}); |
||||
|
}else { |
||||
|
that.showMessage("库位[" + this.itemList[0].fromLocationCode + "]不存在"); |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
let that = this; |
||||
|
showConfirmMsg('是否要清空已扫描的零件和目标库位信息?', confirm => { |
||||
|
if (confirm) { |
||||
|
that.clearInfo(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
clearInfo() { |
||||
|
let that = this; |
||||
|
that.itemList = []; |
||||
|
that.toLocationCode = ''; |
||||
|
that.inventoryStatus = -1; |
||||
|
that.$refs.location.clearLocation() |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessagg() { |
||||
|
if (this.locationGotFocus) { |
||||
|
this.$refs.location.gotFocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
clearPackCode() { |
||||
|
this.isClearPackCode = !this.isClearPackCode; |
||||
|
}, |
||||
|
|
||||
|
clearContainerCode() { |
||||
|
this.isClearContainerCode = !this.isClearContainerCode; |
||||
|
}, |
||||
|
|
||||
|
clearLot() { |
||||
|
this.isClearLot = !this.isClearLot; |
||||
|
}, |
||||
|
|
||||
|
upper: function(e) { |
||||
|
// console.log(e) |
||||
|
}, |
||||
|
lower: function(e) { |
||||
|
// console.log(e) |
||||
|
}, |
||||
|
scroll: function(e) { |
||||
|
// console.log(e) |
||||
|
this.old.scrollTop = e.detail.scrollTop; |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message); |
||||
|
}, |
||||
|
showCommitSuccess() { |
||||
|
this.$refs.comMessage.showCommitSuccess(); |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/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> |
@ -0,0 +1,262 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
|
||||
|
<!-- <view class="" style="width: 100%; background-color: #fff;"> |
||||
|
<uni-section title="1.物流类型" subTitle="内物流" subTitleFontSize="32rpx" titleFontSize="40rpx" |
||||
|
type="line" padding> |
||||
|
</uni-section> |
||||
|
</view> |
||||
|
|
||||
|
<view class="" style="width: 100%; background-color: #fff;"> |
||||
|
<uni-section title="2.器具规格" subTitleFontSize="32rpx" titleFontSize="40rpx" |
||||
|
type="line" padding> |
||||
|
</uni-section> |
||||
|
</view> |
||||
|
--> |
||||
|
<view class="uni-list"> |
||||
|
<view class="uni-list-cell" |
||||
|
style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;"> |
||||
|
<view class="" style="color: red; font-size: 40rpx; "> |
||||
|
* |
||||
|
</view> |
||||
|
<view class="uni-list-cell-left" |
||||
|
style="font-size:35rpx; align-items: center;display: flex; text-align: center;font-weight: bold;"> |
||||
|
目标库位 : |
||||
|
</view> |
||||
|
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation"> |
||||
|
<text>{{locationCode}}</text> |
||||
|
<text v-if="locationName!=''">({{locationName}})</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-list"> |
||||
|
<view class="uni-list-cell " style="padding:10rpx; "> |
||||
|
<view class="" style="color: red; font-size: 40rpx; "> |
||||
|
* |
||||
|
</view> |
||||
|
<view class="uni-list-cell-left" style="font-size:35rpx;font-weight: bold;"> |
||||
|
器具类型 : |
||||
|
</view> |
||||
|
<view class="uni-list-cell-db" style="font-size: 35rpx;"> |
||||
|
内物流 |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-list"> |
||||
|
<view class="uni-flex uni-row" style="padding:10rpx"> |
||||
|
<view class="" style="color: red; font-size: 40rpx; "> |
||||
|
* |
||||
|
</view> |
||||
|
<view class="uni-list-cell-left" style="font-size:35rpx;font-weight: bold;"> |
||||
|
器具规格 : |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-list-cell-db" style="margin-bottom: 20rpx;"> |
||||
|
<!-- <picker @change="containerModelChange" :value="modelIndex" :range="containerModelList" |
||||
|
range-key="name"> |
||||
|
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view> |
||||
|
</picker> --> |
||||
|
|
||||
|
<view class="uni-flex uni-row" style="flex-wrap: wrap;"> |
||||
|
<view class="uni-flex" style=" width: 33.3%; justify-content: center; margin-top: 20rpx; " |
||||
|
v-for="(item, index) in containerModelList" :key="index"> |
||||
|
<uni-tag :inverted="!item.checked" :circle="true" :text="item.name" type="primary" |
||||
|
@click="setContainerModel(item)" /> |
||||
|
|
||||
|
<!-- <u-radio size="45" labelSize="35" iconSize="40" :name="radio.name" @change="radioChangeType3(item,radio)"> |
||||
|
{{radio.name}} |
||||
|
</u-radio> --> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="new_btn_bot"> |
||||
|
<button class="new_save_btn" @click="submit()">提交</button> |
||||
|
</view> |
||||
|
<win-scan-by-code ref="scanLocation" title="库位" @getScanCode='getLocation'></win-scan-by-code> |
||||
|
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterClose='afterClose' |
||||
|
@afterCloseCommitMessage='closeCommitMessage'> |
||||
|
</com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
locations, |
||||
|
getDictByCode, |
||||
|
containerRequest |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
goHome, |
||||
|
getContainerTypeArray, |
||||
|
getISODateTime, |
||||
|
navigateBack |
||||
|
} from '@/common/basic.js'; |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
comMessage, |
||||
|
winScanByCode |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
containerModelList: [], |
||||
|
typeIndex: 0, |
||||
|
modelIndex: 0, |
||||
|
location: "", |
||||
|
locationCode: "请扫描库位", |
||||
|
locationName: "", |
||||
|
containerType: "内物流", |
||||
|
containerTypeCode: "InLogistics", |
||||
|
containerModel: "请选择器具规格", |
||||
|
containerModelCode: "" |
||||
|
} |
||||
|
}, |
||||
|
onShow() { |
||||
|
this.getContainerModelList(); |
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} else if (e.index === 1) { |
||||
|
window.location.reload(); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
setContainerModel(item) { |
||||
|
this.containerModelList.forEach(res => { |
||||
|
res.checked = false |
||||
|
}) |
||||
|
item.checked = true; |
||||
|
this.containerModelCode = item.code; |
||||
|
}, |
||||
|
getContainerModelList() { |
||||
|
uni.showLoading({ |
||||
|
title: '加载中...', |
||||
|
mask: true |
||||
|
}); |
||||
|
getDictByCode("ContainerSpecificationsType").then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res && res.items.length > 0) { |
||||
|
res.items.forEach(item => { |
||||
|
item.value = item.code; |
||||
|
item.checked = false |
||||
|
}) |
||||
|
this.containerModelList = res.items; |
||||
|
} else { |
||||
|
this.showMessage('获取器具规格失败,请在字典中维护器具规格'); |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
uni.hideLoading(); |
||||
|
this.showMessage('获取器具规格失败【' + error + '】'); |
||||
|
}) |
||||
|
}, |
||||
|
openScanLocation() { |
||||
|
this.$refs.scanLocation.openScanPopup() |
||||
|
}, |
||||
|
|
||||
|
closeScanLocation() { |
||||
|
this.$refs.scanLocation.closeScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(code) { |
||||
|
let that = this; |
||||
|
if (code == '') return; |
||||
|
uni.showLoading({ |
||||
|
title: '扫描中...', |
||||
|
mask: true |
||||
|
}); |
||||
|
locations(code).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res) { |
||||
|
that.locationCode = res.code; |
||||
|
that.locationName = res.name |
||||
|
that.closeScanLocation(); |
||||
|
} else { |
||||
|
that.scanPopupLoseFocus(); |
||||
|
that.showMessage('未查询到库位【' + code + '】'); |
||||
|
} |
||||
|
|
||||
|
}).catch(err => { |
||||
|
uni.hideLoading(); |
||||
|
that.showMessage(err.message); |
||||
|
}); |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message); |
||||
|
}, |
||||
|
afterClose() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
this.$refs.scanLocation.getfocus(); |
||||
|
}, |
||||
|
scanPopupLoseFocus() { |
||||
|
this.$refs.scanLocation.losefocus(); |
||||
|
}, |
||||
|
clearData() { |
||||
|
this.containerModelCode = "" |
||||
|
this.containerModelList.forEach(res => { |
||||
|
res.checked = false |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
setParams() { |
||||
|
var data = { |
||||
|
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
||||
|
activeDate: getISODateTime(), |
||||
|
containerType: this.containerTypeCode, |
||||
|
specificationsType: this.containerModelCode, |
||||
|
requestLocationCode: this.locationCode, |
||||
|
|
||||
|
} |
||||
|
return data; |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccess(message) { |
||||
|
this.$refs.comMessage.showCommitSuccess(message); |
||||
|
}, |
||||
|
|
||||
|
closeCommitMessage() { |
||||
|
navigateBack(1) |
||||
|
}, |
||||
|
|
||||
|
submit() { |
||||
|
if (this.containerModelCode == "") { |
||||
|
this.showMessage("请选择器具规格") |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (this.locationCode == "请扫描库位") { |
||||
|
this.showMessage("请扫描库位") |
||||
|
return; |
||||
|
} |
||||
|
uni.showLoading({ |
||||
|
title: '提交中...', |
||||
|
mask: true |
||||
|
}); |
||||
|
var params = this.setParams(); |
||||
|
console.log(JSON.stringify(params)) |
||||
|
containerRequest(params).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
this.showCommitSuccess("提交成功"); |
||||
|
this.clearData(); |
||||
|
}).catch(err => { |
||||
|
uni.hideLoading(); |
||||
|
this.showMessage(err.message); |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,209 @@ |
|||||
|
<template> |
||||
|
<view style="padding: 15rpx;"> |
||||
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" |
||||
|
activeColor="#007AFF"></uni-segmented-control> |
||||
|
<view class="content"> |
||||
|
<view v-show="current === 0"> |
||||
|
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
||||
|
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index"> |
||||
|
|
||||
|
<view class="device-detail" style="font-size: 32rpx;"> |
||||
|
<com-job-top-info :jobContent="item"></com-job-top-info> |
||||
|
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view> |
||||
|
<view>器具规格 : {{item.specificationsTypeName}}</view> |
||||
|
<view>目标库位 : {{item.requestLocationCode}} </view> |
||||
|
<view>操作人 : {{item.worker}} </view> |
||||
|
<view>创建时间 : {{item.creationTime| formatDate}} </view> |
||||
|
|
||||
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" |
||||
|
@click="complete(item)">完成</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view v-show="current === 1"> |
||||
|
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
||||
|
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index"> |
||||
|
<view class="device-detail" style="font-size: 32rpx;"> |
||||
|
<com-job-top-info :jobContent="item"></com-job-top-info> |
||||
|
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view> |
||||
|
<view>器具规格 : {{item.specificationsTypeName}}</view> |
||||
|
<view>目标库位 : {{item.requestLocationCode}} </view> |
||||
|
<view>操作人 : {{item.worker}} </view> |
||||
|
<view>创建时间 : {{item.creationTime| formatDate}} </view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<uni-load-more :status="loadingType" v-if="dataList.length>0" /> |
||||
|
<com-message ref="comMessage"></com-message> |
||||
|
</view> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { |
||||
|
getContainerList, |
||||
|
getDictByCode, |
||||
|
finshContainerJob |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
goHome, |
||||
|
dateFormat, |
||||
|
getContainerTypeName, |
||||
|
showConfirmMsg |
||||
|
} from '@/common/basic.js'; |
||||
|
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
||||
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
winEmptyView, |
||||
|
comJobTopInfo, |
||||
|
comMessage |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
items: ['未完成', '已完成'], |
||||
|
current: 0, |
||||
|
pageSize: this.modelConfig, |
||||
|
pageIndex: 1, |
||||
|
loadingType: "nomore", |
||||
|
dataList: [], |
||||
|
containerModelList: [], |
||||
|
isFinished:false |
||||
|
}; |
||||
|
}, |
||||
|
filters: { |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
}, |
||||
|
getContainerTypeName: function(val) { |
||||
|
return getContainerTypeName(val) |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
onShow() { |
||||
|
this.getList('refresh'); |
||||
|
}, |
||||
|
onReachBottom() { |
||||
|
//避免多次触发 |
||||
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.getList("more"); |
||||
|
}, |
||||
|
onPullDownRefresh() { |
||||
|
this.getList('refresh'); |
||||
|
}, |
||||
|
//后退按钮 |
||||
|
onBackPress(options) { |
||||
|
if (options.from === 'navigateBack') { |
||||
|
return false; |
||||
|
} |
||||
|
goHome(); |
||||
|
return true; |
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} else if (e.index === 1) { |
||||
|
window.location.reload(); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
complete(item) { |
||||
|
showConfirmMsg("是否确认完成?", callback => { |
||||
|
if (callback) { |
||||
|
this.submit(item) |
||||
|
} else { |
||||
|
console.log('cancel') |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
onClickItem(item) { |
||||
|
this.current = item.currentIndex; |
||||
|
console.log("点击", this.current) |
||||
|
if(this.current==0){ |
||||
|
this.isFinished =false; |
||||
|
}else { |
||||
|
this.isFinished =true; |
||||
|
} |
||||
|
this.getList("refresh"); |
||||
|
}, |
||||
|
openScanPopup() { |
||||
|
this.$refs.scanPopup.openScanPopup(); |
||||
|
}, |
||||
|
|
||||
|
//查询发货任务 |
||||
|
getList(type) { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
this.loadingType = "loading"; |
||||
|
if (type === "refresh") { |
||||
|
this.pageIndex = 1; |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
let params = { |
||||
|
pageSize: that.pageSize, |
||||
|
pageIndex: that.pageIndex, |
||||
|
isFinished:that.isFinished |
||||
|
// isCreationTimeSorting: that.isTimeWindowSorting, |
||||
|
// isToday: that.isToday |
||||
|
}; |
||||
|
getContainerList(params) |
||||
|
.then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
var list = res.items; |
||||
|
this.loadingType = "loadmore"; |
||||
|
if (list == null || list.length == 0) { |
||||
|
//没数据了 |
||||
|
this.loadingType = "nomore"; |
||||
|
return; |
||||
|
} |
||||
|
// that.dataList = [...that.dataList, ...list]; |
||||
|
that.dataList = type === "refresh" ? list : this.dataList.concat(list); |
||||
|
that.pageIndex++; |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
this.loadingType = ""; |
||||
|
this.showMessage(err.message); |
||||
|
uni.hideLoading(); |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message); |
||||
|
}, |
||||
|
showCommitSuccessMessage() { |
||||
|
this.$refs.comMessage.showCommitSuccess(); |
||||
|
}, |
||||
|
submit(item) { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中...", |
||||
|
mask:true |
||||
|
}); |
||||
|
let params = this.dataList.find(r => r.id == item.id); |
||||
|
console.log("测试",JSON.stringify(params)); |
||||
|
finshContainerJob(item.id, params) |
||||
|
.then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res != null) { |
||||
|
this.showCommitSuccessMessage(); |
||||
|
this.getList("refresh") |
||||
|
} |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
this.showMessage(err.message); |
||||
|
uni.hideLoading(); |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,413 @@ |
|||||
|
<template> |
||||
|
<page-meta root-font-size="18px"></page-meta> |
||||
|
<view class=""> |
||||
|
<view class="top_card"> |
||||
|
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"> |
||||
|
</com-job-scan-detail> |
||||
|
</view> |
||||
|
|
||||
|
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
||||
|
class="scroll-detail"> |
||||
|
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
||||
|
<!-- 单选卡片 --> |
||||
|
<view class="detail-content"> |
||||
|
<view class="choose_main"> |
||||
|
<view class="ljh_box"> |
||||
|
<view class="tit_ljh">{{ item.itemCode }}</view> |
||||
|
<view class="ljh_left"> |
||||
|
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
||||
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="list_form hold_form"> |
||||
|
<view class="uni-container"> |
||||
|
<uni-table style="overflow-x: hidden;"> |
||||
|
<uni-tr> |
||||
|
<!-- <uni-th width="90"></uni-th> |
||||
|
<uni-th width="100" align="center">推荐</uni-th> |
||||
|
<uni-th width="100" align="center">实际</uni-th> --> |
||||
|
<uni-th width="50"></uni-th> |
||||
|
<uni-th width="120" align="center">推荐</uni-th> |
||||
|
<uni-th width="120" align="center">实际</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">数量</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
<!-- --> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="item.scaned" class="text_black"> |
||||
|
{{item.handledQty}}({{item.uom}}) |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">箱码</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_packingCode">{{ item.recommendPackingCode }}</view> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="item.scaned" class="text_packingCode"> |
||||
|
{{ item.handledPackingCode }} |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">批次</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view><text class="text_black">{{item.recommendLot }}</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="item.scaned"> |
||||
|
<text class="text_black">{{item.handledLot }}</text> |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
<uni-tr> |
||||
|
<uni-th width="50">库位</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view class="text_black">{{ item.recommendLocationCode }}</view> |
||||
|
</uni-th> |
||||
|
<uni-th width="120" align="center"> |
||||
|
<view v-if="item.scaned" class="text_black"> |
||||
|
{{ item.handledFromLocationCode }} |
||||
|
</view> |
||||
|
</uni-th> |
||||
|
</uni-tr> |
||||
|
</uni-table> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="choose_marked" v-if="item.scaned"> |
||||
|
<image src="@/static/image_marked.svg"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
|
||||
|
<view class="new_btn_bot count_shadow"> |
||||
|
<button type="primary" class="new_save_btn" @click="submit()">提交</button> |
||||
|
</view> |
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
||||
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
||||
|
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getDeliverDetail, |
||||
|
takeDeliverJob, |
||||
|
cancelTakeDeliverJob, |
||||
|
finshDeliverJob, |
||||
|
balances |
||||
|
} from '@/api/index.js'; |
||||
|
import { |
||||
|
showConfirmMsg, |
||||
|
goHome, |
||||
|
navigateBack |
||||
|
} from '@/common/basic.js'; |
||||
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
||||
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
||||
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
||||
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
||||
|
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
||||
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
winMulitScan, |
||||
|
winScanByPack, |
||||
|
comMessage, |
||||
|
comJobScanDetail, |
||||
|
comBalance |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
type: '', |
||||
|
id: "", |
||||
|
datacontent: {}, |
||||
|
details: {}, |
||||
|
toLocation: '', |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
ispending: false, |
||||
|
balancesItem: {}, |
||||
|
titleArray: ['箱标签', '目标库位'], |
||||
|
allCount: 0, |
||||
|
scanCount: 0, |
||||
|
jobStatus:"" |
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
itemCode: "", |
||||
|
}, |
||||
|
onLoad(param) { |
||||
|
this.id = param.id; |
||||
|
if (param.jobStatus == 1) { |
||||
|
this.receive((callback => { |
||||
|
this.getDetail(); |
||||
|
})); |
||||
|
} else { |
||||
|
this.getDetail(); |
||||
|
} |
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
}else if(e.index === 1){ |
||||
|
window.location.reload(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) { |
||||
|
//已经接收但是没提交任务 |
||||
|
if (e.from == 'backbutton') { |
||||
|
if (this.jobStatus == 2) { |
||||
|
//取消承接任务 |
||||
|
cancelTakeDeliverJob(this.id).then(res => { |
||||
|
uni.navigateBack(); |
||||
|
}).catch(error => { |
||||
|
uni.navigateBack(); |
||||
|
}) |
||||
|
} else { |
||||
|
uni.navigateBack(); |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
uni.setNavigationBarColor({ |
||||
|
frontColor: '#ffffff', |
||||
|
backgroundColor: "#5A7CF3 !important" |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup() { |
||||
|
this.$refs.scanPopup.openScanPopup(); |
||||
|
}, |
||||
|
//加载零件信息 |
||||
|
getDetail() { |
||||
|
let that = this; |
||||
|
let params = { |
||||
|
id: that.id, |
||||
|
}; |
||||
|
getDeliverDetail(params) |
||||
|
.then(item => { |
||||
|
console.log('item', item); |
||||
|
that.datacontent = item; |
||||
|
that.jobStatus = item.jobStatus |
||||
|
that.details = item.details; |
||||
|
that.details.forEach(r => r.scaned = false); |
||||
|
that.ispending = item.jobStatus === 2; |
||||
|
that.allCount = item.details.length; |
||||
|
// that.toLocation = item.details[0].recommendLocationCode; |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
this.showMessage('未查找到详细信息') |
||||
|
}); |
||||
|
}, |
||||
|
//扫描箱标签 |
||||
|
getScanResult(result) { |
||||
|
let that = this; |
||||
|
let code = result.data.code; |
||||
|
let item = this.details.find(r => { |
||||
|
return r.recommendPackingCode === code |
||||
|
}); |
||||
|
|
||||
|
if (item === undefined) { |
||||
|
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】'); |
||||
|
return; |
||||
|
} else { |
||||
|
if (item.scaned) { |
||||
|
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件'); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
//按照ERP料号和箱码去查询库存 |
||||
|
let params = { |
||||
|
pageSize: 1000, |
||||
|
pageIndex: 1, |
||||
|
packingCode: code, |
||||
|
locationTypes: [4], //成品 |
||||
|
inventoryStatuses: [2], //合格 |
||||
|
}; |
||||
|
balances(params) |
||||
|
.then(res => { |
||||
|
try { |
||||
|
if (res.totalCount == 0) { |
||||
|
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息'); |
||||
|
} else if (res.totalCount == 1) { |
||||
|
that.balancesItem = res.items[0]; |
||||
|
this.createItem(item); |
||||
|
} else { |
||||
|
this.$refs.balanceItems.openPopup(res.items); |
||||
|
} |
||||
|
uni.hideLoading(); |
||||
|
} catch (e) { |
||||
|
this.showMessage(e.message) |
||||
|
} |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
this.showMessage(err.message) |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
createItem(item) { |
||||
|
let that = this; |
||||
|
if (that.balancesItem != null || that.balancesItem != undefined) { |
||||
|
// if (that.balancesItem.qty != item.recommendQty) { |
||||
|
// this.showMessage('库存余额数量【' + that.balancesItem.qty + '】不等于推荐数量【' + item.recommendQty + '】,不可以进行发货') |
||||
|
// } else { |
||||
|
item.scaned = true; |
||||
|
item.handledContainerCode = that.balancesItem.containerCode; |
||||
|
item.handledPackingCode = that.balancesItem.packingCode; |
||||
|
item.handledBatch = that.balancesItem.batch; |
||||
|
item.handledLot = that.balancesItem.lot; |
||||
|
item.handledFromLocationArea = that.balancesItem.locationCode; |
||||
|
item.handledQty = that.balancesItem.qty; |
||||
|
|
||||
|
|
||||
|
// ================================== |
||||
|
// item.recommendFromLocationCode = string; |
||||
|
// item.recommendFromLocationArea = string; |
||||
|
// item.recommendFromLocationGroup = string; |
||||
|
// item.recommendFromLocationErpCode = string; |
||||
|
// item.recommendFromWarehouseCode = string; |
||||
|
// item.uom = string; |
||||
|
// item.recommendQty = 0; |
||||
|
// item.handledFromLocationCode = string; |
||||
|
// item.handledFromLocationArea = string; |
||||
|
// item.handledFromLocationGroup = string; |
||||
|
// item.handledFromLocationErpCode = string; |
||||
|
// item.handledFromWarehouseCode = string; |
||||
|
// item.handledQty = that.balancesItem.qty; |
||||
|
// item.toLocationCode = string; |
||||
|
// item.toLocationArea = string; |
||||
|
// item.toLocationGroup = string; |
||||
|
// item.toLocationErpCode = string; |
||||
|
// item.toWarehouseCode = string; |
||||
|
// item.onTheWayLocationCode = string; |
||||
|
|
||||
|
|
||||
|
this.getScanCount(); |
||||
|
this.closeScanPopup(); |
||||
|
that.$forceUpdate(); |
||||
|
// } |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
getScanCount() { |
||||
|
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.allCount == this.scanCount) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
selectedBalanceItem(balanceItem) { |
||||
|
that.balancesItem = balanceItem; |
||||
|
this.createItem(item); |
||||
|
}, |
||||
|
|
||||
|
//接收 |
||||
|
receive(callback) { |
||||
|
let params = { |
||||
|
id: this.id |
||||
|
}; |
||||
|
takeDeliverJob(params) |
||||
|
.then(res => { |
||||
|
callback(true); |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
this.showMessage(err.message); |
||||
|
callback(false); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
submit() { |
||||
|
let that = this; |
||||
|
if (that.datacontent.details.length === 0) { |
||||
|
this.showMessage('该任务没有要发货的零件'); |
||||
|
return; |
||||
|
} |
||||
|
let items = that.datacontent.details.filter(r => r.scaned); |
||||
|
if (items.length === 0) { |
||||
|
this.showMessage('请扫描要发货的零件'); |
||||
|
return; |
||||
|
} else if (items.length < that.datacontent.details.length) { |
||||
|
this.showMessage('还有未扫描的零件,不可以发货'); |
||||
|
return; |
||||
|
} else { |
||||
|
that.finsh(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
finsh() { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "提交中..." |
||||
|
}); |
||||
|
|
||||
|
let params = JSON.stringify(that.datacontent); |
||||
|
console.log(params); |
||||
|
// finshDeliverJob(that.id, params) |
||||
|
// .then(res => { |
||||
|
// uni.hideLoading(); |
||||
|
// if (res != null) { |
||||
|
// that.showCommitSuccessMessage(); |
||||
|
// navigateBack(1) |
||||
|
// } |
||||
|
// }) |
||||
|
// .catch(err => { |
||||
|
// this.showMessage(err.message); |
||||
|
// uni.hideLoading(); |
||||
|
// }); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
showCommitSuccessMessage() { |
||||
|
this.$refs.comMessage.showCommitSuccess(); |
||||
|
}, |
||||
|
|
||||
|
closeCommitMessage() { |
||||
|
navigateBack(1)//点关闭直接返回列表 |
||||
|
uni.hideLoading(); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.allCount == this.scanCount) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
clearScanLocation() { |
||||
|
// this.$refs.scanLocation.getfocus(); |
||||
|
// this.$refs.scanLocation.clear(); |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message); |
||||
|
}, |
||||
|
scroll: function(e) { |
||||
|
// console.log(e) |
||||
|
this.old.scrollTop = e.detail.scrollTop; |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue