|
@@ -5,10 +5,10 @@
|
|
|
<text>条形码:</text>
|
|
|
<view style="flex-grow: 1;display: flex;align-items: center;">
|
|
|
<input
|
|
|
- style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;"
|
|
|
class="uni-input"
|
|
|
placeholder="扫描或输入条码"
|
|
|
border="surround"
|
|
|
+ @confirm="queryProduct"
|
|
|
v-model="query.qrCode">
|
|
|
</view>
|
|
|
</view>
|
|
@@ -16,9 +16,9 @@
|
|
|
<text>产品编码:</text>
|
|
|
<view style="flex-grow: 1;display: flex;align-items: center;">
|
|
|
<input
|
|
|
- style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;"
|
|
|
class="uni-input"
|
|
|
- placeholder="请输入产品编码"
|
|
|
+ placeholder="请输入产品编码"
|
|
|
+ @confirm="queryProduct"
|
|
|
border="surround"
|
|
|
v-model="query.code">
|
|
|
</view>
|
|
@@ -26,34 +26,34 @@
|
|
|
<view>
|
|
|
<text>产品名称:</text>
|
|
|
<view style="flex-grow: 1;display: flex;align-items: center;">
|
|
|
- <input
|
|
|
- style="width: 100%;text-align: left;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;"
|
|
|
+ <input
|
|
|
class="uni-input"
|
|
|
placeholder="请输入产品名称"
|
|
|
+ @confirm="queryProduct"
|
|
|
border="surround"
|
|
|
v-model="query.name">
|
|
|
</view>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <button type="primary" size="mini" @click="queryProduct" :style="{padding:'5px 20px'}">查询</button>
|
|
|
+ <button type="primary" size="mini" @click="queryProduct" :style="{padding:'5px 30px'}">查询</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="p-body">
|
|
|
<uni-table border emptyText="暂无数据" :loading="loading" >
|
|
|
<!-- 表头行 -->
|
|
|
<uni-tr>
|
|
|
- <uni-td align="center">条形码</uni-td>
|
|
|
<uni-td align="center">产品编码</uni-td>
|
|
|
<uni-td align="center">产品名称</uni-td>
|
|
|
+ <uni-td align="center">条形码</uni-td>
|
|
|
</uni-tr>
|
|
|
<!-- 表格数据行 -->
|
|
|
<uni-tr
|
|
|
v-for="item in detailList" :key="item.id"
|
|
|
:checkedRow="tempProduct&&tempProduct.id == item.id"
|
|
|
@click="toEdit(item)">
|
|
|
- <uni-td width="40%" align="center">{{item.qrCode}}</uni-td>
|
|
|
<uni-td width="30%" align="center">{{item.code}}</uni-td>
|
|
|
- <uni-td width="30%" align="center">{{item.name}}</uni-td>
|
|
|
+ <uni-td width="40%" align="center">{{item.name}}</uni-td>
|
|
|
+ <uni-td width="30%" align="center">{{item.qrCode}}</uni-td>
|
|
|
</uni-tr>
|
|
|
</uni-table>
|
|
|
</view>
|
|
@@ -68,7 +68,7 @@
|
|
|
border-radius: 30rpx;
|
|
|
width: 80%;
|
|
|
margin: 0 auto;">
|
|
|
- <view style="line-height: 60rpx;" v-if="tempProduct">
|
|
|
+ <view style="line-height: 60rpx;width: 600rpx;" v-if="tempProduct">
|
|
|
<view>
|
|
|
产品编码:{{tempProduct.code}}
|
|
|
</view>
|
|
@@ -76,12 +76,13 @@
|
|
|
产品名称:{{tempProduct.name}}
|
|
|
</view>
|
|
|
<view style="display: flex;align-items: center;padding-top: 15rpx;">
|
|
|
- 条形码:
|
|
|
+ <text>条形码:</text>
|
|
|
<input
|
|
|
:focus="true"
|
|
|
- style="width: 70%;text-align: left;border: 1px solid #eee;font-size: 32rpx;padding: 6rpx 0 6rpx 7rpx;"
|
|
|
+ style="width:350rpx;"
|
|
|
class="uni-input"
|
|
|
placeholder="扫描或输入条码"
|
|
|
+ @confirm="okPop"
|
|
|
border="surround"
|
|
|
v-model="code">
|
|
|
</view>
|
|
@@ -122,7 +123,12 @@
|
|
|
var _this = this
|
|
|
uni.$on('scancodedate', function(content) {
|
|
|
console.log("扫描到的内容为:", content)
|
|
|
- _this.code = content||''
|
|
|
+ if(_this.tempProduct){
|
|
|
+ _this.code = content||''
|
|
|
+ }else{
|
|
|
+ _this.query.qrCode = content||''
|
|
|
+ _this.queryProduct()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
},
|
|
@@ -132,8 +138,16 @@
|
|
|
onUnload() {
|
|
|
uni.$off('scancodedate')
|
|
|
},
|
|
|
+ onBackPress() {
|
|
|
+ if(this.tempProduct){
|
|
|
+ this.closePop()
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
closePop(){
|
|
|
+ this.code = ''
|
|
|
+ this.tempProduct = null
|
|
|
this.$refs.popup.close()
|
|
|
},
|
|
|
okPop(){
|
|
@@ -152,7 +166,6 @@
|
|
|
dealerProductSave(this.tempProduct).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.queryProduct()
|
|
|
- this.code == ''
|
|
|
this.closePop()
|
|
|
}
|
|
|
this.subloading = false
|
|
@@ -170,17 +183,19 @@
|
|
|
pageSize:10 ,
|
|
|
sysFlag: "0"
|
|
|
}
|
|
|
- console.log(params)
|
|
|
+ this.loading = true
|
|
|
dealerProductList({...params,...this.query}).then(res => {
|
|
|
console.log(res)
|
|
|
if(res.status == 200){
|
|
|
this.detailList = res.data && res.data.list || []
|
|
|
}
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
// 编辑
|
|
|
toEdit(item) {
|
|
|
this.tempProduct = item
|
|
|
+ this.code = this.tempProduct.qrCode
|
|
|
this.$refs.popup.open()
|
|
|
this.hideKeyborder()
|
|
|
}
|
|
@@ -200,7 +215,6 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
padding: 15upx 20upx;
|
|
|
- border-bottom: 1px solid #eee;
|
|
|
justify-content: space-between;
|
|
|
> view{
|
|
|
display: flex;
|
|
@@ -208,17 +222,18 @@
|
|
|
align-items: center;
|
|
|
}
|
|
|
}
|
|
|
- .uni-input{
|
|
|
- border: 1px solid #eee;
|
|
|
- width: 150upx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
}
|
|
|
.p-body{
|
|
|
overflow: auto;
|
|
|
flex-grow: 1;
|
|
|
height: 50%;
|
|
|
}
|
|
|
+ .uni-input{
|
|
|
+ border: 1px solid #eee;
|
|
|
+ width: 100%;
|
|
|
+ padding:10upx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
.p-footer{
|
|
|
padding:20upx 30upx;
|
|
|
display: flex;
|