wangfukang 3 years ago
parent
commit
998f335454
  1. 24
      package1/AI/AIHangOrderList.vue
  2. 4
      package1/AI/AiChat.vue
  3. 44
      package1/inventory/gategory.vue
  4. 44
      package1/inventory/gategoryLow.vue

24
package1/AI/AIHangOrderList.vue

@ -77,6 +77,10 @@
<view class="btn" @tap.stop="delItem(item.id)" style="background: linear-gradient(90deg, #FF9797, #FFC1E0);"> <view class="btn" @tap.stop="delItem(item.id)" style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">
删除 删除
</view> </view>
<view v-if="item.aiFlag != 0" style="height: 100rpx;line-height: 92rpx;">
<radio :value="isInventory" @tap="invenRadio" :checked="isInventory" style="margin-left: 30rpx;"/>
未入库规格不显示
</view>
</view> </view>
<view class="order-collapse-item" v-if="item.isCollapse"> <view class="order-collapse-item" v-if="item.isCollapse">
<view class="collapse-1"> <view class="collapse-1">
@ -262,6 +266,7 @@
voiceText: ' ', voiceText: ' ',
list: [], list: [],
value: '', value: '',
isInventory:true,
temporaryNum: 0, temporaryNum: 0,
goodsDetail: [], goodsDetail: [],
attrNameList: [], attrNameList: [],
@ -445,6 +450,10 @@
} }
} }
}, },
//AI挂单,无库存不显示radio,所有颜色所有尺码,无库存太多删除麻烦
invenRadio(){
this.isInventory = !this.isInventory
},
//扫一扫功能 //扫一扫功能
scanCodeAdd(item) { scanCodeAdd(item) {
let that = this; let that = this;
@ -815,7 +824,19 @@
let newSaleDetailDTOList = [] let newSaleDetailDTOList = []
let num = 0 let num = 0
for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){ for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){
if(item.saleDetailDTOList[i].stockLogList1[m].stockCount != null){ if(this.isInventory == true && item.aiFlag != "0"){
if(item.saleDetailDTOList[i].stockLogList1[m].stockCount != null){
if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount].productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
}else{
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,num)
num++
}
}
}else{
if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){ if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList) let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount].productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount].productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
@ -827,6 +848,7 @@
} }
} }
} }
if(newSaleDetailDTOList.length != 0){ if(newSaleDetailDTOList.length != 0){

4
package1/AI/AiChat.vue

@ -137,9 +137,9 @@
convertChineseToArabic(str) { convertChineseToArabic(str) {
const chineseNumToArabic = { const chineseNumToArabic = {
'零': 0, '一': 1, '二': 2, '两': 2, '三': 3, '零': 0, '一': 1, '二': 2, '两': 2, '三': 3,
'四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9,'杠':'-','刚':'-' '四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9,'杠':'-','刚':'-','军色':'均色'
}; };
const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚)/g; const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色)/g;
return str.replace(regex, match => chineseNumToArabic[match]); return str.replace(regex, match => chineseNumToArabic[match]);
}, },
inputSaveText(){ inputSaveText(){

44
package1/inventory/gategory.vue

@ -21,10 +21,19 @@
@confirm="dialogInputConfirm" @close="dialogClose"> @confirm="dialogInputConfirm" @close="dialogClose">
</uni-popup-dialog> </uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-popup ref="delDialog" type="dialog"> <uni-popup ref="delDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称" <view class="type-popup" style="width:600rpx;margin-bottom: 0;border-radius: 0;height: 400rpx;border-radius: 10px;">
cancelText="删除" @confirm="dialogInputConfirm" @close="dialogDel"> <view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;">
</uni-popup-dialog> 修改规格值
</view>
<view style="width: 90%;margin: 80rpx auto;">
<uni-easyinput type="text" v-model="inputVal" @blur="handleBlur" placeholder="请输入规格值" />
</view>
<view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;display: flex;position: absolute;bottom: 0;">
<view style="width:50%;" @tap="dialogDel">删除</view>
<view style="width:50%;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view>
</view>
</view>
</uni-popup> </uni-popup>
<!-- 添加分类弹出层 --> <!-- 添加分类弹出层 -->
<uni-popup ref="addTypeDialog" background-color="#fff"> <uni-popup ref="addTypeDialog" background-color="#fff">
@ -299,6 +308,9 @@
}, },
close(){ close(){
this.$refs.addTypeDialog.close() this.$refs.addTypeDialog.close()
},
handleBlur(e){
this.inputVal = e.detail.value
}, },
//查询分类下有没有库存 //查询分类下有没有库存
getTypeToNum(id) { getTypeToNum(id) {
@ -428,12 +440,14 @@
} }
} }
that.tui.request("/app/productCategory/batchSaveCategoryAndAttribute", "post", { that.tui.request("/app/productCategory/batchSaveCategoryAndAttribute", "post", {
categoryName: e, categoryName: this.inputVal,
productAttributeOfAddVos:that.multipleList productAttributeOfAddVos:that.multipleList
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.tui.toast("添加成功") that.tui.toast("添加成功")
that.$refs.addTypeDialog.close() that.$refs.addTypeDialog.close()
that.getGategoryList() that.getGategoryList()
} else { } else {
that.tui.toast("添加失败") that.tui.toast("添加失败")
@ -451,7 +465,7 @@
break; break;
case 'edit': case 'edit':
that.tui.request("/app/productCategory/edit", "post", { that.tui.request("/app/productCategory/edit", "post", {
categoryName: e, categoryName: this.inputVal,
id: that.editItem.id id: that.editItem.id
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -469,8 +483,10 @@
}).catch((res) => {}) }).catch((res) => {})
break; break;
default: default:
} }
that.$refs.inputClose.val = '' that.$refs.delDialog.close()
that.$refs.inputClose.val = ''
this.inputVal = ""
}, },
//点击取消按钮 //点击取消按钮
dialogClose() { dialogClose() {
@ -496,7 +512,9 @@
title: "删除成功", title: "删除成功",
icon: 'none' icon: 'none'
}) })
this.$refs.carPopup.close() this.$refs.carPopup.close()
this.$refs.delDialog.close()
} else { } else {
uni.showToast({ uni.showToast({
title: "删除失败", title: "删除失败",
@ -806,5 +824,13 @@
text-align: center; text-align: center;
color: #777; color: #777;
margin: 20rpx 0 0 20rpx; margin: 20rpx 0 0 20rpx;
}
.type-popup{
width: 500rpx;
height: auto;
background: #fff;
border-radius: 10px;
position: relative;
margin-bottom: 40rpx;
} }
</style> </style>

44
package1/inventory/gategoryLow.vue

@ -25,10 +25,19 @@
</view> </view>
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false" <u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false"
@confirm="delItemModal"></u-modal> @confirm="delItemModal"></u-modal>
<uni-popup ref="inputDialog" type="dialog"> <uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称" <view class="type-popup" style="width:600rpx;margin-bottom: 0;border-radius: 0;height: 400rpx;border-radius: 10px;">
@confirm="dialogInputConfirm" @close="dialogClose"> <view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;">
</uni-popup-dialog> 新增规格
</view>
<view style="width: 90%;margin: 80rpx auto;">
<uni-easyinput type="text" v-model="categoryText" @blur="handleBlur" placeholder="请输入规格值" />
</view>
<view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;display: flex;position: absolute;bottom: 0;">
<view style="width:50%;" @tap="$refs.inputDialog.close()">取消</view>
<view style="width:50%;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view>
</view>
</view>
</uni-popup> </uni-popup>
<!-- 查看商品库存弹出层 --> <!-- 查看商品库存弹出层 -->
<uni-popup ref="carPopup" background-color="#fff"> <uni-popup ref="carPopup" background-color="#fff">
@ -87,7 +96,8 @@
delType: '', delType: '',
dialogTit: '输入分类名', dialogTit: '输入分类名',
categoryId: '', categoryId: '',
goodsList: [] goodsList: [],
categoryText:''
} }
}, },
computed: { computed: {
@ -183,13 +193,16 @@
this.editItem = item; this.editItem = item;
} }
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
},
handleBlur(e){
this.categoryText = e.detail.value
}, },
dialogInputConfirm(e) { dialogInputConfirm(e) {
switch (this.typeModel) { switch (this.typeModel) {
case 'add': case 'add':
this.tui.request("/app/productCategory/save", "post", { this.tui.request("/app/productCategory/save", "post", {
categoryName: e categoryName: this.categoryText
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -209,7 +222,7 @@
break; break;
case 'edit': case 'edit':
this.tui.request("/app/productCategory/edit", "post", { this.tui.request("/app/productCategory/edit", "post", {
categoryName: e, categoryName: this.categoryText,
id: this.editItem.id id: this.editItem.id
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -237,7 +250,7 @@
} }
} }
this.tui.request("/app/productAttribute/save", "post", { this.tui.request("/app/productAttribute/save", "post", {
attributeName: e, attributeName: this.categoryText,
categoryId: this.isOpenId categoryId: this.isOpenId
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -263,7 +276,7 @@
return return
} }
this.tui.request("/app/productAttributeValue/save", "post", { this.tui.request("/app/productAttributeValue/save", "post", {
value: e, value: this.categoryText,
attributeId: this.isOpenId attributeId: this.isOpenId
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -271,7 +284,8 @@
uni.showToast({ uni.showToast({
title: "添加成功", title: "添加成功",
icon: 'none' icon: 'none'
}) })
this.$refs.inputDialog.close()
} else { } else {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
@ -282,7 +296,7 @@
break; break;
case 'attrEdit': case 'attrEdit':
this.tui.request("/app/productAttribute/edit", "post", { this.tui.request("/app/productAttribute/edit", "post", {
attributeName: e, attributeName: this.categoryText,
categoryId: this.editItem.categoryId, categoryId: this.editItem.categoryId,
id: this.editItem.id id: this.editItem.id
}, false, true).then((res) => { }, false, true).then((res) => {
@ -549,5 +563,13 @@
flex: 1; flex: 1;
text-align: center; text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB); background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.type-popup{
width: 500rpx;
height: auto;
background: #fff;
border-radius: 10px;
position: relative;
margin-bottom: 40rpx;
} }
</style> </style>
Loading…
Cancel
Save