diff --git a/package1/.DS_Store b/package1/.DS_Store
index 546c695..ec03d09 100644
Binary files a/package1/.DS_Store and b/package1/.DS_Store differ
diff --git a/package1/AI/AiChat.vue b/package1/AI/AiChat.vue
index 88545be..f088bde 100644
--- a/package1/AI/AiChat.vue
+++ b/package1/AI/AiChat.vue
@@ -154,9 +154,9 @@
'四': 4, '五': 5, '六': 6, '七': 7, '八': 8,
'九': 9,'杠':'-','刚':'-','军色':'均色','叉':'X','金色':'均色','井':'#',
'时间':'10件','事件':'10件','世间':'10件','实践':'10件','实件':'10件',
- '景':'#','警':'#','颈':'#',
+ '景':'#','警':'#','颈':'#','括号':'货号'
};
- const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈)/g;
+ const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈|括号)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
inputSaveText(){
@@ -184,6 +184,9 @@
if(convertedStr.indexOf(',') == 0){
convertedStr = convertedStr.substr(1)
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
let getMsg = convertedStr
if(this.editText == ''){
return;
@@ -250,6 +253,10 @@
console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
}
+ console.log(convertedStr.indexOf('号'))
+ if (convertedStr.indexOf('号') == 0) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
let data = {
text:convertedStr
}
diff --git a/package1/AI/addAiList.vue b/package1/AI/addAiList.vue
index 2d4f1d7..a50d6fe 100644
--- a/package1/AI/addAiList.vue
+++ b/package1/AI/addAiList.vue
@@ -2,32 +2,52 @@
-
+
供应商
-
+
+ style="border-bottom: 1px solid #fff;padding-left: 100rpx;" :value="khName.consigneeName">
+
+
+ 生成货号
+
+
+
+
+
+
+
+ 货号规则
+
-
+
扫一扫
-
+
图片添加
-
-
- 添加商品
+
+
+ 新增商品
-
- 库存商品
+
+ 选库存
@@ -46,15 +66,15 @@
-
-
+
+
新
-
上传多图
-
- {{value[1].childrenList.length}}
+
+ {{value[1].productPictures.length}}
@@ -92,13 +112,13 @@
style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
- 货号:
-
+ @tap="generateSn(value[0])">
分类:
+ style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 170rpx;right: 0px;line-height: 54rpx;">
语音录入
+ style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 240rpx;right: 0px;line-height: 54rpx;">
添加规格
@@ -155,31 +175,31 @@
-
+
应付金额
-
已付金额
-
欠款
-
+
其他费用
-
+
@@ -427,7 +447,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 更换图片
@@ -524,14 +542,17 @@
index1: '',
recordState: false,
goodsDetail: [],
- columns: [],
- keyList: [],
temporaryList: [],
- zNum: 0,
- carList1: [],
- productNum: null,
+ zNum: 0,
+ snList:[],
+ carList1: [],
+ zhuImg:'',
+ productNum: null,
+ prefixRule:'',
+ numRule:'',
productId: '',
- oneGoodsId:'',
+ oneGoodsId:'',
+ goodsId:'',
pageOldTemList: [],
oldTemList: [],
attrList: [],
@@ -540,7 +561,8 @@
newTemList: [],
pecsList: [],
childrenId:'',
- childrenList:[],
+ isGenerateSnRadio:1,
+ productPictures:[],
categoryText: '',
dataObj: new Map(),
isPlusAndMinus: false,
@@ -548,10 +570,148 @@
evalue: [],
attributeValue: [],
specifications: '',
- current:0,
+ current:0,
+ swiperDotIndex:0,
currentAnchor: '',
temporaryNum: 0,
- isBottom: false,
+ isBottom: false,
+ isGenerateSn: [{
+ value: '0',
+ name: '生成'
+ },
+ {
+ value: '1',
+ name: '不生成'
+ }
+ ],
+ snName:'ty',
+ defaultList:[{
+ name:'颜色',
+ value:[{
+ value:'均色',
+ isChecked:false,
+ },{
+ value:'白色',
+ isChecked:false,
+ },{
+ value:'黑色',
+ isChecked:false,
+ },{
+ value:'浅蓝',
+ isChecked:false,
+ },{
+ value:'蓝色',
+ isChecked:false,
+ },{
+ value:'灰色',
+ isChecked:false,
+ },{
+ value:'咖色',
+ isChecked:false,
+ },{
+ value:'紫色',
+ isChecked:false,
+ },{
+ value:'红色',
+ isChecked:false,
+ },{
+ value:'米色',
+ isChecked:false,
+ }]
+ },{
+ name:'尺码',
+ value:[{
+ value:'均码',
+ isChecked:false,
+ },{
+ value:'XS码',
+ isChecked:false
+ },{
+ value:'S码',
+ isChecked:false,
+ },{
+ value:'M码',
+ isChecked:false,
+ },{
+ value:'L码',
+ isChecked:false,
+ },{
+ value:'XL码',
+ isChecked:false,
+ },{
+ value:'2XL码',
+ isChecked:false,
+ },{
+ value:'3XL码',
+ isChecked:false,
+ },{
+ value:'4XL码',
+ isChecked:false,
+ },{
+ value:'25码',
+ isChecked:false
+ },{
+ value:'26码',
+ isChecked:false
+ },{
+ value:'27码',
+ isChecked:false
+ },{
+ value:'28码',
+ isChecked:false
+ },{
+ value:'29码',
+ isChecked:false
+ },{
+ value:'30码',
+ isChecked:false
+ },{
+ value:'31码',
+ isChecked:false
+ },{
+ value:'32码',
+ isChecked:false
+ },{
+ value:'33码',
+ isChecked:false
+ },{
+ value:'34码',
+ isChecked:false
+ },{
+ value:'35码',
+ isChecked:false
+ },{
+ value:'36码',
+ isChecked:false
+ },{
+ value:'37码',
+ isChecked:false
+ },{
+ value:'38码',
+ isChecked:false
+ },{
+ value:'39码',
+ isChecked:false
+ },{
+ value:'40码',
+ isChecked:false
+ },{
+ value:'41码',
+ isChecked:false
+ },{
+ value:'42码',
+ isChecked:false
+ },{
+ value:'43码',
+ isChecked:false
+ },{
+ value:'44码',
+ isChecked:false
+ },{
+ value:'45码',
+ isChecked:false
+ }]
+ }],
temporary: [] //修改单个规格值临时存放要修改的对象
}
},
@@ -626,7 +786,8 @@
} else {
this.carList1 = this.carList1
- }
+ }
+ console.log(this.carList1)
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
@@ -641,10 +802,11 @@
productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName: this.carList1[i].categoryName,
- categoryId: this.carList1[i].categoryId,
+ categoryId: this.carList1[i].attrId,
lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture,
- productSn: this.carList1[i].productSn,
+ productSn: this.carList1[i].productSn,
+ productPictures:[],
stockLogList: new Map(),
stockLogList1: []
}
@@ -713,12 +875,13 @@
productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName: this.carList1[i].categoryName,
- categoryId: this.carList1[i].categoryId,
+ categoryId: this.carList1[i].attrId,
lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
- stockLogList1: [],
+ stockLogList1: [],
+ productPictures:[],
name: ''
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
@@ -759,17 +922,157 @@
}
this.$forceUpdate()
})
- console.log(this.carList)
},
onLoad(options) {
- this.userType = uni.getStorageSync('type')
+ this.userType = uni.getStorageSync('type')
+ this.getSnList()
+ this.getShopCategory()
+ this.getDefaultCategory()
},
methods: {
+ //店铺规格库
+ getShopCategory(){
+ this.tui.request("/app/productCategory/getCategoryOfshop", "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ //this.specifiList[0] this.defaultList[1] 尺码
+ //this.specifiList[1] this.defaultList[0] 颜色
+ this.specifiList = res.result.productAttributeOfAddVos
+ for(let m=0;m{
+ if(isysTrue){
+ this.defaultList[1].value.push(this.specifiList[0].productAttributeValueVoList[m])
+ }
+ })
+ }
+ for(let m=0;m{
+ if(isTrue){
+ this.defaultList[0].value.push(this.specifiList[1].productAttributeValueVoList[m])
+ }
+ })
+
+ }
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //店铺默认分类
+ getDefaultCategory(){
+ this.tui.request("/app/productCategory/getDefaultCategory", "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ this.categoryList = res.result
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //进入页面,查询货号列表
+ getSnList(){
+ // snList
+ this.snList = []
+ this.snName = ''
+ this.tui.request("/app/productSn/getProductSnByShopId", "POST", {}, false, true).then((res1) => {
+ if (res1.code == 200) {
+ if(res1.result != ''){
+ for(let i=0;i {})
+ },
+ //根据规则生成货号
startGetSn(){
- //调接口请求,返回货号放到货号一栏
+ var that = this;
+ if(this.prefixRule == ''){
+ this.tui.toast('请输入货号生成前缀规则')
+ return
+ }
+ if(this.numRule == ''){
+ this.tui.toast('请输入货号生成位数规则')
+ return
+ }
+ this.tui.request("/app/productSn/addAndGetNewProductSn", "POST", {
+ snPre:this.prefixRule,
+ snSufLength:this.numRule
+ }, false, false).then((res1) => {
+ if (res1.code == 200) {
+ // this.snList = res1.result
+ if(res1.message=='货号前缀已存在!'){ //被删除,调启用方法
+ uni.showModal({
+ title: "提示",
+ content: "货号已经被删除,是否重新启用?",
+ success: function(res) {
+ if (res.confirm) {
+ that.tui.request("/app/productSn/useAgainProductSn", "POST", {
+ id:res1.result.id
+ }, false, true).then((res2) => {
+ if (res2.code == 200) {
+ that.tui.toast('重新启用成功')
+ setTimeout(res=>{
+ that.$refs.SNDialog.close()
+ that.getSnList()
+ },1000)
+ } else {
+ that.tui.toast(res2.message)
+ }
+ that.$forceUpdate()
+ }).catch((res) => {})
+ }
+ }
+ })
+ }else{
+ this.addPageGoods(this.zhuImg,res1.result)
+ }
+
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
},
- //生成货号
- generateSn(){
+ //生成货号弹出层
+ generateSn(id){
+ if(this.snList.length > 0){
+ this.tui.request("/app/productSn/getNewProductSn", "POST", {
+ snPre: this.snName
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.carList.get(id).productSn = res.result
+ this.$forceUpdate()
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ }else{
+ this.zhuImg = ''
+ this.$refs.SNDialog.open('center')
+ }
+
+ },
+ addSn(){
this.$refs.SNDialog.open('center')
},
AiVoice() {
@@ -786,11 +1089,12 @@
productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName: this.carList1[i].categoryName,
- categoryId: this.carList1[i].categoryId,
+ categoryId: this.carList1[i].attrId,
lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
- stockLogList: new Map(),
+ stockLogList: new Map(),
+ productPictures:[],
stockLogList1: []
}
@@ -879,12 +1183,13 @@
productName: this.carList1[i].productName,
wholesalePrice: this.carList1[i].wholesalePrice || 0,
categoryName: this.carList1[i].categoryName,
- categoryId: this.carList1[i].categoryId,
+ categoryId: this.carList1[i].attrId,
lsprice: this.carList1[i].price || 0,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
- stockLogList1: [],
+ stockLogList1: [],
+ productPictures:[],
name: ''
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
@@ -925,7 +1230,6 @@
}
this.$forceUpdate()
})
- console.log(this.carList)
},
numData(val) {
var name = []
@@ -947,19 +1251,23 @@
this.getGategoryLowList()
},
getScanCodeCategroyId(num) {
- num = num == '颜色' ? 0 : 1
- this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
- categoryId: this.goodsDetail.categoryId
- }, false, true).then((res1) => {
- if (res1.code == 200) {
- this.isOpenId = res1.result[num].id
- this.$refs.inputDialog.open('bottom')
- this.isBottom = true
- } else {
- this.tui.toast(res.message)
- }
- }).catch((res) => {})
- this.$forceUpdate()
+ num = num == '颜色' ? 0 : 1
+ console.log('新增',this.goodsDetail)
+ this.isOpenId = num
+ this.goodsId = this.goodsDetail.id
+ this.$refs.inputDialog.open('bottom')
+ this.isBottom = true
+ // this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
+ // categoryId: this.goodsDetail.categoryId
+ // }, false, true).then((res1) => {
+ // if (res1.code == 200) {
+ // this.isOpenId = res1.result[num].id
+ // this.$refs.inputDialog.open('bottom')
+ // this.isBottom = true
+ // } else {
+ // this.tui.toast(res.message)
+ // }
+ // }).catch((res) => {})
},
//初始化获取子分类列表
getGategoryLowList() {
@@ -1069,7 +1377,8 @@
}
},
//确认语音输入的内容
- setDetail(e) {
+ setDetail(e) {
+ let that = this;
if (this.voiceText == '') {
this.tui.toast('识别内容不能为空')
return
@@ -1111,13 +1420,13 @@
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)
+ }
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
}
this.getMsg = convertedStr
this.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase", "POST", {
@@ -1129,19 +1438,25 @@
let purchaseDetails = res.result.data.purchaseDetails
if(this.oneGoodsId){
let id = this.oneGoodsId
- this.tui.toast('单商品语音录入')
if(purchaseDetails.length > 0){
this.carList.get(id).productName = purchaseDetails[0].productName
- this.carList.get(id).productSn = purchaseDetails[0].productSn
-
- if (purchaseDetails[0].productId) {
- data.id = purchaseDetails[0].productId
- } else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn ==
- null || purchaseDetails[0].productSn == '货号') {
- data.id = purchaseDetails[0].productName
- } else if (purchaseDetails[0].productSn) {
- data.id = purchaseDetails[0].productSn
+ let isTrue = false
+ this.carList.forEach(function(value, key) {
+ if(value.productSn == purchaseDetails[0].productSn){
+ isTrue = true
+ console.log('向通用')
+ this.carList.get(id).productSn = ''
+ this.$forceUpdate()
+ setTimeout(res=>{
+ this.tui.toast('该货号被页面其他商品占用,请重新输入!')
+ },300)
+ }
+ })
+ if(isTrue == false){
+ this.carList.get(id).productSn = purchaseDetails[0].productSn
}
+
+
// this.carList.get(id).id = purchaseDetails[0].productSn
this.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice
@@ -1159,8 +1474,16 @@
this.carList.get(id).productCount += purchaseDetails[0].stockLogList1[i].productCount
}
this.carList.get(id).price1 = this.carList.get(id).productCount * this.carList.get(id).purchasePrice
+ // if (purchaseDetails[0].productId) {
+ // this.carList.get(id).id = purchaseDetails[0].productId
+ // } else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn ==
+ // null || purchaseDetails[0].productSn == '货号') {
+ // this.carList.get(id).id = purchaseDetails[0].productName
+ // } else if (purchaseDetails[0].productSn) {
+ // this.carList.get(id).id = purchaseDetails[0].productSn
+ // }
+
this.getAllPrice()
- console.log('carList',this.carList)
this.oneGoodsId = ''
}else{
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
@@ -1183,8 +1506,10 @@
productSn: purchaseDetails[i].productSn,
productPicture: purchaseDetails[i].productPicture,
supplierName: purchaseDetails[i].supplierName,
+ productPictures:[],
saleDetailQueryDTO: []
}
+ console.log('data',data)
if (purchaseDetails[i].productId) {
data.id = purchaseDetails[i].productId
} else if (purchaseDetails[i].productSn == '' || purchaseDetails[i].productSn ==
@@ -1193,7 +1518,6 @@
} else if (purchaseDetails[i].productSn) {
data.id = purchaseDetails[i].productSn
}
- console.log('货号', data)
for (let m = 0; m < purchaseDetails[i].stockLogList1.length; m++) {
let list = {
attributeList: this.getAttribute(purchaseDetails[i].stockLogList1[m]
@@ -1211,7 +1535,9 @@
this.carList1.push(data)
}
- this.AiVoice()
+ setTimeout(res=>{
+ this.AiVoice()
+ },300)
}
} else {
@@ -1220,37 +1546,89 @@
}).catch((res) => {
this.tui.toast(res)
})
+ },
+ delItemSn(val){
+ var that = this;
+ uni.showModal({
+ title: "提示",
+ content: "确定删除此条货号规则吗?",
+ success: function(res) {
+ if (res.confirm) {
+ that.tui.request("/app/productSn/checkProductSn", "post", {
+ snPre:val.value
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ that.tui.request("/app/productSn/deleteProductSn", "post", {
+ id:res1.result.id
+ }, false, true).then((res2) => {
+ if (res2.code == 200) {
+ that.tui.toast('删除成功')
+ setTimeout(res=>{
+ that.getSnList()
+ },1000)
+ } else {
+ uni.showToast({
+ title: res2.message,
+ icon: 'none'
+ })
+ }
+ }).catch((res) => {})
+ } else {
+ uni.showToast({
+ title: res1.message,
+ icon: 'none'
+ })
+ }
+ }).catch((res) => {})
+ }
+ }
+ })
+
},
dialogInputConfirm(e) {
if (this.categoryText == '') {
this.tui.toast("请输入规格值后提交")
return
- }
- this.tui.request("/app/productAttributeValue/save", "post", {
- value: this.categoryText,
- attributeId: this.isOpenId
- }, false, true).then((res) => {
- if (res.code == 200) {
-
- this.categoryText = ''
- this.$refs.inputDialog.close()
- if (this.isBottom) { //底部弹起的规格选择弹层
- this.getById(this.goodsDetail, 1)
- } else {
- this.getGategoryLowList()
- }
- this.$forceUpdate()
- uni.showToast({
- title: "添加成功",
- icon: 'none'
- })
- } else {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- }).catch((res) => {})
+ }
+ //this.goodsDetail[0] 颜色
+ //this.goodsDetail[1] 尺码
+ let data = {
+ isChecked:false,
+ value:this.categoryText
+ }
+ console.log('shuju',data)
+ if(this.isOpenId == '0'){
+ this.goodsDetail.attributeList[0].value.push(data)
+ }else if(this.isOpenId == '1'){
+ this.goodsDetail.attributeList[1].value.push(data)
+ }
+ this.$forceUpdate()
+ console.log('颜色',this.goodsDetail)
+ // this.tui.request("/app/productAttributeValue/save", "post", {
+ // value: this.categoryText,
+ // attributeId: this.isOpenId
+ // }, false, true).then((res) => {
+ // if (res.code == 200) {
+
+ // this.categoryText = ''
+ // this.$refs.inputDialog.close()
+ // if (this.isBottom) { //底部弹起的规格选择弹层
+ // this.getById(this.goodsDetail, 1)
+ // } else {
+ // this.getGategoryLowList()
+ // }
+ // this.$forceUpdate()
+ // uni.showToast({
+ // title: "添加成功",
+ // icon: 'none'
+ // })
+ // } else {
+ // uni.showToast({
+ // title: res.message,
+ // icon: 'none'
+ // })
+ // }
+ // }).catch((res) => {})
},
dialogClose() {
this.inputVal = '';
@@ -1384,13 +1762,13 @@
let multipleList = [{
attributeName: '颜色',
productAttributeValueVoList: [{
- checked: true,
+ isChecked: true,
value: "均色"
}]
}, {
attributeName: '尺码',
productAttributeValueVoList: [{
- checked: true,
+ isChecked: true,
value: "均码"
}]
}]
@@ -1453,8 +1831,6 @@
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 = ''
@@ -1552,7 +1928,8 @@
} else {
this.goodsList[index].specs.push(data1)
}
- let jishuqi = 0
+ let jishuqi = 0
+ console.log(this.goodsList)
for (var i = 0; i < this.goodsList.length; i++) {
if (this.goodsList[i].specs.length > 0) {
jishuqi++
@@ -1581,7 +1958,7 @@
value.push(value1)
this.evalue.push(name)
}
-
+ console.log('value',value)
if (jishuqi == 0) {
this.oldTemList = []
}
@@ -1685,7 +2062,7 @@
this.current = e.detail.current
},
clickItem(e) {
- this.current = e
+ this.swiperDotIndex = e
},
//弹出商品规格选择
toggle(type, id) {
@@ -1752,7 +2129,6 @@
// 识别结束事件
manager.onStop = (res) => {
let convertedStr = this.spliceMsg(this.convertChineseToArabic(res.result));
- console.log(convertedStr)
if (convertedStr.indexOf('点') != -1) {
convertedStr = that.replaceCharAfterNumber(convertedStr, '点', '.')
}
@@ -1792,10 +2168,11 @@
convertedStr = this.convertStringCorrectly(convertedStr)
if (convertedStr.indexOf(',') == 0) {
- console.log('位置', convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
}
-
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
if (that.voiceText == '' || that.voiceText == null) {
that.voiceText = convertedStr
} else {
@@ -1873,14 +2250,12 @@
'实件': '10件',
'景': '#',
'警': '#',
- '颈': '#',
+ '颈': '#',
+ '括号':'货号'
};
- const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈)/g;
+ const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈|括号)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
- shiqujiaodian(e) {
- console.log("11111", e);
- },
//合并已有
clickMerge(value, key) {
let that = this;
@@ -1902,26 +2277,25 @@
this.getAllPrice()
this.$refs.mergePopup.close()
},
- AiAddSpec(value) {
- if (value.categoryId == '' || value.categoryId == null) {
- this.tui.toast('请先选择商品分类')
- return;
- }
- console.log(value);
+ AiAddSpec(value) {
+ console.log('添加规格',value)
this.getById(value, 1);
},
- pictureAdd(id) {
+ pictureAdd(id,huan) {
let that = this
- if(id != ''){ //上传子图
+ if(id != ''){ //上传多图
this.childrenId = id
- if(this.carList.get(id).childrenList.length > 0){
- this.childrenList = this.carList.get(id).childrenList
+ if(this.carList.get(id).productPictures.length > 0 && huan !='huan'){
+ console.log('productPictures',this.carList.get(id).productPictures)
+ this.productPictures = this.carList.get(id).productPictures
this.$refs.showImgDiaLog.open()
return;
+ }else if(huan == 'huan'){
+ this.$refs.showImgDiaLog.close()
}
- }
-
-
+ }else{
+ this.childrenId = ''
+ }
uni.chooseMedia({
count: 9,
mediaType: ['image'],
@@ -1930,16 +2304,17 @@
uni.showLoading({
title: '加载中...',
mask:true
- })
- console.log(res.tempFiles) //数组,取tempFilesPath
- for(let i=0;i {
let pathData = JSON.parse(uploadFileRes.data)
- console.log('pathData',pathData)
if(that.childrenId != ''){
- that.carList.get(that.childrenId).childrenList.push(pathData.result)
+ let data = {
+ productPicture:pathData.result
+ }
+ that.carList.get(that.childrenId).productPictures.push(data)
that.$forceUpdate()
}else{
- that.addPageGoods(pathData.result)
+ setTimeout(function() {
+ that.isSnList(pathData.result)
+ }, 500 * time);
+
+ // that.addPageGoods(pathData.result)
}
- console.log('carList子图',that.carList)
},
fail: (err) => {
uni.hideLoading();
@@ -1979,83 +2359,162 @@
let that = this;
uni.showLoading({
title: '加载中...'
- })
- this.isBottom = false
- if (current == 1) {
- that.goodsDetail = id;
- } else {
- this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
- if (res.code == 200) {
- if (res.result.delFlag == 0) {
- that.tui.toast("请将商品上架后再操作!")
- return
- }
- that.goodsDetail = res.result;
- } else {
- this.tui.toast(res.message)
- }
- }).catch((res) => {})
+ })
+
+ this.isBottom = false
+ //判断isNew,新商品直接调店铺颜色库
+ if(current == 1){
+ that.goodsDetail = id;
+ that.goodsDetail.attributeList = []
+ if(this.goodsDetail.isNew){
+ this.goodsList = []
+ that.goodsDetail.attributeList = this.defaultList
+ for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
+ // let oldCheck = false
+ // let oldValue = []
+ for (var m = 0; m < that.goodsDetail.attributeList[i].value.length; m++) {
+
+ that.dataObj.set(that.goodsDetail.attributeList[i].value[m].value,that.goodsDetail.attributeList[i].name)
+ // if (that.goodsDetail.attributeList[i].value[m].isChecked == true) {
+ // oldCheck = true
+ // oldValue.push(that.goodsDetail.attributeList[i].value[m].value)
+ // }
+ }
+ let specs1 = {
+ specs: []
+ }
+ that.goodsList.push(specs1)
+ // oldCheck = false
+ // oldValue = []
+ }
+ }else{
+ that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
+ "POST", {
+ categoryId: that.goodsDetail.categoryId
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ that.goodsList = []
+ if (typeof(res1.result) == 'string') {
+ let newObj = JSON.parse(res1.result)
+ let newArr = []
+ let dataArr = []
+ for (let val in newObj) {
+ let valueObj = [];
+ for (var i = 0; i < newObj[val].length; i++) {
+ valueObj.push({
+ value: newObj[val][i],
+ isChecked: false
+ })
+ that.dataObj.set(newObj[val][i], val)
+ }
+ newArr.push({
+ name: val,
+ value: valueObj
+ })
+ }
+ console.log('dataObj',that.dataObj)
+ that.goodsDetail.attributeList = newArr;
+ for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
+ // let oldCheck = false
+ // let oldValue = []
+ // for (var m = 0; m < that.goodsDetail.attributeList[i].value
+ // .length; m++) {
+ // if (that.goodsDetail.attributeList[i].value[m]
+ // .isChecked == true) {
+ // oldCheck = true
+ // oldValue.push(that.goodsDetail.attributeList[i]
+ // .value[m].value)
+ // }
+ // }
+ let specs1 = {
+ specs: []
+ }
+ that.goodsList.push(specs1)
+ // oldCheck = false
+ // oldValue = []
+ }
+ } else {
+ that.tui.toast('失败了')
+ }
+
+ } else {
+ that.tui.toast(res1.message)
+ }
+ }).catch((res) => {})
+ }
+
+ }else{
+ this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result.delFlag == 0) {
+ that.tui.toast("请将商品上架后再操作!")
+ return
+ }
+ that.goodsDetail = res.result;
+ that.goodsDetail.attributeList = this.defaultList
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ this.$nextTick(() => {
+ setTimeout(res => {
+ that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
+ "POST", {
+ categoryId: that.goodsDetail.categoryId
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ that.goodsList = []
+ if (typeof(res1.result) == 'string') {
+ let newObj = JSON.parse(res1.result)
+ let newArr = []
+ let dataArr = []
+ for (let val in newObj) {
+ let valueObj = [];
+ for (var i = 0; i < newObj[val].length; i++) {
+ valueObj.push({
+ value: newObj[val][i],
+ isChecked: false
+ })
+ that.dataObj.set(newObj[val][i], val)
+ }
+ newArr.push({
+ name: val,
+ value: valueObj
+ })
+ }
+ that.goodsDetail.attributeList = newArr;
+ for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
+ // let oldCheck = false
+ // let oldValue = []
+ // for (var m = 0; m < that.goodsDetail.attributeList[i].value
+ // .length; m++) {
+ // if (that.goodsDetail.attributeList[i].value[m]
+ // .isChecked == true) {
+ // oldCheck = true
+ // oldValue.push(that.goodsDetail.attributeList[i]
+ // .value[m].value)
+ // }
+ // }
+ let specs1 = {
+ specs: []
+ }
+ that.goodsList.push(specs1)
+ // oldCheck = false
+ // oldValue = []
+ }
+ } else {
+ that.tui.toast('失败了')
+ }
+
+ } else {
+ that.tui.toast(res1.message)
+ }
+ }).catch((res) => {})
+ }, 300)
+ })
}
- this.$nextTick(() => {
- setTimeout(res => {
- that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
- "POST", {
- categoryId: that.goodsDetail.categoryId
- }, false, true).then((res1) => {
- if (res1.code == 200) {
- that.goodsList = []
- if (typeof(res1.result) == 'string') {
- let newObj = JSON.parse(res1.result)
- let newArr = []
- let dataArr = []
- for (let val in newObj) {
- let valueObj = [];
- for (var i = 0; i < newObj[val].length; i++) {
- valueObj.push({
- value: newObj[val][i],
- isChecked: false
- })
- that.dataObj.set(newObj[val][i], val)
- }
- newArr.push({
- name: val,
- value: valueObj
- })
- }
- that.goodsDetail.attributeList = newArr;
- for (var i = 0; i < that.goodsDetail.attributeList
- .length; i++) {
- let oldCheck = false
- let oldValue = []
- for (var m = 0; m < that.goodsDetail.attributeList[i].value
- .length; m++) {
- if (that.goodsDetail.attributeList[i].value[m]
- .isChecked == true) {
- oldCheck = true
- oldValue.push(that.goodsDetail.attributeList[i]
- .value[m].value)
- }
- }
- let specs1 = {
- specs: []
- }
- that.goodsList.push(specs1)
- oldCheck = false
- oldValue = []
- }
- } else {
- that.tui.toast('失败了')
- }
-
- } else {
- that.tui.toast(res1.message)
- }
- }).catch((res) => {})
- }, 300)
- })
this.pageOldTemList = []
that.temporaryList = []
- console.log('1111', that.carList)
if (that.carList.size > 0) {
let isArgin = false
that.carList.forEach(function(value, key) {
@@ -2095,7 +2554,6 @@
that.oldTemList = value.stockLogList1
isArgin = true
} else {
- console.log()
if (value.isNew) {
if (value.id == id.id) {
that.zNum = value.productCount
@@ -2120,11 +2578,8 @@
}
})
- // console.log('2222',that.carList)
that.zNum = 0
- // console.log('id',id)
// that.$nextTick(() => {
- // console.log("carList",that.carList)
// that.carList.forEach(function(value, key) {
// })
@@ -2133,28 +2588,59 @@
setTimeout(res => {
this.getKCList(current == 1 ? id.id : id);
}, 300)
- },
- addPageGoods(path) {
- console.log(path)
+ },
+ changeSn(){
+
+ },
+ //新增商品的时候,判断有没有货号生成规则,没有则弹出货号新增弹出层
+ async isSnList(img){
+ if(this.isGenerateSnRadio == 1){ //不自动生成货号
+ await this.addPageGoods(img,'')
+ }else{
+ if(this.snList.length > 0){
+ await this.getNewSn(img)
+ }else{
+ this.zhuImg = img
+ this.$refs.SNDialog.open('center')
+ }
+ }
+
+ },
+ //获取新货号
+ getNewSn(img){
+ this.tui.request("/app/productSn/getNewProductSn", "POST", {
+ snPre: this.snName
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.addPageGoods(img,res.result)
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //getNewProductSnMore count/snPre
+ addPageGoods(path,sn) {
let obj = {
id: generateUUID(),
purchasePrice: 0, //进货价
- price: 0,
+ price: 0,
+ price1:0,
+ categoryName: this.categoryList.categoryName,
+ categoryId: this.categoryList.categoryId,
productCount: 0,
productId: "",
productName: "",
wholesalePrice: 0,
lsprice: 0,
isNew: true,
- childrenList:[],
+ productPictures:[],
productPicture: path?path:'',
- productSn: "",
+ productSn: sn?sn:"",
stockLogList: new Map(),
stockLogList1: []
}
this.carList.set(obj.id, obj)
this.$forceUpdate()
- console.log('carList', this.carList)
},
//库存商品详情
getKCList(id) {
@@ -2175,7 +2661,6 @@
}, 200)
},
temporaryChange(val, item) {
- console.log(item)
if (item != '' && item != undefined) {
for (var m = 0; m < this.pageOldTemList.length; m++) {
if (item.attributeList == this.pageOldTemList[m].attributeList) {
@@ -2205,7 +2690,6 @@
title: '加载中...'
})
this.evalue = []
- console.log(this.temporaryList)
let that = this,
carList1 = []
let data = {
@@ -2217,11 +2701,12 @@
wholesalePrice: this.goodsDetail.wholesalePrice,
purchasePrice: this.goodsDetail.purchasePrice,
categoryName: this.goodsDetail.categoryName,
- categoryId: this.carList1.categoryId,
+ categoryId: this.goodsDetail.attrId,
lsprice: this.goodsDetail.price,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
- supplierName: this.goodsDetail.supplierName,
+ supplierName: this.goodsDetail.supplierName,
+ productPictures:[],
saleDetailQueryDTO: this.temporaryList
}
carList1.push(data)
@@ -2246,12 +2731,13 @@
productId: carList1[i].id,
wholesalePrice: this.goodsDetail.wholesalePrice,
categoryName: this.goodsDetail.categoryName,
- categoryId: this.goodsDetail.categoryId,
+ categoryId: this.goodsDetail.attrId,
lsprice: this.goodsDetail.price,
productName: carList1[i].productName,
productPicture: carList1[i].productPicture,
productSn: carList1[i].productSn,
- stockLogList: new Map(),
+ stockLogList: new Map(),
+ productPictures:[],
stockLogList1: []
}
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
@@ -2271,8 +2757,6 @@
} else { //当前页有数据
for (let i = 0; i < carList1.length; i++) {
- console.log('stockLogList', this.carList)
- console.log('stockLogList', carList1[i].id)
if (this.carList.has(carList1[i].id) == true) {
this.carList.get(carList1[i].id).stockLogList = new Map()
}
@@ -2318,14 +2802,15 @@
price1: 0,
productCount: 0,
productId: carList1[i].id,
- categoryId: this.goodsDetail.categoryId,
+ categoryId: this.goodsDetail.attrId,
productName: carList1[i].productName,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price,
productPicture: carList1[i].productPicture,
stockLogList: new Map(),
productSn: carList1[i].productSn,
- stockLogList1: [],
+ stockLogList1: [],
+ productPictures:[],
name: ''
}
@@ -2363,23 +2848,54 @@
}
this.alreadyPay = this.shouldPay
this.noPay = this.shouldPay - this.alreadyPay;
+ },
+ sninput(e ,id){
+ console.log(e.detail.value)
+ this.carList.get(id).productSn = e.detail.value
+ this.$forceUpdate()
},
//货号是否重复
- getSnIsRepeat(e, id) {
- this.tui.request('/app/product/getByProductSn', "post", {
- productSn: e.detail.value
- }, false, true).then((res1) => {
- if (res1.code == 200) {
- if (res1.result != '') {
- this.tui.toast('当前货号已被商品:“' + res1.result[0].productName + '”占用,请重新输入')
- this.carList.get(id).productSn = ""
- this.$forceUpdate()
- } else {
- this.carList.get(id).productSn = e.detail.value
- }
-
- }
- })
+ getSnIsRepeat(e, id) {
+ let that = this;
+ if(e.detail.value != ''){
+ this.tui.request('/app/product/getByProductSn', "post", {
+ productSn: e.detail.value
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ if (res1.result != '') {
+ that.tui.toast('当前货号已被商品:“' + res1.result[0].productName + '”占用,请重新输入')
+ setTimeout(res=>{
+ that.carList.get(id).productSn = ''
+ },100)
+
+ setTimeout(res=>{
+ that.$forceUpdate()
+ },300)
+ }
+ // else {
+ // that.carList.get(id).productSn = e.detail.value
+ // }
+
+ }
+ })
+ this.carList.forEach(function(value, key) {
+ if(value.id != id){
+ if(value.productSn == e.detail.value){
+ that.tui.toast('该货号被页面其他商品占用,请重新输入!')
+ setTimeout(res=>{
+ that.carList.get(id).productSn = ''
+ },100)
+ setTimeout(res=>{
+ that.$forceUpdate()
+ },300)
+
+ }
+ }
+ })
+
+ }
+ console.log('点击',this.carList)
+
},
getName(e, id) {
this.carList.get(id).productName = e.detail.value
@@ -2512,7 +3028,8 @@
supplierName: this.khName.consigneeName
}
let purchaseDetails = [];
- let jishuqi = 0
+ let jishuqi = 0
+ console.log('carList',this.carList)
this.carList.forEach(function(value, key) {
// if(value.productName == ''){
// uni.showToast({
@@ -2552,22 +3069,34 @@
// })
// return
// }
- if ((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value
- .productId == '')) {
- that.tui.toast(value.productName + "分类未维护~")
- return;
- }
- value.stockLogList.forEach(function(values, keys) {
- if (values <= 0) {
- that.tui.toast("入库数量不能为零~")
- return;
- }
- let obj = {
- productCount: values.productCount,
- attributeList: keys
- }
- value.stockLogList1.push(obj)
- })
+ // if ((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value
+ // .productId == '')) {
+ // that.tui.toast(value.productName + "分类未维护~")
+ // return;
+ // }
+ if(value.stockLogList.size == 0){
+ let obj = {
+ productCount: 1,
+ attributeList: '{"颜色":"均色","尺码":"均码"}'
+ }
+ value.productCount = 1
+ value.price1 = value.productCount * value.purchasePrice
+ value.stockLogList1.push(obj)
+ }else{
+ value.stockLogList.forEach(function(values, keys) {
+ console.log('values',values)
+ if (values <= 0) {
+ that.tui.toast("入库数量不能为零~")
+ return;
+ }
+ let obj = {
+ productCount: values.productCount,
+ attributeList: keys
+ }
+ value.stockLogList1.push(obj)
+ })
+ }
+
// delete value.id;
purchaseDetails.push(value)
jishuqi++
@@ -2645,6 +3174,10 @@
this.alreadyPay = this.shouldPay
that.noPay = this.shouldPay - this.alreadyPay
this.$forceUpdate()
+ },
+ //选择是否需要自动生成货号
+ isChange(index) {
+ this.isGenerateSnRadio = index
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
@@ -3110,7 +3643,6 @@
}
.scroll-content {
- padding-top: 390rpx;
height: 90%;
}
@@ -3269,5 +3801,38 @@
.showImg-box{
width: 500rpx;
height: 500rpx;
+ }
+ @media screen and (min-width: 500px) {
+ .uni-swiper-dot-box {
+ width: 400px;
+ margin: 0 auto;
+ margin-top: 8px;
+ }
+
+ .image {
+ width: 100%;
+ }
+ }
+ .swiper-box {
+ height: 200px;
+ }
+ .swiper-item {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 200px;
+ color: #fff;
+ background-color: #cee1fd;
+ }
+ .lb-btn{
+ width: 100%;
+ height: 100rpx;
+ text-align: center;
+ line-height: 100rpx;
+ background: #088FEB;
+ color: #fff;
+ border-bottom-left-radius: 10px;
+ border-bottom-right-radius: 10px;
}
\ No newline at end of file
diff --git a/package1/AI/voiceInventory.vue b/package1/AI/voiceInventory.vue
index fa43e1a..a50d6fe 100644
--- a/package1/AI/voiceInventory.vue
+++ b/package1/AI/voiceInventory.vue
@@ -2,135 +2,204 @@
-
-
- 供应商
-
-
-
-
+
+
+ 供应商
+
+
+
-
-
-
-
- 扫一扫
-
-
-
- 添加商品
-
-
+
+
+ 生成货号
+
+
+
+
-
-
-
-
-
-
- AI语音入库
-
-
- 您可以语音录入商品进行识别入库
-
-
-
-
-
+
+ 货号规则
+
+
+
+
+
+
+ 扫一扫
+
+
+
+ 图片添加
+
+
+
+ 新增商品
+
+
+
+ 选库存
+
+
+
+
+
+
+
+
+
+ AI语音入库
+
+
+ 您可以语音录入商品进行识别入库
+
+
+
+
+
+
-
- 新
-
-
-
-
-
-
-
- 删除
- 合并
+
+ 新
+
+
+
+
+
+
+
+
+ 删除
+
+
+ 合并
+
+
+ 上传多图
+
+ {{value[1].productPictures.length}}
+
+
-
-
-
-
- {{value[1].productCount}}
+
+
+
+
+ {{value[1].productCount}}
-
- 品名:
-
-
-
- 货号:
-
-
-
- 分类: {{value[1].categoryName==null?'':value[1].categoryName}}
-
+
+ 品名:
+
+
+
+ 货号:
+
+
+
+
+ 分类: {{value[1].categoryName==null?'':value[1].categoryName}}
+
-
- 单价:
-
-
- 批发价:
- 零售价:
+
+ 单价:
+
+
+ 批发价:
+ 零售价:
-
- 添加规格
+
+ 语音录入
+
+
+ 添加规格
-
-
-
-
-
-
- {{numData(values[0])[0]}}
-
-
- {{numData(values[0])[1]}}
-
-
-
-
-
+
+
+
+
+
+
+ {{numData(values[0])[0]}}
+
+
+ {{numData(values[0])[1]}}
+
+
+
+
+
-
+
应付金额
-
+
已付金额
-
+
欠款
-
+
其他费用
-
+
@@ -140,8 +209,8 @@
-
-
+
+
@@ -169,16 +238,19 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
- 语音识别中...
-
+
+
+
+
+
+
+
+
+
+
+ 更换图片
+
+
+
+
+ 语音识别中...
+
貌似没有检测到您上次的语音录入信息,正在反复识别中
@@ -382,18 +514,20 @@