wangfukang 3 years ago
parent
commit
c1bffc5f0d
  1. BIN
      package1/.DS_Store
  2. 114
      package1/AI/AIHangOrderList.vue
  3. 10
      package1/AI/AIInventoryList.vue
  4. 76
      package1/AI/AIPicture.vue
  5. 13
      package1/AI/AiChangeGoods.vue
  6. 113
      package1/AI/AiChat.vue
  7. 3255
      package1/AI/addAiList.vue
  8. 488
      package1/AI/voiceInventory.vue
  9. 476
      package1/inventory/addGoods.vue
  10. 1
      package1/inventory/batchPrint.vue
  11. 37
      package1/inventory/gategory.vue
  12. 10
      package1/inventory/inventoryConfirm.vue
  13. 2
      package1/staff/addStaff.vue
  14. 2
      package1/stock/addStock.vue
  15. 2
      package1/stock/stockDetail.vue

BIN
package1/.DS_Store

Binary file not shown.

114
package1/AI/AIHangOrderList.vue

@ -162,7 +162,7 @@
<view class="voice-text">语音识别中...</view> <view class="voice-text">语音识别中...</view>
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
<uni-popup ref="shopPopup" background-color="#fff" @change="allChangeNum = 0"> <uni-popup ref="shopPopup" background-color="#fff" @change="clickClose">
<view class="shop-popup-content"> <view class="shop-popup-content">
<view class="shop-popup-title"> <view class="shop-popup-title">
<view class="shop-popup-title-left"> <view class="shop-popup-title-left">
@ -217,7 +217,7 @@
<view @tap="minusNum" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;"> <view @tap="minusNum" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">-</text> <text class="zuni-numbox--text">-</text>
</view> </view>
<input v-model="allChangeNum" @blur="allChange" class="zuni-numbox__value" type="number" /> <input v-model="allChangeNum" @focus="obtainPrice($event,'zongjishu')" @blur="allChange" class="zuni-numbox__value" type="number" />
<view @tap="plusNum" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;"> <view @tap="plusNum" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">+</text> <text class="zuni-numbox--text">+</text>
</view> </view>
@ -231,7 +231,7 @@
<view class="shop-checkList-box"> <view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">{{item.productNum==null?'无库存':item.productNum}}</text> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">{{item.productNum==null?'无库存':item.productNum}}</text>
</view> </view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> <uni-number-box max='1000000' min="-10000" v-model="item.productCount" @change="temporaryChange" />
</view> </view>
</view> </view>
</view> </view>
@ -267,6 +267,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<view class="mask-model" v-if="isVoice">貌似没有检测到您上次的语音录入信息,正在反复识别中</view>
</view> </view>
</template> </template>
@ -279,12 +280,14 @@
data() { data() {
return { return {
khName:[], khName:[],
isVoice:false,
regList:[], regList:[],
pageNumber: 1, pageNumber: 1,
status: 'loadmore', status: 'loadmore',
recordState: false, recordState: false,
voiceText: ' ', voiceText: ' ',
list: [], list: [],
linshiPrice:0,
value: '', value: '',
isInventory:true, isInventory:true,
temporaryNum: 0, temporaryNum: 0,
@ -425,34 +428,25 @@
}, },
//按住语音识别,开始 //按住语音识别,开始
kaishi() { kaishi() {
if(this.isVoice == false){
this.recordState = true this.recordState = true
uni.vibrateShort();
manager.start({ manager.start({
duration: 60000, duration: 60000,
lang: "zh_CN" lang: "zh_CN"
}); });
}
}, },
//松开语音识别,结束 //松开语音识别,结束
jieshu() { jieshu() {
this.recordState = false this.recordState = false
manager.stop() manager.stop()
}, },
//语音内容为空
showRecordEmptyTip() {
uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
},
//语音识别功能初始化 //语音识别功能初始化
initRecord() { initRecord() {
let that = this; let that = this;
manager.stop()
// 识别结束事件 // 识别结束事件
manager.onStop = (res) => { manager.onStop = (res) => {
if (res.result == '') {
that.showRecordEmptyTip()
return
}
if(that.voiceText == ''){ if(that.voiceText == ''){
that.voiceText = res.result that.voiceText = res.result
}else if(that.voiceText == null){ }else if(that.voiceText == null){
@ -465,6 +459,17 @@
// 识别错误事件 // 识别错误事件
manager.onError = (res) => { manager.onError = (res) => {
if(res.retcode == '-30011'){
that.isVoice = true
}
if(res.retcode == '-30004'){
that.isVoice = false
uni.hideToast()
uni.showToast({
title: "未识别到声音信息,请重新录入",
icon: 'none'
})
}
if (res.retcode == '-40001') { if (res.retcode == '-40001') {
uni.showToast({ uni.showToast({
title: '使用次数超限制,请联系管理员!', title: '使用次数超限制,请联系管理员!',
@ -554,7 +559,7 @@
resultList = this.combination(this.goodsList); resultList = this.combination(this.goodsList);
} }
var evalue = [] this.evalue = []
var value = [] var value = []
for (var m = 0; m < resultList.length; m++) { for (var m = 0; m < resultList.length; m++) {
var name = '' var name = ''
@ -570,7 +575,7 @@
} }
value1 += "}" value1 += "}"
value.push(value1) value.push(value1)
evalue.push(name) this.evalue.push(name)
} }
// if (jishuqi == 0) { // if (jishuqi == 0) {
@ -592,7 +597,7 @@
attributeList: value[i], attributeList: value[i],
productCount: this.temporaryNum, productCount: this.temporaryNum,
productNum: null, productNum: null,
name: evalue[i], name: this.evalue[i],
price: this.purchasePrice price: this.purchasePrice
} }
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
@ -683,8 +688,13 @@
} }
this.zPrice = this.zNum * this.purchasePrice this.zPrice = this.zNum * this.purchasePrice
}, },
clickClose(){
this.evalue = []
this.allChangeNum = 0
},
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
this.evalue = []
if (this.storageType == 0 && this.purchasePrice == 0) { if (this.storageType == 0 && this.purchasePrice == 0) {
uni.showToast({ uni.showToast({
title: "请输入实际价格!", title: "请输入实际价格!",
@ -760,12 +770,12 @@
AiOpenOrder(type){ AiOpenOrder(type){
if(type=='AI'){ if(type=='AI'){
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=khName' url: '/package1/index/peopleList?popleType=khName'
}) })
}else{ }else{
uni.setStorageSync('hangOrderType','scanCode') uni.setStorageSync('hangOrderType','scanCode')
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=khName' url: '/package1/index/peopleList?popleType=khName'
}) })
} }
}, },
@ -1094,11 +1104,35 @@
}) })
return result; return result;
}, },
obtainPrice(e,type,num){
this.linshiPrice = e.target.value
if(type=='zongjishu'){
this.allChangeNum = ''
}
},
allChange(e){ allChange(e){
if(this.linshiPrice == e.target.value){
this.allChangeNum = e.target.value
}else{
if(e.target.value == ''){
this.allChangeNum = this.linshiPrice
}else{
this.allChangeNum = e.target.value
}
}
//监听到输入框改变,给所有的都赋值 //监听到输入框改变,给所有的都赋值
if(this.isPlusAndMinus == false){ if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value) if(this.evalue.length == 0){
this.temporaryList[i].productCount = Number(this.allChangeNum)
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
this.temporaryList[i].productCount = Number(this.allChangeNum)
}
}
}
} }
} }
this.isPlusAndMinus == false this.isPlusAndMinus == false
@ -1108,20 +1142,42 @@
this.isPlusAndMinus == true this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1 //监听到点击+的操作,给所有的都+1
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
if(this.evalue.length == 0){
if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1
}else{
this.temporaryList[i].productCount++
}
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
if(this.temporaryList[i].productCount == undefined){ if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1 this.temporaryList[i].productCount = 1
}else{ }else{
this.temporaryList[i].productCount++ this.temporaryList[i].productCount++
} }
} }
}
}
}
this.temporaryChange() this.temporaryChange()
}, },
minusNum(){ minusNum(){
this.isPlusAndMinus == true this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1 //监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
if(this.evalue.length == 0){
this.temporaryList[i].productCount--
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
this.temporaryList[i].productCount-- this.temporaryList[i].productCount--
} }
}
}
}
this.temporaryChange() this.temporaryChange()
}, },
//清空语音输入的文字 //清空语音输入的文字
@ -1758,4 +1814,20 @@
color: #c0c0c0 !important; color: #c0c0c0 !important;
cursor: not-allowed; cursor: not-allowed;
} }
.mask-model{
width: 60%;
height: 100rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
background: rgba(0,0,0,0.7);
color: #eee;
padding: 5px;
border-radius: 5px;
z-index: 99;
}
</style> </style>

10
package1/AI/AIInventoryList.vue

@ -156,6 +156,7 @@
price: this.purchaseDetails[i].price, price: this.purchaseDetails[i].price,
productCount: 0, productCount: 0,
categoryId:this.purchaseDetails[i].categoryId, categoryId:this.purchaseDetails[i].categoryId,
categoryName:this.purchaseDetails[i].categoryName,
wholesalePrice: this.purchaseDetails[i].wholesalePrice, wholesalePrice: this.purchaseDetails[i].wholesalePrice,
purchasePrice:this.purchaseDetails[i].purchasePrice, purchasePrice:this.purchaseDetails[i].purchasePrice,
isNew: this.purchaseDetails[i].productId==null?true:false, isNew: this.purchaseDetails[i].productId==null?true:false,
@ -168,10 +169,10 @@
} }
for(let m=0;m<this.purchaseDetails[i].stockLogList1.length;m++){ for(let m=0;m<this.purchaseDetails[i].stockLogList1.length;m++){
let list = { let list = {
attributeList: this.purchaseDetails[i].stockLogList1[m].attributeList, attributeList: this.getAttribute(this.purchaseDetails[i].stockLogList1[m].attributeList),
productCount:this.purchaseDetails[i].stockLogList1[m].productCount || this.purchaseDetails[i].stockLogList1[m].productCounts, productCount:this.purchaseDetails[i].stockLogList1[m].productCount || this.purchaseDetails[i].stockLogList1[m].productCounts,
productNum:'', productNum:'',
name: this.sliceMsg(this.purchaseDetails[i].stockLogList1[m].attributeList), name: this.sliceMsg(this.getAttribute(this.purchaseDetails[i].stockLogList1[m].attributeList)),
price: this.purchaseDetails[i].stockLogList1[m].purchasePrice price: this.purchaseDetails[i].stockLogList1[m].purchasePrice
} }
data.productCount += this.purchaseDetails[i].stockLogList1[m].productCount data.productCount += this.purchaseDetails[i].stockLogList1[m].productCount
@ -187,6 +188,11 @@
}, 300) }, 300)
}, },
getAttribute(str){
str = str.replace(/"色"(?![^{]*": *"色")/g, '"均色"');
str = str.replace(/"码"(?![^{]*": *"码")/g, '"均码"');
return str
},
goInventory(){ goInventory(){
uni.setStorageSync('carList1', this.carList1) uni.setStorageSync('carList1', this.carList1)
uni.navigateTo({ uni.navigateTo({

76
package1/AI/AIPicture.vue

@ -49,7 +49,7 @@
</view> </view>
<image show-menu-by-longpress :src="item.ocrPicture" @load='loadImg' @tap="showImage(item.ocrPicture)"></image> <image show-menu-by-longpress :src="item.ocrPicture" @load='loadImg' @tap="showImage(item.ocrPicture)"></image>
<uni-easyinput type='number' prefixIcon="compose" v-model='item.count' <uni-easyinput type='number' prefixIcon="compose" v-model='item.count'
placeholder="请输入规格数量"></uni-easyinput> placeholder="请输入规格数量" @blur="numChange('zhu',item,index)"></uni-easyinput>
</view> </view>
<view v-for="(items,indexs) in item.children" :key="indexs" <view v-for="(items,indexs) in item.children" :key="indexs"
style="width: 200rpx;height: 280rpx;position: relative;background: #fff;margin-left: 20rpx;border-radius: 10px;"> style="width: 200rpx;height: 280rpx;position: relative;background: #fff;margin-left: 20rpx;border-radius: 10px;">
@ -58,7 +58,7 @@
</view> </view>
<image show-menu-by-longpress :src="items.ocrPicture" @load='loadImg' @tap="showImage(items.ocrPicture)" <image show-menu-by-longpress :src="items.ocrPicture" @load='loadImg' @tap="showImage(items.ocrPicture)"
style="width: 200rpx;height: 200rpx;padding: 5px;"></image> style="width: 200rpx;height: 200rpx;padding: 5px;"></image>
<uni-easyinput type='number' v-model='items.count' placeholder="子图规格数量"></uni-easyinput> <uni-easyinput type='number' v-model='items.count' placeholder="子图规格数量" @blur="numChange('zi',item,index,items,indexs)"></uni-easyinput>
</view> </view>
<view @tap="addSonImg(item.id)" <view @tap="addSonImg(item.id)"
style="width: 200rpx;height: 219rpx;background: rgba(255,255,255,0.4);margin: 0 20rpx;border-radius: 10px;font-size: 24rpx;color: #777;text-align: center;"> style="width: 200rpx;height: 219rpx;background: rgba(255,255,255,0.4);margin: 0 20rpx;border-radius: 10px;font-size: 24rpx;color: #777;text-align: center;">
@ -113,13 +113,13 @@
<text style="display:inline-block;width:100rpx;font-size:22rpx;"> <text style="display:inline-block;width:100rpx;font-size:22rpx;">
采购价: 采购价:
</text> </text>
<input v-model="price" type="digit" placeholder="请输入价格" style="display: flex;height: 80rpx;width: 200rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;"> <input v-model="price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" type="digit" placeholder="请输入价格" style="display: flex;height: 80rpx;width: 200rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view> </view>
<view style="padding-left: 20rpx;display: flex;height: 80rpx;width: 50%;line-height: 80rpx;margin-top: 20rpx;float: left;"> <view style="padding-left: 20rpx;display: flex;height: 80rpx;width: 50%;line-height: 80rpx;margin-top: 20rpx;float: left;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;"> <text style="display:inline-block;width:100rpx;font-size:22rpx;">
数量: 数量:
</text> </text>
<input v-model="productCount" type="digit" placeholder="请输入数量" style="display: flex;height: 80rpx;width: 200rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;"> <input v-model="productCount" @focus="obtainPrice($event,'productCount')" @blur="changessPrice($event)" type="digit" placeholder="请输入数量" style="display: flex;height: 80rpx;width: 200rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view> </view>
<view style="padding-left: 40rpx;display: flex;height: 80rpx;width: 50%;line-height: 80rpx;margin-top: 20rpx;float: left;"> <view style="padding-left: 40rpx;display: flex;height: 80rpx;width: 50%;line-height: 80rpx;margin-top: 20rpx;float: left;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;"> <text style="display:inline-block;width:100rpx;font-size:22rpx;">
@ -167,8 +167,8 @@
</view> </view>
</uni-popup> </uni-popup>
<view v-if="isTake" style="position: fixed;width: 100%;height: 100%;z-index: 100;top: 0;"> <view v-if="isTake" style="position: fixed;width: 100%;height: 100%;z-index: 100;top: 0;">
<camera device-position="back" flash="off" style="width: 100%; height: 100%;"></camera> <camera device-position="back" output-dimension='max' @initdone='showBtn' flash="off" style="width: 100%; height: 100%;"></camera>
<view style="width: 100%;height: 120rpx;position: fixed;bottom:200rpx;"> <view style="width: 100%;height: 120rpx;position: fixed;bottom:200rpx;" v-if="isShow == true">
<view @tap="takePhoto" style="width: 120rpx;height: 120rpx;border-radius: 120rpx;background: #fff;margin: 0 auto;border: 2px solid #eee;"> <view @tap="takePhoto" style="width: 120rpx;height: 120rpx;border-radius: 120rpx;background: #fff;margin: 0 auto;border: 2px solid #eee;">
<view style="width: 116rpx;height: 116rpx;border-radius: 116rpx;background: #fff;margin: 0 auto;border: 1px solid #fff;"></view> <view style="width: 116rpx;height: 116rpx;border-radius: 116rpx;background: #fff;margin: 0 auto;border: 1px solid #fff;"></view>
</view> </view>
@ -191,6 +191,7 @@
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg', 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg',
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg' 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg'
], ],
isShow:false,
focus:false, focus:false,
purchaseOcrPictureList: [], purchaseOcrPictureList: [],
parentPicturePath: '', parentPicturePath: '',
@ -294,6 +295,30 @@
// this.focus = true // this.focus = true
// this.$refs.inputText.focus(); // this.$refs.inputText.focus();
}, },
numChange(type,item,index,items,indexs){
if(type == 'zhu'){
if(item.count > 20){
uni.showModal({
title: '提示',
showCancel:false,
content: '规格数不能超过20,例:“黑色M码”这种为一个规格,“黑色S码”或“白色L码”则为另外的规格,请以此种颜色+尺码组合为一种的方式来计数',
success: function (res) {}
});
this.purchaseOcrPictureList[index].count = ''
}
}else if(type == 'zi'){
if(items.count > 20){
uni.showModal({
title: '提示',
showCancel:false,
content: '规格数不能超过20,例:“黑色M码”这种为一个规格,“黑色S码”或“白色L码”则为另外的规格,请以此种颜色+尺码组合为一种的方式来计数',
success: function (res) {}
});
this.purchaseOcrPictureList[index].children[indexs].count = ''
}
}
},
shurukuang(){ shurukuang(){
if(this.name == 'productSn'){ if(this.name == 'productSn'){
this.productSn = this.nameText this.productSn = this.nameText
@ -389,6 +414,10 @@
} }
}); });
}, },
showBtn(){
this.isShow = true
uni.hideLoading();
},
async upLoadImg(type) { async upLoadImg(type) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
@ -478,6 +507,41 @@
} }
}); });
},
obtainPrice(e,type,num){
console.log("获得焦点")
this.linshiPrice = e.target.value
if(type=='price'){
this.price = ''
}else if(type=='productCount'){
this.productCount = ''
}
},
changessPrice(e,type) {
if(type == 'price'){
if(this.linshiPrice == e.target.value){
this.price = e.target.value
}else{
if(e.target.value == ''){
this.price = this.linshiPrice
}else{
this.price = e.target.value
}
}
}else{
if(this.linshiPrice == e.target.value){
this.productCount = e.target.value
}else{
if(e.target.value == ''){
this.productCount = this.linshiPrice
}else{
this.productCount = e.target.value
}
}
}
}, },
cameraUpload(){ cameraUpload(){
let that = this; let that = this;

13
package1/AI/AiChangeGoods.vue

@ -20,14 +20,17 @@
<view class="content-right"> <view class="content-right">
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="backPrevPage(item)"> <view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="backPrevPage(item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 --> <!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0" <!-- <view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view> @tap.stop="clickMask(item)"></view> -->
<view class="box-left"> <view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture"> <img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view> <view class="noPic" v-else>暂无图片</view>
</view> </view>
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{item.productName}}</view> <view class="box-right-name">
{{item.productName}}
<text style="color: red;" v-if="item.delFlag == 0">(已下架)</text>
</view>
<view class="box-right-num">{{item.productSn}}</view> <view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price"> <view class="box-right-price">
<view class="price-box"> <view class="price-box">
@ -51,8 +54,8 @@
</view> </view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="backPrevPage(item)"> <view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="backPrevPage(item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 --> <!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0" <!-- <view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view> @tap.stop="clickMask(item)"></view> -->
<view class="box-left"> <view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture"> <img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view> <view class="noPic" v-else>暂无图片</view>

113
package1/AI/AiChat.vue

@ -85,6 +85,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<view class="mask-model" v-if="isNoVoice">貌似没有检测到您上次的语音录入信息,正在反复识别中</view>
</view> </view>
</template> </template>
@ -96,6 +97,7 @@
data() { data() {
return { return {
isVoice:true, isVoice:true,
isNoVoice:false,
height:0, height:0,
khName:{}, khName:{},
msgList:[], msgList:[],
@ -133,8 +135,17 @@
close(){ close(){
this.$refs.popup.close() this.$refs.popup.close()
}, },
//正则匹配处理“2十9”等情况
convertStringCorrectly(str) {
var regexForSingleTen = /(\d+)十(?!\d)/g;
var regexForFollowedByDigit = /(\d+)十(?=\d)/g;
var step1Result = str.replace(regexForSingleTen, '$10');
var finalResult = step1Result.replace(regexForFollowedByDigit, '$1');
return finalResult;
},
spliceMsg(res){ spliceMsg(res){
let regex = /嗯|啊|儿|各|阿|恩/g; let regex = /嗯|啊|儿|阿|恩/g;
return res.replace(regex, '') return res.replace(regex, '')
}, },
convertChineseToArabic(str) { convertChineseToArabic(str) {
@ -150,7 +161,30 @@
}, },
inputSaveText(){ inputSaveText(){
let convertedStr = this.convertChineseToArabic(this.editText); let convertedStr = this.convertChineseToArabic(this.editText);
let getMsg = this.spliceMsg(convertedStr) if(convertedStr.indexOf('点') != -1){
convertedStr = this.replaceCharAfterNumber(convertedStr,'点','.')
}
if(convertedStr.indexOf('货号,') != -1){
convertedStr = convertedStr.replace(/货号,/g,'货号')
}
if(convertedStr.indexOf('货号') != -1){
convertedStr = convertedStr.replace(/货号/g,'货号:')
}
if(convertedStr.indexOf(',数量') != -1){
convertedStr = convertedStr.replace(/,数量/g,'数量')
}
if(convertedStr.indexOf('数量,') != -1){
convertedStr = convertedStr.replace(/数量,/g,'数量')
}
if(convertedStr.indexOf('数量') != -1){
convertedStr = convertedStr.replace(/数量/g,',数量:')
}
convertedStr = this.convertStringCorrectly(convertedStr)
convertedStr = this.spliceMsg(convertedStr)
if(convertedStr.indexOf(',') == 0){
convertedStr = convertedStr.substr(1)
}
let getMsg = convertedStr
if(this.editText == ''){ if(this.editText == ''){
return; return;
} }
@ -162,35 +196,62 @@
}, },
//按住语音识别,开始 //按住语音识别,开始
kaishi() { kaishi() {
if(this.isNoVoice == false){
this.recordState = true this.recordState = true
uni.vibrateShort();
manager.start({ manager.start({
duration: 60000, duration: 60000,
lang: "zh_CN" lang: "zh_CN"
}); });
}
}, },
//松开语音识别,结束 //松开语音识别,结束
jieshu() { jieshu() {
this.recordState = false this.recordState = false
manager.stop() manager.stop()
}, },
replaceCharAfterNumber(str, charToFind, charToReplace) {
// 正则表达式匹配字符前是否有数字,并且该字符与charToFind相同
const regex = new RegExp(`\\d${charToFind}`, 'g');
// 使用replace方法进行替换
return str.replace(regex, (match) => {
// 将匹配到的字符中的指定字符替换为charToReplace
return match.replace(charToFind, charToReplace);
});
},
//语音识别功能初始化 //语音识别功能初始化
initRecord() { initRecord() {
let that = this; let that = this;
manager.stop() manager.stop()
// 识别结束事件 // 识别结束事件
manager.onStop = (res) => { manager.onStop = (res) => {
if (res.result == '') {
uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
return
}
let convertedStr = this.convertChineseToArabic(res.result); let convertedStr = this.convertChineseToArabic(res.result);
if(convertedStr.indexOf('点') != -1){
convertedStr = that.replaceCharAfterNumber(convertedStr,'点','.')
}
if(convertedStr.indexOf('货号,') != -1){
convertedStr = convertedStr.replace(/货号,/g,'货号')
}
if(convertedStr.indexOf('货号') != -1){
convertedStr = convertedStr.replace(/货号/g,'货号:')
}
if(convertedStr.indexOf(',数量') != -1){
convertedStr = convertedStr.replace(/,数量/g,'数量')
}
if(convertedStr.indexOf('数量,') != -1){
convertedStr = convertedStr.replace(/数量,/g,'数量')
}
if(convertedStr.indexOf('数量') != -1){
convertedStr = convertedStr.replace(/数量/g,',数量:')
}
convertedStr = this.convertStringCorrectly(convertedStr)
convertedStr = this.spliceMsg(convertedStr)
if(convertedStr.indexOf(',') == 0){
console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
}
let data = { let data = {
text:this.spliceMsg(convertedStr) text:convertedStr
} }
that.msgList.push(data) that.msgList.push(data)
that.$forceUpdate() that.$forceUpdate()
@ -199,6 +260,18 @@
// 识别错误事件 // 识别错误事件
manager.onError = (res) => { manager.onError = (res) => {
if(res.retcode == '-30011'){
that.isNoVoice = true
}
if(res.retcode == '-30004'){
// uni.hideLoading()
that.isNoVoice = false
uni.hideToast()
uni.showToast({
title: "未识别到声音信息,请重新录入",
icon: 'none'
})
}
if (res.retcode == '-40001') { if (res.retcode == '-40001') {
uni.showToast({ uni.showToast({
title: '使用次数超限制,请联系管理员!', title: '使用次数超限制,请联系管理员!',
@ -406,4 +479,20 @@
line-height: 80rpx; line-height: 80rpx;
margin-top: 50rpx; margin-top: 50rpx;
} }
.mask-model{
width: 60%;
height: 100rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
background: rgba(0,0,0,0.7);
color: #eee;
padding: 5px;
border-radius: 5px;
z-index: 99;
}
</style> </style>

3255
package1/AI/addAiList.vue

File diff suppressed because it is too large

488
package1/AI/voiceInventory.vue

@ -69,15 +69,15 @@
<input type="text" v-else disabled :value="value[1].productSn" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;"> <input type="text" v-else disabled :value="value[1].productSn" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
</view> </view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;" v-if="value[1].isNew"> <view style="display: flex;height: 55rpx;line-height: 55rpx;" v-if="value[1].isNew">
分类: <text style="color: #777;padding-left: 20rpx;">{{value[1].categoryName}}</text> 分类: <text style="color: #777;padding-left: 20rpx;">{{value[1].categoryName==null?'':value[1].categoryName}}</text>
<uni-icons type="compose" color="#777" size='25' @tap="toggle('typePopup',value[0])"></uni-icons> <uni-icons type="compose" color="#777" size='25' @tap="toggle('typePopup',value[0])"></uni-icons>
</view> </view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> <view v-if='userType==0' style="display: flex;height: 55rpx;line-height: 55rpx;">
单价:<input type="digit" v-model="value[1].purchasePrice" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 300rpx;padding-left: 20rpx;"> 单价:<input type="digit" v-model="value[1].purchasePrice" @blur="clickCollapse($event,value[0])" @focus="obtainPrice($event,'danjia',value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 300rpx;padding-left: 20rpx;">
</view> </view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> <view style="display: flex;height: 55rpx;line-height: 55rpx;">
批发价: <input type="digit" @blur="PriceAndWho($event,value[0],'pi')" v-model="value[1].wholesalePrice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;"> 批发价: <input type="digit" @blur="PriceAndWho($event,value[0],'pi')" @focus="obtainPrice($event,'pifa',value[0])" v-model="value[1].wholesalePrice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
零售价:<input type="digit" @blur="PriceAndWho($event,value[0])" v-model="value[1].lsprice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;"> 零售价:<input type="digit" @blur="PriceAndWho($event,value[0])" @focus="obtainPrice($event,'lingshou',value[0])" v-model="value[1].lsprice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
</view> </view>
<view @tap="AiAddSpec(value[1])" style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 130rpx;right: 0px;line-height: 54rpx;"> <view @tap="AiAddSpec(value[1])" style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 130rpx;right: 0px;line-height: 54rpx;">
添加规格 添加规格
@ -109,19 +109,19 @@
</view> </view>
<view class="content-box" style="margin-bottom:110rpx;"> <view class="content-box" style="margin-bottom:110rpx;">
<view class="price-box-list"> <view class="price-box-list">
<view class="content-list"> <view class="content-list" v-if="userType == 0">
<view class="list-name">应付金额</view> <view class="list-name">应付金额</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请输入应付金额" v-model="shouldPay" @blur="changessPrice($event)"> <input type="text" placeholder="请输入应付金额" v-model="shouldPay" @focus="obtainPrice($event,'shouldPay')" @blur="changessPrice($event)">
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list" v-if="userType == 0">
<view class="list-name">已付金额</view> <view class="list-name">已付金额</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请输入已付金额" v-model="alreadyPay" @blur="changePay($event)"> <input type="text" placeholder="请输入已付金额" v-model="alreadyPay" @focus="obtainPrice($event,'alreadyPay')" @blur="changePay($event)">
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list" v-if="userType == 0">
<view class="list-name">欠款</view> <view class="list-name">欠款</view>
<view class="list-val"> <view class="list-val">
<input type="text" v-model="noPay" disabled> <input type="text" v-model="noPay" disabled>
@ -146,7 +146,7 @@
<view class="bottom-box"> <view class="bottom-box">
<view class="bottom-left"> <view class="bottom-left">
<text>合计:{{totalAmount}}</text> <text>合计:{{totalAmount}}</text>
<text style="color: #ffa200;">¥{{shouldPay}}</text> <text style="color: #ffa200;" v-if="userType == 0">¥{{shouldPay}}</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<button class="bottom-btn" @tap='inventorySubmit'>入库</button> <button class="bottom-btn" @tap='inventorySubmit'>入库</button>
@ -154,7 +154,7 @@
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
<view> <view>
<uni-popup ref="shopPopup" background-color="#fff" @change="change"> <uni-popup ref="shopPopup" background-color="#fff" @change="clickClose">
<view class="shop-popup-content"> <view class="shop-popup-content">
<view class="shop-popup-title"> <view class="shop-popup-title">
<view class="shop-popup-title-left"> <view class="shop-popup-title-left">
@ -198,7 +198,7 @@
<view @tap="minusNum" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;"> <view @tap="minusNum" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">-</text> <text class="zuni-numbox--text">-</text>
</view> </view>
<input v-model="allChangeNum" @blur="allChange" class="zuni-numbox__value" type="number" /> <input v-model="allChangeNum" @blur="allChange" @focus="obtainPrice($event,'zongjishu')" class="zuni-numbox__value" type="number" />
<view @tap="plusNum" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;"> <view @tap="plusNum" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">+</text> <text class="zuni-numbox--text">+</text>
</view> </view>
@ -375,6 +375,7 @@
<img src="/static/images/maikefeng.png" alt=""> <img src="/static/images/maikefeng.png" alt="">
<view class="voice-text">语音识别中...</view> <view class="voice-text">语音识别中...</view>
</view> </view>
<view class="mask-model" v-if="isVoice">貌似没有检测到您上次的语音录入信息,正在反复识别中</view>
</view> </view>
</template> </template>
@ -390,6 +391,7 @@
computed: mapState(['shopName']), computed: mapState(['shopName']),
data() { data() {
return { return {
isVoice:false,
allChangeNum:0, allChangeNum:0,
voiceText:'', voiceText:'',
khName: [], khName: [],
@ -400,6 +402,7 @@
alreadyPay: '', alreadyPay: '',
realAmount: 0, realAmount: 0,
shouldPay: '', shouldPay: '',
userType:'',
totalAmount: 0, totalAmount: 0,
index: '', index: '',
index1: '', index1: '',
@ -423,6 +426,7 @@
dataObj: new Map(), dataObj: new Map(),
isPlusAndMinus:false, isPlusAndMinus:false,
indexList:[], indexList:[],
evalue:[],
attributeValue:[], attributeValue:[],
specifications:'', specifications:'',
currentAnchor: '', currentAnchor: '',
@ -495,21 +499,17 @@
this.merge = 0 this.merge = 0
return; return;
} }
if(this.carList1 == ''){
console.log('回来')
}
if(uni.getStorageSync('carList1') != ''){ if(uni.getStorageSync('carList1') != ''){
this.carList1 = uni.getStorageSync('carList1') this.carList1 = uni.getStorageSync('carList1')
}else{ }else{
this.carList1 = this.carList1 this.carList1 = this.carList1
} }
console.log('拿数据',this.carList1)
this.khName = JSON.parse(JSON.stringify(this.khName)) || '' this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
if (this.carList.size == 0) { //当前页没有数据 if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) { for (let i = 0; i < this.carList1.length; i++) {
let obj = { let obj = {
purchasePrice: this.carList1[i].purchasePrice || 0, //进货价 purchasePrice: this.userType == 0?this.carList1[i].purchasePrice:'', //进货价
price1: 0, price1: 0,
price:this.carList1[i].price, price:this.carList1[i].price,
productCount: 0, productCount: 0,
@ -518,7 +518,7 @@
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId, productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
productName: this.carList1[i].productName, productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0, wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName:'', categoryName:this.carList1[i].categoryName,
categoryId:this.carList1[i].categoryId, categoryId:this.carList1[i].categoryId,
lsprice: this.carList1[i].price || 0, lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture, productPicture: this.carList1[i].productPicture,
@ -526,23 +526,6 @@
stockLogList: new Map(), stockLogList: new Map(),
stockLogList1: [] stockLogList1: []
} }
// let attrMap = new Map()
// let newSaleDetailDTOList = []
// for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){
// if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){
// let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
// let trueCount = hasCount.split('-')[0]
// let lastConut = Number(trueCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
// newSaleDetailDTOList[hasCount.split('-')[1]].productCount = lastConut
// }else{
// newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
// attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,item.saleDetailDTOList[i].stockLogList1[m].productCount+'-'+m)
// }
// }
// obj.saleDetailQueryDTO = newSaleDetailDTOList
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
let productCount = this.carList1[i].saleDetailQueryDTO[m].productCount let productCount = this.carList1[i].saleDetailQueryDTO[m].productCount
if(obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) ==true){ if(obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) ==true){
@ -592,7 +575,7 @@
} }
} else { //商品不同 } else { //商品不同
let obj = { let obj = {
purchasePrice: this.carList1[i].purchasePrice || 0, //进货价 purchasePrice: this.userType == 0?this.carList1[i].purchasePrice:'', //进货价
price1: 0, price1: 0,
price:this.carList1[i].price, price:this.carList1[i].price,
productCount: 0, productCount: 0,
@ -601,7 +584,7 @@
isNew:this.carList1[i].isNew, isNew:this.carList1[i].isNew,
productName: this.carList1[i].productName, productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0, wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName:'', categoryName:this.carList1[i].categoryName,
categoryId:this.carList1[i].categoryId, categoryId:this.carList1[i].categoryId,
lsprice: this.carList1[i].price || 0, lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture, productPicture: this.carList1[i].productPicture,
@ -650,14 +633,14 @@
console.log(this.carList) console.log(this.carList)
}, },
onLoad(options) { onLoad(options) {
this.userType=uni.getStorageSync('type')
}, },
methods: { methods: {
AiVoice(){ AiVoice(){
if (this.carList.size == 0) { //当前页没有数据 if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) { for (let i = 0; i < this.carList1.length; i++) {
let obj = { let obj = {
purchasePrice: this.carList1[i].purchasePrice || 0, //进货价 purchasePrice: this.userType == 0?this.carList1[i].purchasePrice:'', //进货价
price1: 0, price1: 0,
price:this.carList1[i].price, price:this.carList1[i].price,
productCount: 0, productCount: 0,
@ -666,7 +649,7 @@
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId, productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
productName: this.carList1[i].productName, productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0, wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName:'', categoryName:this.carList1[i].categoryName,
categoryId:this.carList1[i].categoryId, categoryId:this.carList1[i].categoryId,
lsprice: this.carList1[i].price || 0, lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture, productPicture: this.carList1[i].productPicture,
@ -741,7 +724,7 @@
} }
} else { //商品不同 } else { //商品不同
let obj = { let obj = {
purchasePrice: this.carList1[i].purchasePrice || 0, //进货价 purchasePrice: this.userType == 0?this.carList1[i].purchasePrice:'', //进货价
price1: 0, price1: 0,
price:this.carList1[i].price, price:this.carList1[i].price,
productCount: 0, productCount: 0,
@ -750,7 +733,7 @@
isNew:this.carList1[i].isNew, isNew:this.carList1[i].isNew,
productName: this.carList1[i].productName, productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0, wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName:'', categoryName:this.carList1[i].categoryName,
categoryId:this.carList1[i].categoryId, categoryId:this.carList1[i].categoryId,
lsprice: this.carList1[i].price || 0, lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture, productPicture: this.carList1[i].productPicture,
@ -941,8 +924,56 @@
}, },
//确认语音输入的内容 //确认语音输入的内容
setDetail(e) { setDetail(e) {
if(this.voiceText ==''){
this.tui.toast('识别内容不能为空')
return
}
let convertedStr = this.convertChineseToArabic(this.voiceText); let convertedStr = this.convertChineseToArabic(this.voiceText);
this.getMsg = this.spliceMsg(convertedStr) if(convertedStr.indexOf('点') != -1){
convertedStr = this.replaceCharAfterNumber(convertedStr,'点','.')
}
if(convertedStr.indexOf(',名称') != -1){
convertedStr = convertedStr.replace(/,名称/g,'名称')
}
if(convertedStr.indexOf('名称,') != -1){
convertedStr = convertedStr.replace(/名称,/g,'名称')
}
if(convertedStr.indexOf('名称') != -1){
convertedStr = convertedStr.replace(/名称/g,',名称:')
}
if(convertedStr.indexOf(',单价') != -1){
convertedStr = convertedStr.replace(/,单价/g,'单价')
}
if(convertedStr.indexOf('单价,') != -1){
convertedStr = convertedStr.replace(/单价,/g,'单价')
}
if(convertedStr.indexOf('单价') != -1){
convertedStr = convertedStr.replace(/单价/g,',单价:')
}
if(convertedStr.indexOf(',数量') != -1){
convertedStr = convertedStr.replace(/,数量/g,'数量')
}
if(convertedStr.indexOf('数量,') != -1){
convertedStr = convertedStr.replace(/数量,/g,'数量')
}
if(convertedStr.indexOf('数量') != -1){
convertedStr = convertedStr.replace(/数量/g,',数量:')
}
if(convertedStr.indexOf('货号,') != -1){
convertedStr = convertedStr.replace(/货号,/g,'货号')
}
if(convertedStr.indexOf('货号') != -1){
convertedStr = convertedStr.replace(/货号/g,'货号:')
}
//名称111,白色M码1一件
convertedStr = this.convertStringCorrectly(convertedStr)
convertedStr = this.spliceMsg(convertedStr)
if(convertedStr.indexOf(',') == 0){
console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
console.log('位置',convertedStr)
}
this.getMsg = convertedStr
this.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase", "POST", { this.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase", "POST", {
questionMsg:this.getMsg questionMsg:this.getMsg
}, false, true).then((res) => { }, false, true).then((res) => {
@ -954,10 +985,11 @@
// uni.setStorageSync('AiInventoryId', res.result.purchase.id) // uni.setStorageSync('AiInventoryId', res.result.purchase.id)
for(let i=0;i<purchaseDetails.length;i++){ for(let i=0;i<purchaseDetails.length;i++){
let data = { let data = {
id: purchaseDetails[i].productId?purchaseDetails[i].productId:purchaseDetails[i].id, id: "",
price: purchaseDetails[i].price, price: purchaseDetails[i].price,
productCount: 0, productCount: 0,
categoryId:purchaseDetails[i].categoryId, categoryId:purchaseDetails[i].categoryId,
categoryName:purchaseDetails[i].categoryName,
wholesalePrice: purchaseDetails[i].wholesalePrice, wholesalePrice: purchaseDetails[i].wholesalePrice,
purchasePrice:purchaseDetails[i].purchasePrice, purchasePrice:purchaseDetails[i].purchasePrice,
isNew: purchaseDetails[i].productId==null?true:false, isNew: purchaseDetails[i].productId==null?true:false,
@ -968,12 +1000,20 @@
supplierName: purchaseDetails[i].supplierName, supplierName: purchaseDetails[i].supplierName,
saleDetailQueryDTO: [] saleDetailQueryDTO: []
} }
if(purchaseDetails[i].productId){
data.id = purchaseDetails[i].productId
}else if(purchaseDetails[i].productSn == '' || purchaseDetails[i].productSn == null || purchaseDetails[i].productSn == '货号'){
data.id = purchaseDetails[i].productName
}else if(purchaseDetails[i].productSn){
data.id = purchaseDetails[i].productSn
}
console.log('货号',data)
for(let m=0;m<purchaseDetails[i].stockLogList1.length;m++){ for(let m=0;m<purchaseDetails[i].stockLogList1.length;m++){
let list = { let list = {
attributeList: purchaseDetails[i].stockLogList1[m].attributeList, attributeList: this.getAttribute(purchaseDetails[i].stockLogList1[m].attributeList),
productCount:purchaseDetails[i].stockLogList1[m].productCount || purchaseDetails[i].stockLogList1[m].productCounts, productCount:purchaseDetails[i].stockLogList1[m].productCount || purchaseDetails[i].stockLogList1[m].productCounts,
productNum:'', productNum:'',
name: this.sliceMsg(purchaseDetails[i].stockLogList1[m].attributeList), name: this.sliceMsg(this.getAttribute(purchaseDetails[i].stockLogList1[m].attributeList)),
price: purchaseDetails[i].stockLogList1[m].purchasePrice price: purchaseDetails[i].stockLogList1[m].purchasePrice
} }
data.productCount += purchaseDetails[i].stockLogList1[m].productCount data.productCount += purchaseDetails[i].stockLogList1[m].productCount
@ -1213,10 +1253,29 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
allChange(e){ allChange(e){
if(this.linshiPrice == e.target.value){
this.allChangeNum = e.target.value
}else{
if(e.target.value == ''){
this.allChangeNum = this.linshiPrice
}else{
this.allChangeNum = e.target.value
}
}
//监听到输入框改变,给所有的都赋值 //监听到输入框改变,给所有的都赋值
if(this.isPlusAndMinus == false){ if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value) if(this.evalue.length == 0){
this.temporaryList[i].productCount = Number(this.allChangeNum)
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
this.temporaryList[i].productCount = Number(this.allChangeNum)
}
}
}
for(var m=0;m<this.pageOldTemList.length;m++){ for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
@ -1232,15 +1291,48 @@
this.isPlusAndMinus == false this.isPlusAndMinus == false
this.temporaryChange() this.temporaryChange()
}, },
obtainPrice(e,type,num){
console.log("获得焦点",this.carList)
console.log("获得焦点",e.target.value)
this.linshiPrice = e.target.value
if(type=='danjia'){
this.carList.get(num).purchasePrice = ''
}else if(type=='pifa'){
this.carList.get(num).wholesalePrice = ''
}else if(type=='lingshou'){
this.carList.get(num).lsprice = ''
this.$forceUpdate()
}else if(type=='zongjishu'){
this.allChangeNum = ''
}else if(type=='shouldPay'){
this.shouldPay = ''
}else if(type=='alreadyPay'){
this.alreadyPay = ''
}
this.$forceUpdate()
},
plusNum(){ plusNum(){
this.isPlusAndMinus == true this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1 //监听到点击+的操作,给所有的都+1
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
if(this.evalue.length == 0){
if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1
}else{
this.temporaryList[i].productCount++
}
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
if(this.temporaryList[i].productCount == undefined){ if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1 this.temporaryList[i].productCount = 1
}else{ }else{
this.temporaryList[i].productCount++ this.temporaryList[i].productCount++
} }
}
}
}
for(var m=0;m<this.pageOldTemList.length;m++){ for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
@ -1258,7 +1350,16 @@
this.isPlusAndMinus == true this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1 //监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){ for(var i=0;i<this.temporaryList.length;i++){
if(this.evalue.length == 0){
this.temporaryList[i].productCount--
}else{
for(var j=0;j<this.evalue.length;j++){
if(this.evalue[j] == this.temporaryList[i].name){
this.temporaryList[i].productCount-- this.temporaryList[i].productCount--
}
}
}
for(var m=0;m<this.pageOldTemList.length;m++){ for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
@ -1301,7 +1402,7 @@
resultList = this.combination(this.goodsList); resultList = this.combination(this.goodsList);
} }
var evalue = [] this.evalue = []
var value = [] var value = []
for (var m = 0; m < resultList.length; m++) { for (var m = 0; m < resultList.length; m++) {
var name = '' var name = ''
@ -1317,7 +1418,7 @@
} }
value1 += "}" value1 += "}"
value.push(value1) value.push(value1)
evalue.push(name) this.evalue.push(name)
} }
if (jishuqi == 0) { if (jishuqi == 0) {
@ -1330,7 +1431,7 @@
attributeList: value[i], attributeList: value[i],
productCount: this.temporaryNum, productCount: this.temporaryNum,
productNum: this.productNum, productNum: this.productNum,
name: evalue[i], name: this.evalue[i],
price: this.purchasePrice price: this.purchasePrice
} }
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
@ -1348,7 +1449,7 @@
attributeList: value[i], attributeList: value[i],
productCount: newProductCount || 0, productCount: newProductCount || 0,
productNum: this.productNum, productNum: this.productNum,
name: evalue[i], name: this.evalue[i],
price: this.purchasePrice price: this.purchasePrice
} }
@ -1444,24 +1545,33 @@
}, },
//按住语音识别,开始 //按住语音识别,开始
kaishi() { kaishi() {
if(this.isVoice == false){
this.recordState = true this.recordState = true
uni.vibrateShort(); uni.vibrateShort();
manager.start({ manager.start({
duration: 60000, duration: 60000,
lang: "zh_CN" lang: "zh_CN"
}); });
}
}, },
//松开语音识别,结束 //松开语音识别,结束
jieshu() { jieshu() {
this.recordState = false this.recordState = false
manager.stop() manager.stop()
}, },
//语音内容为空 isCharPrecededByNumber(str, char) {
showRecordEmptyTip() { const regex = new RegExp(`\\d${char}`, 'g');
uni.showToast({ return regex.test(str);
title: "请重新说一遍", },
icon: 'error'
}) replaceCharAfterNumber(str, charToFind, charToReplace) {
// 正则表达式匹配字符前是否有数字,并且该字符与charToFind相同
const regex = new RegExp(`\\d${charToFind}`, 'g');
// 使用replace方法进行替换
return str.replace(regex, (match) => {
// 将匹配到的字符中的指定字符替换为charToReplace
return match.replace(charToFind, charToReplace);
});
}, },
//语音识别功能初始化 //语音识别功能初始化
initRecord() { initRecord() {
@ -1469,11 +1579,51 @@
manager.stop() manager.stop()
// 识别结束事件 // 识别结束事件
manager.onStop = (res) => { manager.onStop = (res) => {
if (res.result == '') {
that.showRecordEmptyTip()
return
}
let convertedStr = this.spliceMsg(this.convertChineseToArabic(res.result)); let convertedStr = this.spliceMsg(this.convertChineseToArabic(res.result));
console.log(convertedStr)
if(convertedStr.indexOf('点') != -1){
convertedStr = that.replaceCharAfterNumber(convertedStr,'点','.')
}
if(convertedStr.indexOf(',名称') != -1){
convertedStr = convertedStr.replace(/,名称/g,'名称')
}
if(convertedStr.indexOf('名称,') != -1){
convertedStr = convertedStr.replace(/名称,/g,'名称')
}
if(convertedStr.indexOf('名称') != -1){
convertedStr = convertedStr.replace(/名称/g,',名称:')
}
if(convertedStr.indexOf(',单价') != -1){
convertedStr = convertedStr.replace(/,单价/g,'单价')
}
if(convertedStr.indexOf('单价,') != -1){
convertedStr = convertedStr.replace(/单价,/g,'单价')
}
if(convertedStr.indexOf('单价') != -1){
convertedStr = convertedStr.replace(/单价/g,',单价:')
}
if(convertedStr.indexOf(',数量') != -1){
convertedStr = convertedStr.replace(/,数量/g,'数量')
}
if(convertedStr.indexOf('数量,') != -1){
convertedStr = convertedStr.replace(/数量,/g,'数量')
}
if(convertedStr.indexOf('数量') != -1){
convertedStr = convertedStr.replace(/数量/g,',数量:')
}
if(convertedStr.indexOf('货号,') != -1){
convertedStr = convertedStr.replace(/货号,/g,'货号')
}
if(convertedStr.indexOf('货号') != -1){
convertedStr = convertedStr.replace(/货号/g,'货号:')
}
convertedStr = this.convertStringCorrectly(convertedStr)
if(convertedStr.indexOf(',') == 0){
console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
}
if(that.voiceText == '' || that.voiceText == null){ if(that.voiceText == '' || that.voiceText == null){
that.voiceText = convertedStr that.voiceText = convertedStr
}else{ }else{
@ -1483,6 +1633,18 @@
// 识别错误事件 // 识别错误事件
manager.onError = (res) => { manager.onError = (res) => {
if(res.retcode == '-30011'){
that.isVoice = true
}
if(res.retcode == '-30004'){
// uni.hideLoading()
that.isVoice = false
uni.hideToast()
uni.showToast({
title: "未识别到声音信息,请重新录入",
icon: 'none'
})
}
if (res.retcode == '-40001') { if (res.retcode == '-40001') {
uni.showToast({ uni.showToast({
title: '使用次数超限制,请联系管理员!', title: '使用次数超限制,请联系管理员!',
@ -1491,12 +1653,26 @@
} }
} }
}, },
getAttribute(str){
str = str.replace(/"色"(?![^{]*": *"色")/g, '"均色"');
str = str.replace(/"码"(?![^{]*": *"码")/g, '"均码"');
return str
},
//清空语音输入的文字 //清空语音输入的文字
clearText(){ clearText(){
this.voiceText = '' this.voiceText = ''
}, },
//正则匹配处理“2十9”等情况
convertStringCorrectly(str) {
var regexForSingleTen = /(\d+)十(?!\d)/g;
var regexForFollowedByDigit = /(\d+)十(?=\d)/g;
var step1Result = str.replace(regexForSingleTen, '$10');
var finalResult = step1Result.replace(regexForFollowedByDigit, '$1');
return finalResult;
},
spliceMsg(res){ spliceMsg(res){
let regex = /嗯|啊|儿|各|阿|恩/g; let regex = /嗯|啊|儿|阿|恩/g;
return res.replace(regex, '') return res.replace(regex, '')
}, },
convertChineseToArabic(str) { convertChineseToArabic(str) {
@ -1733,12 +1909,16 @@
this.zNum += this.temporaryList[i].productCount || 0 this.zNum += this.temporaryList[i].productCount || 0
} }
}, },
clickClose(){
this.evalue = []
this.allChangeNum = 0
},
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
this.evalue = []
console.log(this.temporaryList) console.log(this.temporaryList)
let that = this, let that = this,
carList1 = [] carList1 = []
@ -1750,7 +1930,7 @@
productName: this.goodsDetail.productName, productName: this.goodsDetail.productName,
wholesalePrice: this.goodsDetail.wholesalePrice, wholesalePrice: this.goodsDetail.wholesalePrice,
purchasePrice:this.goodsDetail.purchasePrice, purchasePrice:this.goodsDetail.purchasePrice,
categoryName:'', categoryName:this.goodsDetail.categoryName,
categoryId:this.carList1.categoryId, categoryId:this.carList1.categoryId,
lsprice: this.goodsDetail.price, lsprice: this.goodsDetail.price,
productSn: this.goodsDetail.productSn, productSn: this.goodsDetail.productSn,
@ -1772,14 +1952,14 @@
if (this.carList.size == 0) { //当前页没有数据 if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < carList1.length; i++) { for (let i = 0; i < carList1.length; i++) {
let obj = { let obj = {
purchasePrice: this.goodsDetail.purchasePrice, //进货价 purchasePrice: this.userType == 0?this.goodsDetail.purchasePrice:'', //进货价
price:this.goodsDetail.price, price:this.goodsDetail.price,
price1:0, price1:0,
productCount: 0, productCount: 0,
id: carList1[i].id, id: carList1[i].id,
productId: carList1[i].id, productId: carList1[i].id,
wholesalePrice: this.goodsDetail.wholesalePrice, wholesalePrice: this.goodsDetail.wholesalePrice,
categoryName:'', categoryName:this.goodsDetail.categoryName,
categoryId:this.goodsDetail.categoryId, categoryId:this.goodsDetail.categoryId,
lsprice: this.goodsDetail.price, lsprice: this.goodsDetail.price,
productName: carList1[i].productName, productName: carList1[i].productName,
@ -1846,7 +2026,7 @@
} }
} else { //商品不同 } else { //商品不同
let obj = { let obj = {
purchasePrice: this.goodsDetail.purchasePrice, //进货价 purchasePrice: this.userType == 0?this.goodsDetail.purchasePrice:'', //进货价
price:this.goodsDetail.price, price:this.goodsDetail.price,
price1: 0, price1: 0,
productCount: 0, productCount: 0,
@ -1883,7 +2063,18 @@
uni.hideLoading(); uni.hideLoading();
}, 500) }, 500)
}, },
changessPrice() { changessPrice(e) {
if(this.linshiPrice == e.target.value){
this.shouldPay = e.target.value
}else{
if(e.target.value == ''){
this.shouldPay = this.linshiPrice
}else{
this.shouldPay = e.target.value
}
}
this.alreadyPay = this.shouldPay
this.noPay = this.shouldPay - this.alreadyPay; this.noPay = this.shouldPay - this.alreadyPay;
}, },
//货号是否重复 //货号是否重复
@ -1908,14 +2099,24 @@
}, },
//计算欠款 //计算欠款
changePay(e) { changePay(e) {
this.alreadyPay = Number(e.target.value) > Number(this.shouldPay) ? this.shouldPay : e.target.value if(this.linshiPrice == e.target.value){
this.alreadyPay = e.target.value
}else if(Number(e.detail.value) > Number(this.shouldPay)){
this.alreadyPay = this.shouldPay
}else{
if(e.target.value == ''){
this.alreadyPay = this.linshiPrice
}else{
this.alreadyPay = e.target.value
}
}
this.noPay = this.shouldPay - this.alreadyPay this.noPay = this.shouldPay - this.alreadyPay
this.noPay = this.noPay.toFixed(2) this.noPay = this.noPay.toFixed(2)
}, },
//跳转选择供应商 //跳转选择供应商
goPopleList(popleType) { goPopleList(popleType) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType url: '/package1/index/peopleList?popleType=' + popleType
}) })
}, },
//删除整条商品 //删除整条商品
@ -1976,14 +2177,39 @@
}) })
}, },
async inventorySubmit() { gysList(){
if (this.khName == '' || this.carList == '') { let that = this;
uni.showToast({ this.tui.request("/app/supplier/getByCondition", "post", {
title: "请选择供应商后入库~", searchStr:'默认供应商',
icon: 'none' pageNumber: 1,
pageSize: 10
}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.content.length == 0){
that.tui.request("/app/supplier/save", "post", {
consigneeMobile: '',
consigneeName: '默认供应商',
address1: '',
address: '',
province: '',
city: '',
area: ''
}, false,true).then((res) => {
if (res.code == 200) {
that.gysList()
}
}) })
return }else{
that.khName = res.result.content[0]
that.goRuku()
}
}else{
this.tui.toast(res.message)
} }
})
},
async goRuku(){
let that = this; let that = this;
let purchase = { let purchase = {
// id:uni.getStorageSync('AiInventoryId'), // id:uni.getStorageSync('AiInventoryId'),
@ -1999,13 +2225,13 @@
let purchaseDetails = []; let purchaseDetails = [];
let jishuqi = 0 let jishuqi = 0
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
if(value.productName == ''){ // if(value.productName == ''){
uni.showToast({ // uni.showToast({
title: "品名必须维护~", // title: "品名必须维护~",
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
if(value.productSn == ''){ if(value.productSn == ''){
uni.showToast({ uni.showToast({
title: value.productName + "的货号必须维护~", title: value.productName + "的货号必须维护~",
@ -2013,30 +2239,30 @@
}) })
return return
} }
if(value.wholesalePrice ==null || value.wholesalePrice ==undefined || value.wholesalePrice <= 0 || value.wholesalePrice == ""){ // if(value.wholesalePrice ==null || value.wholesalePrice ==undefined || value.wholesalePrice <= 0 || value.wholesalePrice == ""){
uni.showToast({ // uni.showToast({
title: value.productName + "的批发价必须维护~", // title: value.productName + "的批发价必须维护~",
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
if(value.lsprice ==null || value.lsprice ==undefined || value.lsprice <= 0 || value.lsprice == ""){ // if(value.lsprice ==null || value.lsprice ==undefined || value.lsprice <= 0 || value.lsprice == ""){
uni.showToast({ // uni.showToast({
title: value.productName + "的零售价必须维护~", // title: value.productName + "的零售价必须维护~",
icon: 'none' // icon: 'none'
}) // })
return // return
}else{ // }else{
value.price = value.lsprice value.price = value.lsprice
} // }
value.stockLogList1 = [] value.stockLogList1 = []
if (value.purchasePrice == '' || value.purchasePrice == 0) { // if (value.purchasePrice == '' || value.purchasePrice == 0) {
uni.showToast({ // uni.showToast({
title: value.productName + "的价格必须维护~", // title: value.productName + "的价格必须维护~",
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
if((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value.productId == '')){ if((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value.productId == '')){
that.tui.toast(value.productName + "分类未维护~") that.tui.toast(value.productName + "分类未维护~")
return; return;
@ -2059,6 +2285,13 @@
if(jishuqi == this.carList.size){ if(jishuqi == this.carList.size){
await this.goInventory(purchase,purchaseDetails) await this.goInventory(purchase,purchaseDetails)
} }
},
async inventorySubmit() {
if (this.khName == '') {
await this.gysList()
}else{
this.goRuku()
}
}, },
goInventory(purchase,purchaseDetails){ goInventory(purchase,purchaseDetails){
@ -2068,18 +2301,45 @@
}, },
//编辑每一个的单价 //编辑每一个的单价
clickCollapse(e,id) { clickCollapse(e,id) {
if(this.linshiPrice == e.target.value){
this.carList.get(id).purchasePrice = e.target.value
}else{
if(e.detail.value == ''){
this.carList.get(id).purchasePrice = this.linshiPrice
}else{
this.carList.get(id).purchasePrice = Number(e.detail.value) this.carList.get(id).purchasePrice = Number(e.detail.value)
}
}
this.carList.get(id).price1 = this.carList.get(id).productCount * this.carList.get(id).purchasePrice this.carList.get(id).price1 = this.carList.get(id).productCount * this.carList.get(id).purchasePrice
this.getAllPrice() this.getAllPrice()
}, },
//编辑每一个的批和零售 //编辑每一个的批和零售
PriceAndWho(e,id,type) { PriceAndWho(e,id,type) {
if(type == 'pi'){ if(type == 'pi'){
if(this.linshiPrice == e.target.value){
this.carList.get(id).wholesalePrice = e.target.value
}else{
if(e.detail.value == ''){
this.carList.get(id).wholesalePrice = this.linshiPrice
}else{
this.carList.get(id).wholesalePrice = Number(e.detail.value) this.carList.get(id).wholesalePrice = Number(e.detail.value)
}
}
}else{
if(this.linshiPrice == e.target.value){
this.carList.get(id).price = e.target.value
this.carList.get(id).lsprice = e.target.value
}else{
if(e.detail.value == ''){
this.carList.get(id).price = this.linshiPrice
this.carList.get(id).lsprice = this.linshiPrice
}else{ }else{
this.carList.get(id).price = Number(e.detail.value) this.carList.get(id).price = Number(e.detail.value)
this.carList.get(id).lsprice = Number(e.detail.value) this.carList.get(id).lsprice = Number(e.detail.value)
} }
}
}
this.$forceUpdate()
}, },
//计算总金额和总数量 //计算总金额和总数量
getAllPrice() { getAllPrice() {
@ -2657,4 +2917,20 @@
background: #eee; background: #eee;
border-radius: 50%; border-radius: 50%;
} }
.mask-model{
width: 60%;
height: 100rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
background: rgba(0,0,0,0.7);
color: #eee;
padding: 5px;
border-radius: 5px;
z-index: 99;
}
</style> </style>

476
package1/inventory/addGoods.vue

@ -16,17 +16,12 @@
<uni-forms-item label="货号" name="productSn" required> <uni-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" /> <uni-easyinput type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品条码" name="barcode">
<uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" /> <uni-forms-item label="批发价" name="wholesalePrice">
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon> <!-- <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> -->
</uni-forms-item> <input type="digit" class="content-input" v-model="formData.wholesalePrice" @focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" placeholder="请输入批发价">
<uni-forms-item label="批发价" name="wholesalePrice" required>
<uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" />
</uni-forms-item>
<uni-forms-item label="市场价" name="price" required>
<uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="分类" name="categoryId" required v-if="dataList == ''"> <uni-forms-item label="分类" name="categoryId" v-if="dataList == ''">
<!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId" <!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> --> placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> -->
<view class="content-list"> <view class="content-list">
@ -39,6 +34,27 @@
</view> </view>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="添加规格" name="categoryId" v-if="dataList == ''">
<!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> -->
<view class="content-list">
<view class="list-val">
<input type="text" placeholder="点击选择规格" disabled
style="border-bottom: 1px solid #fff;text-align: center;"
@tap="ejectRuleSelect">
<!-- <uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> -->
</view>
</view>
</uni-forms-item>
<uni-forms-item label="商品条码" name="barcode">
<uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" />
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon>
</uni-forms-item>
<uni-forms-item label="市场价" name="price">
<!-- <uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> -->
<input type="digit" class="content-input" v-model="formData.price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价">
</uni-forms-item>
<uni-forms-item label="尾货预警" name="salesWeek"> <uni-forms-item label="尾货预警" name="salesWeek">
<!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> --> <!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> -->
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" /> <uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" />
@ -58,6 +74,39 @@
<button @tap.stop="submit()">保存</button> <button @tap.stop="submit()">保存</button>
</view> </view>
</view> </view>
<!-- 添加分类弹出层 -->
<uni-popup ref="addTypeDialog" background-color="#fff">
<view class="add-popup-content">
<view class="add-popup-title">
<text>添加规格</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view class="add-popup-container">
<!-- <view>
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text>
</view> -->
<!-- <input type="text" v-model="typeText" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding-left: 20rpx;margin:20rpx 0;font-size: 25rpx;line-height: 80rpx;"
placeholder="请输入分类名称"> -->
<ul>
<li v-for="(item,index) in defaultList" :key="index">
<view class="title-fur">
<view class="name">{{item.name}}</view>
<u-icon size="20" name="plus" color="#5fd9ee"
@tap="toggle(index) "></u-icon>
</view>
<view class="content-fur">
<view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1"
@tap.stop="addMultipleType(item,item1.value,index1)">{{item1.value}}</view>
</view>
</li>
</ul>
<view class="add-popup-bottom">
<view class="add-popup-btn" @tap="dialogInputConfirm()">确认</view>
</view>
</view>
</view>
</uni-popup>
<!-- <u-modal v-model="show" :content="content"></u-modal> --> <!-- <u-modal v-model="show" :content="content"></u-modal> -->
</view> </view>
</template> </template>
@ -69,9 +118,9 @@
fileList1: [], fileList1: [],
formData: { formData: {
productName: '', productName: '',
price: '', price: 0,
productSn: '', productSn: '',
wholesalePrice: '', wholesalePrice: 0,
productPicture: '', productPicture: '',
productIntro: '', productIntro: '',
categoryId: '', categoryId: '',
@ -79,6 +128,133 @@
tailWarn: '', tailWarn: '',
barcode:'' barcode:''
}, },
defaultList:[{
name:'颜色',
list:[{
value:'均色',
checked:false,
},{
value:'白色',
checked:false,
},{
value:'黑色',
checked:false,
},{
value:'浅蓝',
checked:false,
},{
value:'蓝色',
checked:false,
},{
value:'灰色',
checked:false,
},{
value:'咖色',
checked:false,
},{
value:'紫色',
checked:false,
},{
value:'红色',
checked:false,
},{
value:'米色',
checked:false,
}]
},{
name:'尺码',
list:[{
value:'均码',
checked:false,
},{
value:'XS码',
checked:false
},{
value:'S码',
checked:false,
},{
value:'M码',
checked:false,
},{
value:'L码',
checked:false,
},{
value:'XL码',
checked:false,
},{
value:'2XL码',
checked:false,
},{
value:'3XL码',
checked:false,
},{
value:'4XL码',
checked:false,
},{
value:'25码',
checked:false
},{
value:'26码',
checked:false
},{
value:'27码',
checked:false
},{
value:'28码',
checked:false
},{
value:'29码',
checked:false
},{
value:'30码',
checked:false
},{
value:'31码',
checked:false
},{
value:'32码',
checked:false
},{
value:'33码',
checked:false
},{
value:'34码',
checked:false
},{
value:'35码',
checked:false
},{
value:'36码',
checked:false
},{
value:'37码',
checked:false
},{
value:'38码',
checked:false
},{
value:'39码',
checked:false
},{
value:'40码',
checked:false
},{
value:'41码',
checked:false
},{
value:'42码',
checked:false
},{
value:'43码',
checked:false
},{
value:'44码',
checked:false
},{
value:'45码',
checked:false
}]
}],
categoryList: [], categoryList: [],
productId:'', productId:'',
arrtList: [], arrtList: [],
@ -87,6 +263,7 @@
categoryId:'', categoryId:'',
dataList:[], dataList:[],
type:'add', type:'add',
multipleList:[],
rules: { rules: {
categoryId: { categoryId: {
rules: [{ rules: [{
@ -94,18 +271,18 @@
errorMessage: '请选择商品分类', errorMessage: '请选择商品分类',
}, ], }, ],
}, },
price: { // price: {
rules: [{ // rules: [{
required: true, // required: true,
errorMessage: '请填写市场价', // errorMessage: '请填写市场价',
}, ], // }, ],
}, // },
wholesalePrice: { // wholesalePrice: {
rules: [{ // rules: [{
required: true, // required: true,
errorMessage: '请填写批发价', // errorMessage: '请填写批发价',
}, ], // }, ],
}, // },
productSn: { productSn: {
rules: [{ rules: [{
required: true, required: true,
@ -155,8 +332,24 @@
this.formData.salesWeek = this.dataList.salesWeek this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn this.formData.tailWarn = this.dataList.tailWarn
} }
this.getGategoryList()
}, },
methods: { methods: {
//初始化获取分类列表
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
// shopId: 1,
}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.length > 0){
this.typeItem = res.result[0]
this.formData.categoryId = this.typeItem.id
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
// 删除图片 // 删除图片
deletePic(event) { deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1) this[`fileList${event.name}`].splice(event.index, 1)
@ -188,6 +381,104 @@
fileListLen++ fileListLen++
} }
}, },
obtainPrice(e,type,num){
console.log("获得焦点")
this.linshiPrice = e.target.value
if(type=='price'){
this.formData.price = ''
}else if(type=='wholesalePrice'){
this.formData.wholesalePrice = ''
}
},
dialogInputConfirm(e) {
let that = this;
if(that.multipleList == ''){
that.multipleList = [{
attributeName:'颜色',
productAttributeValueVoList:[{
checked: true,
value: "均色"
}]
},{
attributeName:'尺码',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}]
}else{
for(let i=0;i<that.multipleList.length;i++){
if(that.multipleList[i].productAttributeValueVoList == ''){
if(that.multipleList[i].attributeName == '颜色'){
that.multipleList[i].productAttributeValueVoList = [{
checked: true,
value: "均色"
}]
}else{
that.multipleList[i].productAttributeValueVoList = [{
checked: true,
value: "均码"
}]
}
}else{
if(that.multipleList.length != 2){
if(that.multipleList[i].attributeName == '颜色'){
let data = {
attributeName:'尺码',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}
that.multipleList.push(data)
}else{
let data = {
attributeName:'颜色',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}
that.multipleList.push(data)
}
}
}
}
}
for(var i=0;i<that.defaultList.length;i++){
for(var m=0;m<that.defaultList[i].list.length;m++){
that.defaultList[i].list[m].checked = false
}
}
console.log('multipleList',that.multipleList)
that.$refs.addTypeDialog.close()
},
changessPrice(e,type) {
if(type == 'price'){
if(this.linshiPrice == e.target.value){
this.formData.price = e.target.value
}else{
if(e.target.value == ''){
this.formData.price = this.linshiPrice
}else{
this.formData.price = e.target.value
}
}
}else{
if(this.linshiPrice == e.target.value){
this.formData.wholesalePrice = e.target.value
}else{
if(e.target.value == ''){
this.formData.wholesalePrice = this.linshiPrice
}else{
this.formData.wholesalePrice = e.target.value
}
}
}
},
uploadFilePromise(url) { uploadFilePromise(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -226,6 +517,9 @@
} }
}) })
}, },
ejectRuleSelect(){
this.$refs.addTypeDialog.open('bottom')
},
// 触发提交表单 // 触发提交表单
submit() { submit() {
let that = this; let that = this;
@ -233,14 +527,15 @@
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if(that.dataList !=''){ if(that.dataList !=''){
url = '/app/product/edit' url = '/app/product/edit'
res.id = that.dataList.id this.formData.id = that.dataList.id
}else{ }else{
url = '/app/product/save' url = '/app/product/save'
this.formData.purchasePrice = 0
} }
if(res.productPicture == ''){ if(res.productPicture == ''){
res.productPicture = '' res.productPicture = ''
} }
that.tui.request(url, "post", res, false, false).then((res1) => { that.tui.request(url, "post", this.formData, false, false).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
@ -286,9 +581,59 @@
}) })
} }
}) })
},
//选择多个规格保存
addMultipleType(item,item1,index){
item.list[index].checked = !item.list[index].checked
var list = []
if(this.multipleList == ''){
list.push(item.list[index])
var data = {
attributeName:item.name,
productAttributeValueVoList: list
}
this.multipleList.push(data)
}else{
for(var i=0;i<this.multipleList.length;i++){
if(this.multipleList[i].attributeName == item.name){ //同种分类
for(var m=0;m<this.multipleList[i].productAttributeValueVoList.length;m++){
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同
this.multipleList[i].productAttributeValueVoList.splice(m,1)
return;
}else{ //规格不同
if(m+1 == this.multipleList[i].productAttributeValueVoList.length){
this.multipleList[i].productAttributeValueVoList.push(item.list[index])
return;
}
}
}
}else{ //不同分类
if(this.multipleList.length == i+1){
list.push(item.list[index])
var data = {
attributeName:item.name,
productAttributeValueVoList: list
}
this.multipleList.push(data)
return;
}
} }
} }
} }
},
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@ -339,6 +684,11 @@
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
} }
.checked{
background: #60F3FF !important;
color: #fff !important;
border-radius: 5px !important;
}
.content-list { .content-list {
height: 70rpx; height: 70rpx;
border: 1px solid #eee; border: 1px solid #eee;
@ -351,4 +701,78 @@
background: #5fd9ee; background: #5fd9ee;
border-radius: 10px; border-radius: 10px;
} }
.content-input {
width: auto;
position: relative;
overflow: hidden;
flex: 1;
line-height: 1;
font-size: 14px;
height: 35px;
border: 2px solid #eee;
padding-left: 20rpx;
border-radius: 5px;
}
.add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 100%;
height: 1050rpx;
background-color: #fff;
}
.add-popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.add-popup-container {
margin-top: 20rpx;
}
.add-popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.add-popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
.name {
font-size: 30rpx;
width: 90%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
}
.content-fur {
padding-bottom: 25rpx;
}
.content-low {
width: auto;
border: 1px solid #eee;
display: inline-block;
min-width: 90rpx;
padding: 5rpx;
font-size: 35rpx;
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
border-radius: 5px;
}
</style> </style>

1
package1/inventory/batchPrint.vue

@ -350,6 +350,7 @@
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
} }
that.$nextTick(()=>{ that.$nextTick(()=>{
console.log('bufferData',that.bufferData)
that.$refs.payDialog.close(); that.$refs.payDialog.close();
that.bufferData = [] that.bufferData = []
uni.navigateBack({ uni.navigateBack({

37
package1/inventory/gategory.vue

@ -8,9 +8,12 @@
<li v-for="(item, index) in indexList" :key="index" @tap="clickList(item)"> <li v-for="(item, index) in indexList" :key="index" @tap="clickList(item)">
<view class="name"> <view class="name">
<text>{{item.categoryName}}</text> <text>{{item.categoryName}}</text>
<u-icon name="edit-pen-fill" size="22" @tap.stop="inputDialogToggle('edit', item)"></u-icon>
</view> </view>
<button class="bj-btn" @tap.stop="goGategoryLow(item.id)">编辑规格</button> <view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">
<u-icon name="edit-pen-fill" size="22"></u-icon>
</view>
<!-- <button @tap.stop="goGategoryLow(item.id)">编辑规格</button> -->
</li> </li>
</ul> </ul>
</view> </view>
@ -47,12 +50,12 @@
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons> style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view> </view>
<view class="add-popup-container"> <view class="add-popup-container">
<view> <!-- <view>
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text> <text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text>
</view> </view> -->
<input type="text" v-model="typeText" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding-left: 20rpx;margin:20rpx 0;font-size: 25rpx;line-height: 80rpx;" <input type="text" v-model="typeText" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding-left: 20rpx;margin:20rpx 0;font-size: 25rpx;line-height: 80rpx;"
placeholder="请输入分类名称"> placeholder="请输入分类名称">
<ul> <!-- <ul>
<li v-for="(item,index) in defaultList" :key="index"> <li v-for="(item,index) in defaultList" :key="index">
<view class="title-fur"> <view class="title-fur">
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
@ -64,7 +67,7 @@
@tap.stop="addMultipleType(item,item1.value,index1)">{{item1.value}}</view> @tap.stop="addMultipleType(item,item1.value,index1)">{{item1.value}}</view>
</view> </view>
</li> </li>
</ul> </ul> -->
<view class="add-popup-bottom"> <view class="add-popup-bottom">
<view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view> <view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view>
</view> </view>
@ -73,7 +76,7 @@
</uni-popup> </uni-popup>
<!-- 查看商品库存弹出层 --> <!-- 查看商品库存弹出层 -->
<uni-popup ref="carPopup" background-color="#fff"> <uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content" style="height:auto !important;"> <view class="popup-content" style="height:auto !important;max-height: 1000rpx;overflow: scroll;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view> <view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''" <view v-if="goodsList !=''"
style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;"> style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
@ -187,13 +190,13 @@
value:'XL码', value:'XL码',
checked:false, checked:false,
},{ },{
value:'XXL码', value:'2XL码',
checked:false, checked:false,
},{ },{
value:'XXXL码', value:'3XL码',
checked:false, checked:false,
},{ },{
value:'XXXXL码', value:'4XL码',
checked:false, checked:false,
},{ },{
value:'25码', value:'25码',
@ -305,7 +308,7 @@
this.inputVal = ''; this.inputVal = '';
this.isOpenId = item; this.isOpenId = item;
this.dialogTit = '输入分类名' this.dialogTit = '输入分类名'
this.$refs.addTypeDialog.open('bottom') this.$refs.addTypeDialog.open('center')
} }
}, },
@ -540,12 +543,9 @@
}, },
//选择多个规格保存 //选择多个规格保存
addMultipleType(item,item1,index){ addMultipleType(item,item1,index){
item.list[index].checked = !item.list[index].checked item.list[index].checked = !item.list[index].checked
var list = [] var list = []
if(this.multipleList == ''){ if(this.multipleList == ''){
list.push(item.list[index]) list.push(item.list[index])
var data = { var data = {
attributeName:item.name, attributeName:item.name,
@ -687,10 +687,9 @@
} }
.bj-btn { .bj-btn {
width: 120rpx; width: 80rpx;
height: 60rpx; height: 60rpx;
font-size: 26rpx; font-size: 26rpx;
background: red;
margin: 20rpx 0; margin: 20rpx 0;
float: left; float: left;
padding: 0; padding: 0;
@ -698,7 +697,7 @@
} }
.name { .name {
width: 75%; width: 86%;
float: left; float: left;
display: flex; display: flex;
} }
@ -771,8 +770,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
width: 100%; width: 500rpx;
height: 1300rpx; height: 350rpx;
background-color: #fff; background-color: #fff;
} }

10
package1/inventory/inventoryConfirm.vue

@ -23,21 +23,21 @@
</view> </view>
</view> </view>
<view class="tui-goods-info" style="width: 95%;margin: 0 auto;"> <view class="tui-goods-info" style="width: 95%;margin: 0 auto;">
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;"> <view class="tui-price-flex tui-size32" v-if="userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">应付金额</view> <view class="tui-flex-shrink">应付金额</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}</view> <view class="tui-price-large">{{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}</view>
</view> </view>
</view> </view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;"> <view class="tui-price-flex tui-size32" v-if="userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">已付金额</view> <view class="tui-flex-shrink">已付金额</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view> <view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view>
</view> </view>
</view> </view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;"> <view class="tui-price-flex tui-size32" v-if="userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">欠款</view> <view class="tui-flex-shrink">欠款</view>
<view class="tui-goods-price tui-primary-color"> <view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
@ -75,7 +75,8 @@
return { return {
purchase:'', purchase:'',
purchaseDetails:'', purchaseDetails:'',
aiinventory:0 //1是AI入库 0是普通入库 aiinventory:0, //1是AI入库 0是普通入库
userType:1
} }
}, },
filters: { filters: {
@ -94,6 +95,7 @@
this.purchaseDetails = JSON.parse(option.purchaseDetails) this.purchaseDetails = JSON.parse(option.purchaseDetails)
this.purchase = JSON.parse(option.purchase) this.purchase = JSON.parse(option.purchase)
this.aiinventory = option.aiinventory this.aiinventory = option.aiinventory
this.userType = uni.getStorageSync('type')
}, },
methods: { methods: {
inventorySubmit() { inventorySubmit() {

2
package1/staff/addStaff.vue

@ -81,7 +81,7 @@
let url; let url;
if(this.type=='edit'){ if(this.type=='edit'){
url = '/app/common/user/edit' url = '/app/common/user/edit'
this.addForm.username = this.mobile this.addForm.username = this.addForm.mobile
this.addForm.id = this.id this.addForm.id = this.id
}else{ }else{
url = '/app/common/user/add' url = '/app/common/user/add'

2
package1/stock/addStock.vue

@ -118,7 +118,7 @@
<view class="checkList-box"> <view class="checkList-box">
{{item1.stockCount}} {{item1.stockCount}}
</view> </view>
<uni-number-box max="100000" v-model="item1.pdNum" /> <uni-number-box min="-10000" max="100000" v-model="item1.pdNum" />
</view> </view>
</view> </view>
</view> </view>

2
package1/stock/stockDetail.vue

@ -30,7 +30,7 @@
{{item.stockCount}} {{item.stockCount}}
</view> </view>
<view style="width: 27%;font-size: 26rpx;padding-top: 5px;"> <view style="width: 27%;font-size: 26rpx;padding-top: 5px;">
<uni-number-box :min="-1000000" max='1000000' v-model="item.pdNum" /> <uni-number-box min="-10000" max='1000000' v-model="item.pdNum" />
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save