|
@@ -3,7 +3,7 @@
|
|
|
<!-- 库存查询 -->
|
|
|
<view class="stock-con" v-if="$hasPermissions('M_stockQuery_mobile')">
|
|
|
<u-form :model="form" ref="uForm" label-width="100">
|
|
|
- <u-form-item label="条形码"><u-input v-model.trim="form.qrCode" border="bottom" placeholder="请输入条形码" input-align="right" /></u-form-item>
|
|
|
+ <u-form-item label="条形码"><u-input v-model.trim="form.productQrCode" border="bottom" placeholder="请输入条形码" input-align="right" /></u-form-item>
|
|
|
<u-form-item label="产品编码"><u-input v-model.trim="form.productCode" border="bottom" placeholder="请输入产品编码" input-align="right" /></u-form-item>
|
|
|
<u-form-item label="产品名称"><u-input v-model.trim="form.productName" border="bottom" placeholder="请输入产品名称" input-align="right" /></u-form-item>
|
|
|
</u-form>
|
|
@@ -12,20 +12,58 @@
|
|
|
<u-button size="medium" hover-class="none" shape="circle" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 查询结果 -->
|
|
|
+ <view class="stockDetail-info" v-if="listData">
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">产品编码</view>
|
|
|
+ <view>{{listData && listData.productCode || '--'}} <copyText :text="listData.productCode" label="产品编码"></copyText></view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">产品名称</view>
|
|
|
+ <view>{{listData && listData.productName || '--'}} <copyText :text="listData.productName" label="产品名称"></copyText></view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">条形码</view>
|
|
|
+ <view>{{listData && listData.productQrCode || '--'}} <copyText :text="listData.productQrCode" label="条形码"></copyText></view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">库存数量</view>
|
|
|
+ <view>{{toThousands(listData.currentStockQty||0)}}{{listData.productUnit}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">仓库/仓位</view>
|
|
|
+ <view>{{listData && listData.putBizTypeDictValue || '--'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">产品分类</view>
|
|
|
+ <view>{{listData && listData.putBizTypeDictValue || '--'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">单位</view>
|
|
|
+ <view>{{listData && listData.putBizTypeDictValue || '--'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-item flex align_center justify_between">
|
|
|
+ <view class="info-name">产品图片</view>
|
|
|
+ <view>{{listData && listData.putBizTypeDictValue || '--'}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<scanCode></scanCode>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import scanCode from '@/libs/scan-code.vue';
|
|
|
- import { dealerProductTypeList , stockCount } from '@/config/api'
|
|
|
+ import { dealerProductTypeList , stockList } from '@/config/api'
|
|
|
+ import copyText from '@/pages/common/copyText.vue'
|
|
|
+ import { toThousands } from '@/libs/tools'
|
|
|
export default{
|
|
|
- components: { scanCode },
|
|
|
+ components: { scanCode, copyText },
|
|
|
data(){
|
|
|
return {
|
|
|
form: {
|
|
|
productCode: '', // 产品编码
|
|
|
- qrCode: '', // 挑选码
|
|
|
+ productQrCode: '', // 挑选码
|
|
|
productName: '', // 产品名称
|
|
|
productOrigCode: '', // 原厂编码
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
@@ -37,40 +75,19 @@
|
|
|
minUnsalableDays: undefined, // 滞销天数最小值
|
|
|
maxUnsalableDays: undefined // 滞销天数最大值
|
|
|
},
|
|
|
- totalData: null,
|
|
|
- brandModal: false,
|
|
|
- brandName: '',
|
|
|
- showTypeModal: false,
|
|
|
- nowData: {
|
|
|
- data: [],
|
|
|
- indArr: [],
|
|
|
- nowInd: 0
|
|
|
- },
|
|
|
customBtnStyle: { // 自定义按钮样式
|
|
|
backgroundColor: '#335fb6',
|
|
|
color: '#fff'
|
|
|
},
|
|
|
+ listData: null,
|
|
|
+ toThousands
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- productTypeNameArr: function() {
|
|
|
- let str = ''
|
|
|
- this.nowData.data.map(item => {
|
|
|
- str += item.productTypeName+' / '
|
|
|
- })
|
|
|
- return str ? str.substr(0, str.length-3) : ''
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- 'form.enableFlag' (newValue, oldValue) {
|
|
|
- uni.setStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId, newValue)
|
|
|
- },
|
|
|
- },
|
|
|
onLoad() {
|
|
|
var _this = this
|
|
|
uni.$on('scancodedate', function(content) {
|
|
|
console.log("扫描到的内容为:", content)
|
|
|
- _this.form.qrCode = content||''
|
|
|
+ _this.form.productQrCode = content||''
|
|
|
_this.handleSearch()
|
|
|
})
|
|
|
},
|
|
@@ -80,9 +97,7 @@
|
|
|
onShow() {
|
|
|
// 是否默认包括禁用产品
|
|
|
const a = uni.getStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId)
|
|
|
- console.log(typeof a == 'boolean')
|
|
|
this.form.enableFlag = typeof a == 'boolean' ? a : true
|
|
|
- this.getTotal()
|
|
|
},
|
|
|
methods: {
|
|
|
$message(msg){
|
|
@@ -91,100 +106,39 @@
|
|
|
title: msg
|
|
|
})
|
|
|
},
|
|
|
- // 校验滞销天数数值范围
|
|
|
- checkValueRange () {
|
|
|
- const a = !this.form.minUnsalableDays
|
|
|
- const b = !this.form.maxUnsalableDays
|
|
|
-
|
|
|
- if(a && !b){
|
|
|
- this.$message('请输入滞销天数的起始天数!')
|
|
|
- return false
|
|
|
- }
|
|
|
- if(b && !a){
|
|
|
- this.$message('请输入滞销天数的截止天数!')
|
|
|
- return false
|
|
|
- }
|
|
|
- console.log(this.form.minUnsalableDays , this.form.maxUnsalableDays,this.form.minUnsalableDays > this.form.maxUnsalableDays)
|
|
|
- if (Number(this.form.minUnsalableDays) > Number(this.form.maxUnsalableDays)) {
|
|
|
- this.$message('截止天数应大于起始天数!')
|
|
|
- return false
|
|
|
- }
|
|
|
- this.form.minUnsalableDays = this.form.minUnsalableDays > 999999 ? 999999 : this.form.minUnsalableDays
|
|
|
- this.form.maxUnsalableDays = this.form.maxUnsalableDays > 999999 ? 999999 : this.form.maxUnsalableDays
|
|
|
- return true
|
|
|
- },
|
|
|
- // 合计
|
|
|
- getTotal () {
|
|
|
- stockCount({}).then(res => {
|
|
|
- if (res.status == 200 && res.data) {
|
|
|
- this.totalData = res.data
|
|
|
- } else {
|
|
|
- this.totalData = null
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 表单清空
|
|
|
handleClean(){
|
|
|
this.form.productCode = ''
|
|
|
- this.form.qrCode = ''
|
|
|
+ this.form.productQrCode = ''
|
|
|
this.form.productName = ''
|
|
|
this.form.productOrigCode = ''
|
|
|
- this.brandName = ''
|
|
|
this.form.productBrandSn = undefined
|
|
|
- this.nowData = {
|
|
|
- data: [],
|
|
|
- indArr: [],
|
|
|
- nowInd: 0
|
|
|
- }
|
|
|
this.form.productTypeSn1 = undefined
|
|
|
this.form.productTypeSn2 = undefined
|
|
|
this.form.productTypeSn3 = undefined
|
|
|
this.form.zeroQtyFlag = false
|
|
|
this.form.minUnsalableDays = undefined // 滞销天数最小值
|
|
|
this.form.maxUnsalableDays = undefined // 滞销天数最大值
|
|
|
- this.$refs.productBrand.onClean()
|
|
|
+ this.listData = null
|
|
|
},
|
|
|
// 查询
|
|
|
handleSearch(){
|
|
|
- if (this.checkValueRange()) {
|
|
|
- let params = JSON.parse(JSON.stringify(this.form))
|
|
|
- params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
|
|
|
- params.enableFlag = params.enableFlag ? '' : '1'
|
|
|
- uni.navigateTo({ url: "/pages/stock/stockSearch?data="+JSON.stringify(params) })
|
|
|
- }
|
|
|
- },
|
|
|
- // 选择品牌
|
|
|
- brandChoose(data){
|
|
|
- this.brandName = data.brandName
|
|
|
- this.form.productBrandSn = data.brandSn
|
|
|
- },
|
|
|
- // 清空品牌
|
|
|
- brandClean(){
|
|
|
- this.brandName = ''
|
|
|
- this.form.productBrandSn = undefined
|
|
|
- },
|
|
|
- // 选择分类
|
|
|
- typeChoose(obj){
|
|
|
- this.nowData = {
|
|
|
- data: obj.data,
|
|
|
- indArr: obj.indArr,
|
|
|
- nowInd: obj.nowInd
|
|
|
- }
|
|
|
- this.form.productTypeSn1 = this.nowData.data[0]&&this.nowData.data[0].productTypeSn ? this.nowData.data[0].productTypeSn : undefined
|
|
|
- this.form.productTypeSn2 = this.nowData.data[1]&&this.nowData.data[1].productTypeSn ? this.nowData.data[1].productTypeSn : undefined
|
|
|
- this.form.productTypeSn3 = this.nowData.data[2]&&this.nowData.data[2].productTypeSn ? this.nowData.data[2].productTypeSn : undefined
|
|
|
+ let params = this.form
|
|
|
+ params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
|
|
|
+ params.enableFlag = params.enableFlag ? '' : '1'
|
|
|
+ params.pageNo = 1
|
|
|
+ params.pageSize = 1
|
|
|
+ console.log(params)
|
|
|
+ stockList(params).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.status == 200){
|
|
|
+ this.listData = res.data.list[0]
|
|
|
+ }
|
|
|
+ if(this.listData.length==0){
|
|
|
+ this.$message("没有查询到产品")
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- // 清空分类
|
|
|
- typeClean(){
|
|
|
- this.nowData = {
|
|
|
- data: [],
|
|
|
- indArr: [],
|
|
|
- nowInd: 0
|
|
|
- }
|
|
|
- this.form.productTypeSn1 = undefined
|
|
|
- this.form.productTypeSn2 = undefined
|
|
|
- this.form.productTypeSn3 = undefined
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -225,7 +179,7 @@
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
.form-footer-btn{
|
|
|
- margin: 60upx 30upx 30upx;
|
|
|
+ margin: 30upx;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
@@ -235,5 +189,18 @@
|
|
|
font-size: 30upx;
|
|
|
}
|
|
|
}
|
|
|
+ .stockDetail-info{
|
|
|
+ background-color: #ffffff;
|
|
|
+ padding: 10upx 20upx 20upx;
|
|
|
+ border-radius: 20upx;
|
|
|
+ box-shadow: 3upx 2upx 6upx #eee;
|
|
|
+ .info-item{
|
|
|
+ border-bottom: 1px dashed #e4e7ed;
|
|
|
+ padding: 20upx 0;
|
|
|
+ .info-name{
|
|
|
+ color: #464646;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|