Commit 1dd19fc2 by LJM

js

parent 0983f604
......@@ -54,7 +54,8 @@
text {
font-size: 26rpx;
color: #197adb;
margin-right: 10rpx;
margin-right: 60rpx;
font-weight: bold;
&:last-child {
margin-right: 0;
}
......@@ -63,6 +64,7 @@
}
}
.uni-table-box {
padding-top: 24rpx;
padding-bottom: 24rpx;
background-color: #ffffff;
::v-deep .uni-table-scroll {
......@@ -81,7 +83,7 @@
height: 98rpx;
background: #ffffff;
padding: 0 24rpx;
z-index: 999;
z-index: 98;
.t1 {
font-size: 22rpx;
color: #404547;
......@@ -116,6 +118,7 @@
border-radius: 4rpx;
font-size: 28rpx;
color: #ffffff;
margin-bottom: 100rpx;
}
}
......@@ -160,4 +163,10 @@
.uni-table-td {
border-right: 1px #ebeef5 solid;
}
.pop-list .uni-table-th {
width: 33.3% !important;
}
.pop-list .uni-table-td {
width: 33.3% !important;
}
}
<template>
<view class="scanInventory">
<view class="scanInven-form-item">
<view class="box row verCenter operate"><text>箱列表</text></view>
<view class="box row verCenter operate">
<text @click="exportChange()">导出</text>
<text @click="getBoxSnAndNumAll()">箱列表</text>
</view>
<view class="box row verCenter">
<view class="label">箱号</view>
<input v-model="box_sn" @input="inputChange" placeholder-style="font-size:24rpx;" class="uni-input" placeholder="请输入箱号" />
......@@ -17,7 +20,7 @@
</view>
</view>
</view>
<view class="addRow row rowCenter verCenter">新增行</view>
<view class="addRow row rowCenter verCenter" @click="addRowChange()">新增行</view>
<view class="uni-table-box">
<uni-table type="selection" border stripe emptyText="暂无更多数据" @selection-change="selectionChange">
<uni-tr>
......@@ -28,8 +31,8 @@
</uni-tr>
<uni-tr v-for="(item, index) in list" :key="index">
<uni-td align="center">{{ index + 1 }}</uni-td>
<uni-td align="center"><input class="uni-input" :value="item.goods_sn" /></uni-td>
<uni-td align="center"><input class="uni-input" :value="item.goods_num" /></uni-td>
<uni-td align="center"><input class="uni-input" v-model="list[index].goods_sn" /></uni-td>
<uni-td align="center"><input class="uni-input" v-model="list[index].goods_num" /></uni-td>
<uni-td align="center">{{ item.scan_time_cn }}</uni-td>
</uni-tr>
</uni-table>
......@@ -42,6 +45,22 @@
</view>
<view class="btn row rowCenter verCenter" @click="deleteChange">删除</view>
</view>
<uni-popup ref="popup" type="center" background-color="#fff">
<view class="uni-table-box pop-list" style="width: 550rpx;">
<uni-table border stripe emptyText="暂无更多数据">
<uni-tr>
<uni-th align="center">箱号</uni-th>
<uni-th align="center">货品数</uni-th>
<uni-th align="center">保存时间</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in listPop" :key="index">
<uni-td align="center">{{ item.box_sn }}</uni-td>
<uni-td align="center">{{ item.box_sn_goods_num }}</uni-td>
<uni-td align="center">{{ item.scan_time_cn }}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
</view>
</template>
......@@ -55,14 +74,28 @@ export default {
code_str: 'QTY:500 PN:PR03-1R CPN:PR03000201008JAC00 PO:18365781/11 CPO:B131190+A64120 MFR:VISHAY MPN:PR03000201008JAC00 RoHS',
code_type: '',
list: [],
listPop: [],
selectedIndexs: [],
index: -1,
array: ['扫描digikey', '扫描Mouser', '扫描Arrow', '扫描Rochester', '扫描TME', '扫描Chip1stop'],
arrar_val: ['digikey', 'Mouser', 'Arrow', 'Rochester', 'TME', 'Chip1stop']
};
},
created() {},
methods: {
getBoxSnAndNumAll() {
this.request(API.getBoxSnAndNum, 'POST', { box_sn: '' }, true).then(res => {
if (res.err_code === 0) {
this.listPop = res.data;
this.$refs.popup.open('center');
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
});
},
getBoxSnAndNum() {
this.request(API.getBoxSnAndNum, 'POST', { box_sn: this.box_sn }, false).then(res => {
if (res.err_code === 0) {
......@@ -82,7 +115,7 @@ export default {
this.list.unshift({
goods_num: res.data.num || '',
goods_sn: res.data.sn || '',
scan_time: '',
scan_time_cn: '',
wsbxnmsn_id: ''
});
} else {
......@@ -128,6 +161,47 @@ export default {
this.list.splice(this.selectedIndexs[i], 1);
}
},
exportChange() {
this.request(API.getBoxSnAndNum, 'POST', { box_sn: this.box_sn, export: 1 }, true).then(res => {
if (res.err_code === 0) {
uni.downloadFile({
url: res.data,
success: function(res) {
const filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
},
fail: function() {
uni.showModal({
title: '提示',
content: '暂不支持该文件类型预览',
showCancel: false
});
console.log('打开文档失败');
}
});
}
});
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
});
},
addRowChange() {
this.list.unshift({
goods_num: '',
goods_sn: '',
scan_time_cn: '',
wsbxnmsn_id: ''
});
},
submit() {
let params = {};
let arr = [];
......@@ -140,7 +214,7 @@ export default {
}
params.list = JSON.stringify(arr);
params.box_sn = this.box_sn;
this.request(API.submitBoxSnAndNum, 'POST', params, false).then(res => {
this.request(API.submitBoxSnAndNum, 'POST', params, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
......
## 1.8.2(2023-02-02)
- uni-popup-dialog 组件新增 inputType 属性
## 1.8.1(2022-12-01)
- 修复 nvue 下 v-show 报错
## 1.8.0(2022-11-29)
- 优化 主题样式
## 1.7.9(2022-04-02)
- 修复 弹出层内部无法滚动的bug
## 1.7.8(2022-03-28)
- 修复 小程序中高度错误的bug
## 1.7.7(2022-03-17)
- 修复 快速调用open出现问题的Bug
## 1.7.6(2022-02-14)
- 修复 safeArea 属性不能设置为false的bug
## 1.7.5(2022-01-19)
- 修复 isMaskClick 失效的bug
## 1.7.4(2022-01-19)
- 新增 cancelText \ confirmText 属性 ,可自定义文本
- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色
- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题
## 1.7.3(2022-01-13)
- 修复 设置 safeArea 属性不生效的bug
## 1.7.2(2021-11-26)
- 优化 组件示例
## 1.7.1(2021-11-26)
- 修复 vuedoc 文字错误
## 1.7.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup)
## 1.6.2(2021-08-24)
- 新增 支持国际化
## 1.6.1(2021-07-30)
......
......@@ -10,12 +10,12 @@
</view>
<view v-else class="uni-dialog-content">
<slot>
<input class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholderText" :focus="focus" >
<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" >
</slot>
</view>
<view class="uni-dialog-button-group">
<view class="uni-dialog-button" @click="closeDialog">
<text class="uni-dialog-button-text">{{cancelText}}</text>
<text class="uni-dialog-button-text">{{closeText}}</text>
</view>
<view class="uni-dialog-button uni-border-left" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
......@@ -31,7 +31,7 @@
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from '../uni-popup/i18n/index.js'
const { t } = initVueI18n(messages)
const { t } = initVueI18n(messages)
/**
* PopUp 弹出层-对话框样式
* @description 弹出层-对话框样式
......@@ -57,6 +57,10 @@
mixins: [popup],
emits:['confirm','close'],
props: {
inputType:{
type: String,
default: 'text'
},
value: {
type: [String, Number],
default: ''
......@@ -84,6 +88,14 @@
beforeClose: {
type: Boolean,
default: false
},
cancelText:{
type: String,
default: ''
},
confirmText:{
type: String,
default: ''
}
},
data() {
......@@ -95,10 +107,10 @@
},
computed: {
okText() {
return t("uni-popup.ok")
return this.confirmText || t("uni-popup.ok")
},
cancelText() {
return t("uni-popup.cancel")
closeText() {
return this.cancelText || t("uni-popup.cancel")
},
placeholderText() {
return this.placeholder || t("uni-popup.placeholder")
......@@ -162,10 +174,10 @@
}
</script>
<style lang="scss" scoped>
<style lang="scss" >
.uni-popup-dialog {
width: 300px;
border-radius: 15px;
border-radius: 11px;
background-color: #fff;
}
......@@ -175,8 +187,7 @@
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
padding-top: 25px;
}
.uni-dialog-title-text {
......@@ -191,12 +202,12 @@
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 15px 15px;
padding: 20px;
}
.uni-dialog-content-text {
font-size: 14px;
color: #6e6e6e;
color: #6C6C6C;
}
.uni-dialog-button-group {
......@@ -228,7 +239,8 @@
}
.uni-dialog-button-text {
font-size: 14px;
font-size: 16px;
color: #333;
}
.uni-button-color {
......
......@@ -71,7 +71,7 @@
}
}
</script>
<style lang="scss" scoped>
<style lang="scss" >
.uni-popup-message {
/* #ifndef APP-NVUE */
display: flex;
......
......@@ -59,16 +59,16 @@
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
name: 'sina'
},
{
text: '百度',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
name: 'copy'
},
{
text: '其他',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
name: 'more'
}
// {
// text: '百度',
// icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
// name: 'copy'
// },
// {
// text: '其他',
// icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
// name: 'more'
// }
]
}
},
......@@ -103,9 +103,11 @@
}
}
</script>
<style lang="scss" scoped>
<style lang="scss" >
.uni-popup-share {
background-color: #fff;
border-top-left-radius: 11px;
border-top-right-radius: 11px;
}
.uni-share-title {
/* #ifndef APP-NVUE */
......
{
"id": "uni-popup",
"displayName": "uni-popup 弹出层",
"version": "1.6.2",
"version": "1.8.2",
"description": " Popup 组件,提供常用的弹层",
"keywords": [
"uni-ui",
......@@ -17,12 +17,8 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
......@@ -38,10 +34,12 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-transition"
],
"encrypt": [],
......@@ -81,7 +79,7 @@
},
"Vue": {
"vue2": "y",
"vue3": "u"
"vue3": "y"
}
}
}
......
## 1.3.1(2021-11-23)
- 修复 init 方法初始化问题
## 1.3.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-transition](https://uniapp.dcloud.io/component/uniui/uni-transition)
## 1.2.1(2021-09-27)
- 修复 init 方法不生效的 Bug
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.1(2021-05-12)
- 新增 示例地址
- 修复 示例项目缺少组件的Bug
- 修复 示例项目缺少组件的 Bug
## 1.1.0(2021-04-22)
- 新增 通过方法自定义动画
- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式
......@@ -10,4 +17,4 @@
- 优化 支持单独的动画类型
- 优化 文档示例
## 1.0.2(2021-02-05)
- 调整为uni_modules目录规范
- 调整为 uni_modules 目录规范
......@@ -112,7 +112,7 @@ export default {
if (obj.duration) {
this.durationTime = obj.duration
}
this.animation = createAnimation(Object.assign(this.config, obj))
this.animation = createAnimation(Object.assign(this.config, obj),this)
},
/**
* 点击组件触发回调
......
{
"id": "uni-transition",
"displayName": "uni-transition 过渡动画",
"version": "1.2.0",
"version": "1.3.1",
"description": "元素的简单过渡动画",
"keywords": [
"uni-ui",
......@@ -41,7 +41,7 @@
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [],
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
......@@ -76,6 +76,10 @@
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment