diff --git a/package1/AI/AIHangOrderList.vue b/package1/AI/AIHangOrderList.vue
index 4926467..fddf8ea 100644
--- a/package1/AI/AIHangOrderList.vue
+++ b/package1/AI/AIHangOrderList.vue
@@ -918,8 +918,9 @@
}
this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value)
- })
- if (item.saleDetailDTOList) {
+ })
+
+ if (item.saleDetailDTOList.length>0) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
@@ -940,7 +941,8 @@
num++
}
- }
+ }
+ obj.attrId = item.saleDetailDTOList[i].attrId
obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
@@ -954,7 +956,7 @@
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
- obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice
+ obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark
@@ -962,7 +964,7 @@
obj.createByName = item.createByName
dataList.push(obj)
}
- } else {
+ } else {
let obj = {}
obj.num = 0
obj.price = 0
@@ -971,26 +973,28 @@
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
- }
- this.$nextTick(()=>{
- this.tui.request("/app/customer/list", "post", {
- notBuyDays: "",
- pageNum: 1,
- pageSize: 10,
- searchStr: item.userName,
- sort: "",
- }, false, false).then((res) => {
- if (res.code == 200) {
- this.returnList = new Map()
- uni.setStorageSync('khName', JSON.stringify(res.result.records[0]))
- uni.setStorageSync('carList1', JSON.stringify(dataList))
- uni.setStorageSync('hangOrder', true)
- uni.switchTab({
- url: '/pages/inventory/goodsList1'
- })
- }
- })
- })
+ }
+ setTimeout(res11=>{
+ this.tui.request("/app/customer/list", "post", {
+ notBuyDays: "",
+ pageNum: 1,
+ pageSize: 10,
+ searchStr: item.userName,
+ sort: "",
+ }, false, false).then((res) => {
+ if (res.code == 200) {
+ this.returnList = new Map()
+ console.log('dataList',dataList)
+ uni.setStorageSync('khName', JSON.stringify(res.result.records[0]))
+ uni.setStorageSync('carList1', JSON.stringify(dataList))
+ uni.setStorageSync('hangOrder', true)
+ uni.switchTab({
+ url: '/pages/inventory/goodsList1'
+ })
+ }
+ })
+ },500)
+
},
//点击切换折叠状态
clickCollapse(item,index) {
diff --git a/package1/AI/addAiList.vue b/package1/AI/addAiList.vue
index ba50ef3..b3413b8 100644
--- a/package1/AI/addAiList.vue
+++ b/package1/AI/addAiList.vue
@@ -2,7 +2,7 @@
-
+
寄
@@ -186,6 +186,7 @@
语音识别中...
貌似没有检测到您上次的语音录入信息,正在反复识别中
+
@@ -200,7 +201,10 @@
voiceData: {},
recordState: false,
productPicture: [],
- messages:['消息1', '消息2', '消息3']
+ canvas: null,
+ tempFilePath: '',
+ messages: ['消息1', '消息2', '消息3'],
+ base64:''
}
},
onShow() {
@@ -215,8 +219,113 @@
})
},
onLoad(option) {
+ this.getUserData()
},
methods: {
+ getUserData(){
+ console.log(__wxConfig.envVersion)
+ uni.request({
+ url: 'https://api.weixin.qq.com/cgi-bin/token',
+ data: {
+ grant_type: 'client_credential',
+ appid: 'wx6d7d4fb58d1502db',
+ secret: '3a2c8cd00926764bbd12fd7361e01f1d'
+ },
+ method: 'GET',
+ dataType: 'json',
+ success: (res) => {
+ console.log('access_token',res.data.access_token)
+ uni.request({
+ url: 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' + res.data
+ .access_token,
+ data: {
+ page: 'package1/index/downStearmList',
+ scene:'khid=1833763951914127361',
+ env_version: "develop",
+ },
+ responseType: 'arraybuffer',
+ method: 'POST',
+ dataType: 'json',
+ success: (res1) => {
+ let base64 = wx.arrayBufferToBase64(res1.data)
+ console.log('base64',base64)
+ const time = new Date().getTime();
+ const imgPath = wx.env.USER_DATA_PATH + "/poster" + time + "share" + ".png";
+ const file = wx.getFileSystemManager();
+ file.writeFileSync(imgPath, base64, "base64");
+ this.base64 = imgPath
+ },
+ fail: (res) => {
+ this.tui.toast("网络不给力,请稍后再试~")
+ }
+ })
+ },
+ fail: (res) => {
+ this.tui.toast("网络不给力,请稍后再试~")
+ }
+ })
+ },
+ getData() {
+ let that = this
+ uni.showLoading({
+ title:'生成中...'
+ })
+ const ctx = uni.createCanvasContext('myCanvas', this);
+ //背景图
+ let imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg';
+ uni.downloadFile({
+ url: imgA,
+ success: (res2) => {
+
+ if (res2.statusCode === 200) {
+ // // 绘制第一张图片
+ ctx.drawImage(res2.tempFilePath, 0, 0, 1700, 2200);
+ ctx.draw()
+ // 绘制第二张图片
+ ctx.drawImage(that.base64, 650, 850, 400, 400);
+ ctx.draw(true);
+ // 设置字体样式
+ ctx.font = 'bold 200px SimSun';
+ // 设置文字颜色
+ ctx.fillStyle = '#088FEB';
+
+ var text = '天逸的店';
+ var textWidth = ctx.measureText(text).width;
+ console.log(textWidth)
+ // 计算居中位置
+ var x = (1700 - textWidth) / 2;
+
+ // 绘制文字
+ ctx.fillText(text, x, 700);
+ ctx.draw(true)
+ setTimeout(ress=>{
+ uni.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 1700,
+ height: 2200,
+ destWidth: 1701,
+ destHeight: 2200,
+ canvasId: 'myCanvas',
+ success: (res3) => {
+ uni.previewImage({
+ urls: [res3.tempFilePath]
+ })
+ uni.hideLoading()
+ // uni.saveImageToPhotosAlbum({
+ // filePath: res3.tempFilePath,
+ // success: function () {
+ // console.log('save success');
+ // }
+ // });
+ }
+ });
+ },500)
+ }
+ }
+ });
+
+ },
//按住语音识别,开始
kaishi() {
if (this.isVoice == false) {
diff --git a/package1/AI/voiceInventory.vue b/package1/AI/voiceInventory.vue
index c9ef911..9ad7a48 100644
--- a/package1/AI/voiceInventory.vue
+++ b/package1/AI/voiceInventory.vue
@@ -2,7 +2,8 @@
-
+
供应商
@@ -72,8 +73,7 @@
-
+
@@ -162,6 +162,10 @@
@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;">
+
语音录入
@@ -173,6 +177,22 @@
+
+
+
+ 规格
+
+
+ 库存
+
+
+
+ 数量
+
+
@@ -185,6 +205,9 @@
{{numData(values[0])[1]}}
+
+ {{values[1].productNum == null ?'无库存':values[1].productNum}}
+
@@ -420,7 +440,20 @@
-
+
+
+
+
-
+
@@ -748,11 +781,14 @@
otherPay: '',
noPay: 0,
promptImg: '',
+ customerCategoryList:[],
+ customerCategoryList1:[], //存放金额为空的客户分类,用于新增商品
alreadyPay: '',
realAmount: 0,
shouldPay: '',
userType: '',
totalAmount: 0,
+ customTypeId:'',
index: '',
index1: '',
recordState: false,
@@ -863,9 +899,10 @@
if (that.mergeId != that.carList1.id) {
that.carList.get(that.carList1.id).stockLogList.get(key).productCount =
Number(that.carList.get(that.carList1.id).stockLogList.get(key)
- .productCount) + Number(value1.productCount)
+ .productCount) + Number(value1.productCount)
isTrue = true
- that.carList.get(that.carList1.id).productCount += Number(value1.productCount)
+ that.carList.get(that.carList1.id).productCount += Number(value1
+ .productCount)
}
}
})
@@ -891,7 +928,8 @@
if (this.mergeId != this.carList1.id) {
this.carList.delete(this.mergeId)
}
- that.carList.get(that.carList1.id).price1 = Number(that.carList.get(that.carList1.id).productCount) * that.carList
+ that.carList.get(that.carList1.id).price1 = Number(that.carList.get(that.carList1.id).productCount) * that
+ .carList
.get(that.carList1.id).purchasePrice
this.getAllPrice()
setTimeout(res => {
@@ -915,7 +953,7 @@
} else {
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
}
-
+
if (this.khName != '') {
if (this.khName.noEarn != null && this.zhiqianqiankuan != this.khName.noEarn) {
isTrue = true
@@ -926,6 +964,9 @@
this.zhiqianqiankuan = this.khName.noEarn
}
}
+ setTimeout(res => {
+ this.getByCondition()
+ }, 500);
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
@@ -933,6 +974,7 @@
price1: 0,
price: this.carList1[i].price,
productCount: 0,
+ customerCategoryList:this.carList1[i].customerCategoryRule != null?this.carList1[i].customerCategoryRule: this.customerCategoryList1,
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i].id,
isNew: this.carList1[i].isNew, //是否是新商品
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
@@ -951,12 +993,14 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
let productCount = Number(this.carList1[i].saleDetailQueryDTO[m].productCount)
if (obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) {
- productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList)
+ productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m]
+ .attributeList)
.productCount)
}
var data1 = {
productCount: productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this
@@ -978,10 +1022,13 @@
m].attributeList) == true) { //规格相同
var data1 = {
- productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[
- i].saleDetailQueryDTO[m].attributeList).productCount) + Number(this.carList1[i]
+ productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(this
+ .carList1[
+ i].saleDetailQueryDTO[m].attributeList).productCount) + Number(this
+ .carList1[i]
.saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
@@ -989,7 +1036,8 @@
} else { //规格不同
var data1 = {
productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@@ -1007,6 +1055,7 @@
price1: 0,
price: this.carList1[i].price,
productCount: 0,
+ customerCategoryList:this.carList1[i].customerCategoryRule != null?this.carList1[i].customerCategoryRule: this.customerCategoryList1,
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i].id,
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
isNew: this.carList1[i].isNew,
@@ -1026,12 +1075,14 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
- obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this
+ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(
+ this
.carList1[i].saleDetailQueryDTO[m].productCount)
obj.price1 = Number(obj.productCount) * this.carList1[i].purchasePrice
}
@@ -1063,11 +1114,13 @@
}
this.$forceUpdate()
})
+ console.log(this.carList)
},
onLoad(options) {
this.userType = uni.getStorageSync('type')
this.getSnList()
this.getShopCategory()
+ this.getCustomerCategoryList()
this.getDefaultCategory()
this.getMonth()
},
@@ -1080,22 +1133,30 @@
sourceType: ['album'],
camera: 'back',
success(res) {
- uni.uploadFile({
- url: that.tui.interfaceUrl() + '/upload/file',
- filePath: res.tempFiles[0].tempFilePath,
- name: 'file',
- header: {
- "content-type": "multipart/form-data",
- 'accessToken': that.tui.getToken()
- },
- formData: {},
- success: (uploadFileRes) => {
- let path = JSON.parse(uploadFileRes.data)
- //后端返回的地址,存入图片地址
- that.promptImg = path.result
- that.$forceUpdate()
+ uni.compressImage({
+ src: res.tempFiles[0].tempFilePath,
+ quality: 50,
+ success: res1 => {
+
+ uni.uploadFile({
+ url: that.tui.interfaceUrl() + '/upload/file',
+ filePath: res1.tempFilePath,
+ name: 'file',
+ header: {
+ "content-type": "multipart/form-data",
+ 'accessToken': that.tui.getToken()
+ },
+ formData: {},
+ success: (uploadFileRes) => {
+ let path = JSON.parse(uploadFileRes.data)
+ //后端返回的地址,存入图片地址
+ that.promptImg = path.result
+ that.$forceUpdate()
+ }
+ });
}
- });
+ })
+
}
})
},
@@ -1191,6 +1252,34 @@
}
}).catch((res) => {})
},
+ //获取客户分类
+ getCustomerCategoryList(){
+ this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", {
+ shopId:uni.getStorageSync('shopId')
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if(res.result.length > 0){
+ this.customerCategoryList = res.result
+ this.customerCategoryList1 = res.result
+ for(let i=0;i {})
+ },
//店铺默认分类
getDefaultCategory() {
this.tui.request("/app/productCategory/getDefaultCategory", "POST", {}, false, true).then((res) => {
@@ -1289,10 +1378,20 @@
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()
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ this.tui.request('/app/product/getByProductSn', "post", {
+ productSn: res1.result
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result != '') {
+ this.generateSn(value)
+ } else {
+ this.carList.get(id).productSn = res1.result
+ this.$forceUpdate()
+ }
+ }
+ })
} else {
this.tui.toast(res.message)
}
@@ -1315,6 +1414,7 @@
price1: 0,
price: this.carList1[i].price,
productCount: 0,
+ customerCategoryList:this.carList1[i].customerCategoryList != null?this.carList1[i].customerCategoryList: this.customerCategoryList1,
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i].id,
isNew: this.carList1[i].isNew, //是否是新商品
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
@@ -1350,16 +1450,17 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
let productCount = Number(this.carList1[i].saleDetailQueryDTO[m].productCount)
if (obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) {
- productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList)
- .productCount)
+ productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m]
+ .attributeList).productCount)
}
var data1 = {
productCount: productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
- obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this
- .carList1[i].saleDetailQueryDTO[m].productCount)
+ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(
+ this.carList1[i].saleDetailQueryDTO[m].productCount)
obj.price1 = Number(obj.productCount) * this.carList1[i].purchasePrice
}
let id = this.carList1[i].isNew == true ? this.carList1[i].id : this.carList1[i].productId
@@ -1380,23 +1481,28 @@
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
var data1 = {
- productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(this
- .carList1[i].saleDetailQueryDTO[m].attributeList).productCount) + Number(this
- .carList1[i].saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(
+ this
+ .carList1[i].saleDetailQueryDTO[m].attributeList).productCount) +
+ Number(this
+ .carList1[i].saleDetailQueryDTO[m].productCount),
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
} else { //规格不同
var data1 = {
productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
- m].productCount == null ? 0 : Number(this.carList1[i].saleDetailQueryDTO[m].productCount)
+ m].productCount == null ? 0 : Number(this.carList1[i].saleDetailQueryDTO[m]
+ .productCount)
this.carList.get(this.carList1[i].id).price1 = Number(this.carList.get(this.carList1[i].id)
.productCount) * this.carList.get(this.carList1[i].id).purchasePrice
}
@@ -1406,6 +1512,7 @@
price1: 0,
price: this.carList1[i].price,
productCount: 0,
+ customerCategoryList:this.carList1[i].customerCategoryList != null?this.carList1[i].customerCategoryList: this.customerCategoryList1,
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i]
.id,
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
@@ -1426,13 +1533,15 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
- name: this.carList1[i].saleDetailQueryDTO[m].name
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
- obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this
- .carList1[i].saleDetailQueryDTO[m].productCount)
+ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 :
+ Number(this
+ .carList1[i].saleDetailQueryDTO[m].productCount)
obj.price1 = Number(obj.productCount) * this.carList1[i].purchasePrice
}
@@ -1493,7 +1602,7 @@
this.attrList = []
let num = this.temporary[2] == '颜色' ? 0 : 1
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
- categoryId: this.carList.get(this.temporary[0]).categoryId
+ categoryId: this.carList.get(this.temporary[0]).attrId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.attrList.push(res1.result[num])
@@ -1624,6 +1733,12 @@
this.$refs.getaPopup.close()
})
},
+ updateCate(){
+
+ this.carList.get(this.customTypeId).customerCategoryList = this.customerCategoryList
+ this.$refs.customPopup.close()
+ this.$forceUpdate()
+ },
delDefaultCate(index, value, index1) {
let data = this.goodsDetail.attributeList[index].value[index1]
this.goodsDetail.attributeList[index].value.splice(index1, 1);
@@ -1654,6 +1769,36 @@
this.isOpenId = item;
this.$refs.inputDialog.open('bottom')
},
+ //弹出客户分类弹窗
+ addCustomPrice(id){
+ this.customTypeId = id
+ console.log(this.carList.get(id))
+ this.customerCategoryList = this.carList.get(id).customerCategoryList
+ this.$refs.customPopup.open()
+ },
+ getByCondition() {
+ this.tui.request("/app/supplier/getByCondition", "post", {
+ searchStr: this.khName.consigneeName,
+ pageNumber: 1,
+ pageSize: 10
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ for (let i = 0; i < res.result.content.length; i++) {
+ if (res.result.content[i].id == this.khName.id) {
+
+ this.khName.noEarn = res.result.content[i].noEarn
+ this.zhiqianqiankuan = res.result.content[i].noEarn
+ }
+ }
+
+ } else {
+ uni.showToast({
+ title: res.message,
+ icon: 'none'
+ })
+ }
+ }).catch((res) => {})
+ },
//保存已选
saveCheck() {
this.pageOldTemList = this.temporaryList
@@ -1678,7 +1823,8 @@
this.voiceText1 = ''
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(item.productCount)
+ productCount: Number(item.productCount) || 1,
+ productNum:item.defaultStockCount
}
item.productId = item.id
item.saleDetailQueryDTO = []
@@ -1708,7 +1854,8 @@
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(item.productCount)
+ productCount: Number(item.productCount) || 1,
+ productNum:item.defaultStockCount
}
item.productId = item.id
item.saleDetailQueryDTO = []
@@ -1739,6 +1886,10 @@
}
let convertedStr = this.trimWhitespace(this.voiceText);
convertedStr = this.convertChineseToArabic(convertedStr);
+ if (convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 && convertedStr.indexOf(
+ '单价') == -1 && convertedStr.indexOf('批发价') == -1) {
+ convertedStr = convertedStr + ','
+ }
if (convertedStr.indexOf('点') != -1) {
convertedStr = this.replaceCharAfterNumber(convertedStr, '点', '.')
}
@@ -1804,6 +1955,12 @@
if (convertedStr.indexOf('批发价') != -1) {
convertedStr = convertedStr.replace(/批发价/g, ',批发价:')
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
+ if (!convertedStr.startsWith("货号")) {
+ convertedStr = "货号" + convertedStr;
+ }
if (convertedStr.indexOf('货号,') != -1) {
convertedStr = convertedStr.replace(/货号,/g, '货号')
}
@@ -1818,9 +1975,6 @@
if (convertedStr.indexOf(',') == 0) {
convertedStr = convertedStr.substr(1)
}
- if (convertedStr.startsWith("号")) {
- convertedStr = "货号" + convertedStr.substr(1);
- }
this.getMsg = convertedStr
let regexCount = /-?\d+/g;
if (this.isQuantityFollowsProductCode(convertedStr) || (convertedStr.indexOf('色') == -1 && convertedStr
@@ -1841,7 +1995,7 @@
}
if (voiceData.purchasePrice) {
voiceData.purchasePrice = this.replaceCharAfterNumber(voiceData
- .purchasePrice, '块','.')
+ .purchasePrice, '块', '.')
if (voiceData.purchasePrice.indexOf('元') != -1) {
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '')
}
@@ -1850,7 +2004,7 @@
}
if (voiceData.wholesalePrice) {
voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData
- .wholesalePrice, '块','.')
+ .wholesalePrice, '块', '.')
if (voiceData.wholesalePrice.indexOf('元') != -1) {
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
}
@@ -1878,17 +2032,20 @@
}
if (voiceData.purchasePrice) {
voiceData.purchasePrice = this.replaceCharAfterNumber(voiceData
- .purchasePrice, '块','.')
+ .purchasePrice, '块', '.')
if (voiceData.purchasePrice.indexOf('元') != -1) {
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '')
}
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
-
+ voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g,
+ "");
+
}
if (voiceData.wholesalePrice) {
- voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData.wholesalePrice,'块', '.')
+ voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData
+ .wholesalePrice, '块', '.')
if (voiceData.wholesalePrice.indexOf('元') != -1) {
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
+ voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g,
+ '')
}
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g,
"");
@@ -1900,462 +2057,526 @@
if (res.result != '') {
this.voiceText = ''
this.$refs.popup.close()
-
- let data = {
- attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount),
- stockCount: null
- }
- if (voiceData.purchasePrice) {
- voiceData.purchasePrice = this.replaceCharAfterNumber(voiceData
- .purchasePrice, '块','.')
- if (voiceData.purchasePrice.indexOf('元') != -1) {
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '')
- }
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
-
- }
- if (voiceData.wholesalePrice) {
- voiceData.wholesalePrice = this
- .replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.')
- if (voiceData.wholesalePrice.indexOf('元') != -1) {
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
- }
- voiceData.wholesalePrice = voiceData.wholesalePrice
- .replace(
- /[^0-9.]/g, "");
- }
- res.result[0].productId = res.result[0].id
- res.result[0].stockLogList1 = []
- res.result[0].stockLogList1.push(data)
- let purchaseDetails = res.result
- if (this.oneGoodsId) {
- let id = this.oneGoodsId
- if (purchaseDetails.length > 0) {
- if (this.carList.get(id).productSn != '') {
- for (let j = 0; j < purchaseDetails
- .length; j++) {
- for (let i = 0; i < purchaseDetails[j]
- .stockLogList1.length; i++) {
- if (this.carList.get(id)
- .productName == '') {
- this.carList.get(id)
- .productName =
- purchaseDetails[0]
- .productName
- }
- if (this.carList.get(id).attrId ==
- '') {
- this.carList.get(id).attrId =
- purchaseDetails[0].attrId
- }
- if (this.carList.get(id)
- .purchasePrice == '' || this
- .carList.get(id)
- .purchasePrice == null) {
- if (voiceData.purchasePrice) {
- this.carList.get(id)
- .purchasePrice =
- voiceData.purchasePrice
- } else {
- this.carList.get(id)
- .purchasePrice =
- purchaseDetails[0]
- .purchasePrice
- }
-
- }
- if (this.carList.get(id)
- .productPicture == '') {
- this.carList.get(id)
- .productPicture =
- purchaseDetails[0]
- .productPicture
- }
- purchaseDetails[j].stockLogList1[i]
- .name = this.sliceMsg(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList)
- if (this.carList.get(id)
- .stockLogList.size == 0) {
- this.carList.get(id)
- .stockLogList.set(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList,
- purchaseDetails[j]
- .stockLogList1[i])
- } else {
- if (this.carList.get(id)
- .stockLogList.has(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList) == true
- ) {
- this.carList.get(id)
- .stockLogList.get(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList)
- .productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
- } else {
- this.carList.get(id)
- .stockLogList.set(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList,
- purchaseDetails[j]
- .stockLogList1[i])
- }
+ this.tui.request(
+ "/app/productAttribute/selectAttributeAndValueByCategoryId",
+ "POST", {
+ categoryId: res.result[0].attrId
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ let data = {
+ attributeList: '{"颜色":"均色","尺码":"均码"}',
+ productCount: Number(voiceData.productCount) ||
+ 1,
+ stockCount: null
+ }
+ if (res1.result.stock.length > 0) {
+ for (let i = 0; i < res1.result.stock.length; i++) {
+ if (res1.result.stock[i].attributeList ==
+ '{"颜色":"均色","尺码":"均码"}') {
+ console.log('jinlaile')
+ data = {
+ attributeList: '{"颜色":"均色","尺码":"均码"}',
+ productCount: Number(voiceData
+ .productCount) || 1,
+ stockCount: res1.result.stock[i]
+ .stockCount
}
- this.carList.get(id)
- .productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i].productCount)
}
}
- if (this.carList.get(id).stockLogList.get(
- '{"颜色":"均色","尺码":"均码"}')
- .productCount == 0 && purchaseDetails[
- 0].stockLogList1.length > 0) {
- this.carList.get(id).stockLogList
- .delete('{"颜色":"均色","尺码":"均码"}')
- }
- this.carList.get(id).price1 = Number(this.carList
- .get(id).productCount) * this.carList
- .get(id).purchasePrice
- } else {
-
- let isTrue = false
- this.carList.forEach(function(value, key) {
- if (value.productSn ==
- purchaseDetails[0]
- .productSn) {
- isTrue = true
- that.tui.toast(
- '该货号被页面其他商品占用,请重新输入!'
- )
- that.carList.get(id)
- .productSn = ''
- setTimeout(res => {
- that.$forceUpdate()
- }, 1000)
- throw Error('被占用')
- }
- })
-
- this.$nextTick(() => {
- if (this.carList.get(id)
- .productName == '') {
- this.carList.get(id)
- .productName =
- purchaseDetails[0]
- .productName
- }
- if (isTrue == false && this
- .carList.get(id)
- .productSn == '') {
- this.carList.get(id)
- .productSn =
- purchaseDetails[0]
- .productSn
- }
- if (isTrue == false) {
- if (purchaseDetails[0]
- .productId) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productId
- this.carList.get(id)
- .isNew = false
- id = purchaseDetails[0]
- .productId
- } else if (purchaseDetails[
- 0].productSn ==
- '' || purchaseDetails[
- 0].productSn ==
- null) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productName
- id = purchaseDetails[0]
- .productName
- } else if (purchaseDetails[
- 0].productSn ==
- '货号') {
- this.carList.get(id)
- .productSn =
- purchaseDetails[0]
- .productName
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productName
- id = purchaseDetails[0]
- .productName
- } else if (purchaseDetails[
- 0].productSn) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productSn
- id = purchaseDetails[0]
- .productSn
- }
- }
- })
- if (this.carList.get(id).purchasePrice ==
- '' || this.carList.get(id)
- .purchasePrice == null) {
- if (voiceData.purchasePrice) {
- this.carList.get(id)
- .purchasePrice = voiceData
- .purchasePrice
- } else {
- this.carList.get(id)
- .purchasePrice =
- purchaseDetails[0]
- .purchasePrice
+ }
+ if (voiceData.purchasePrice) {
+ voiceData.purchasePrice = this
+ .replaceCharAfterNumber(voiceData
+ .purchasePrice, '块', '.')
+ if (voiceData.purchasePrice.indexOf('元') != -1) {
+ voiceData.purchasePrice = voiceData
+ .purchasePrice.replace(/元/g, '')
}
-
+ voiceData.purchasePrice = voiceData.purchasePrice
+ .replace(/[^0-9.]/g, "");
+
}
- if (this.carList.get(id).productPicture ==
- '') {
- this.carList.get(id).productPicture =
- purchaseDetails[0].productPicture
- }
- if (purchaseDetails[0].productId) {
- this.carList.get(id).attrId =
- purchaseDetails[0].attrId
- this.carList.get(id).wholesalePrice =
- purchaseDetails[0].wholesalePrice
- this.carList.get(id).lsPrice =
- purchaseDetails[0].lsPrice
+ if (voiceData.wholesalePrice) {
+ voiceData.wholesalePrice = this
+ .replaceCharAfterNumber(voiceData
+ .wholesalePrice, '块', '.')
+ if (voiceData.wholesalePrice.indexOf('元') != -1) {
+ voiceData.wholesalePrice = voiceData
+ .wholesalePrice.replace(/元/g, '')
+ }
+ voiceData.wholesalePrice = voiceData.wholesalePrice
+ .replace(
+ /[^0-9.]/g, "");
}
-
- let specMap =
- new Map() //新的临时存放值那个更改过的值的map
- this.$nextTick(() => {
- this.carList.forEach(function(
- value, key) {
- if (key != value
- .id) {
- specMap.set(
- value
- .id,
- value)
- } else {
- specMap.set(
- key,
- value)
- }
- })
- this.carList = specMap
- })
- this.$nextTick(() => {
- for (let j = 0; j <
- purchaseDetails.length; j++
- ) {
- for (let i = 0; i <
- purchaseDetails[j]
- .stockLogList1
- .length; i++) {
- purchaseDetails[j]
- .stockLogList1[i]
- .name = this
- .sliceMsg(
- purchaseDetails[
- j]
- .stockLogList1[
- i]
- .attributeList)
- if (this.carList.get(
- id)
- .stockLogList
- .size == 0) {
- this.carList.get(
- id)
- .stockLogList
- .set(
- purchaseDetails[
- j]
- .stockLogList1[
- i]
- .attributeList,
- purchaseDetails[
- j]
- .stockLogList1[
- i])
- } else {
- if (this.carList
- .get(id)
- .stockLogList
- .has(
- purchaseDetails[
- j]
- .stockLogList1[
- i]
- .attributeList
- ) == true
- ) {
- this.carList
- .get(id)
- .stockLogList
- .get(
- purchaseDetails[
- j]
- .stockLogList1[
- i]
- .attributeList
- )
+ res.result[0].productId = res.result[0].id
+ res.result[0].stockLogList1 = []
+ res.result[0].stockLogList1.push(data)
+ console.log(res.result)
+ let purchaseDetails = res.result
+ if (this.oneGoodsId) {
+ let id = this.oneGoodsId
+ if (purchaseDetails.length > 0) {
+ if (this.carList.get(id).productSn != '') {
+ for (let j = 0; j < purchaseDetails.length; j++) {
+ for (let i = 0; i < purchaseDetails[j]
+ .stockLogList1.length; i++) {
+ if (this.carList.get(id)
+ .productName == '') {
+ this.carList.get(id)
+ .productName =
+ purchaseDetails[0]
+ .productName
+ }
+ if (this.carList.get(id).attrId ==
+ '') {
+ this.carList.get(id).attrId =
+ purchaseDetails[0].attrId
+ }
+ if (this.carList.get(id)
+ .purchasePrice == '' || this
+ .carList.get(id)
+ .purchasePrice == null) {
+ if (voiceData.purchasePrice) {
+ this.carList.get(id)
+ .purchasePrice =
+ voiceData.purchasePrice
+ } else {
+ this.carList.get(id)
+ .purchasePrice =
+ purchaseDetails[0]
+ .purchasePrice
+ }
+
+ }
+ if (this.carList.get(id)
+ .productPicture == '') {
+ this.carList.get(id)
+ .productPicture =
+ purchaseDetails[0]
+ .productPicture
+ }
+ console.log('但语音customerCategoryRule',this.carList)
+ this.carList.get(id)
+ .customerCategoryRule =
+ JSON.parse(purchaseDetails[0]
+ .customerCategoryRule)
+ purchaseDetails[j].stockLogList1[i]
+ .name = this.sliceMsg(
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .attributeList)
+ if (this.carList.get(id)
+ .stockLogList.size == 0) {
+ this.carList.get(id)
+ .stockLogList.set(
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .attributeList,
+ purchaseDetails[j]
+ .stockLogList1[i])
+ } else {
+ if (this.carList.get(id)
+ .stockLogList.has(
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .attributeList) == true
+ ) {
+ this.carList.get(id)
+ .stockLogList.get(
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .attributeList)
+ .productCount +=
+ Number(purchaseDetails[
+ j]
+ .stockLogList1[i]
+ .productCount)
+ } else {
+ this.carList.get(id)
+ .stockLogList.set(
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .attributeList,
+ purchaseDetails[j]
+ .stockLogList1[i])
+ }
+ }
+ this.carList.get(id)
.productCount +=
Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
+ .stockLogList1[i]
+ .productCount)
+ }
+ }
+ if (this.carList.get(id).stockLogList.get(
+ '{"颜色":"均色","尺码":"均码"}')
+ .productCount == 0 && purchaseDetails[
+ 0].stockLogList1.length > 0) {
+ this.carList.get(id).stockLogList
+ .delete('{"颜色":"均色","尺码":"均码"}')
+ }
+ this.carList.get(id).price1 = Number(this
+ .carList
+ .get(id).productCount) * this
+ .carList
+ .get(id).purchasePrice
+ } else {
+
+ let isTrue = false
+ this.carList.forEach(function(value, key) {
+ if (value.productSn ==
+ purchaseDetails[0]
+ .productSn) {
+ isTrue = true
+ that.tui.toast(
+ '该货号被页面其他商品占用,请重新输入!'
+ )
+ that.carList.get(id)
+ .productSn = ''
+ setTimeout(res => {
+ that.$forceUpdate()
+ }, 1000)
+ throw Error('被占用')
+ }
+ })
+
+ this.$nextTick(() => {
+ if (this.carList.get(id)
+ .productName == '') {
+ this.carList.get(id)
+ .productName =
+ purchaseDetails[0]
+ .productName
+ }
+ this.carList.get(id)
+ .customerCategoryList =
+ purchaseDetails[0]
+ .customerCategoryRule != null?
+ JSON.parse(purchaseDetails[0]
+ .customerCategoryRule) : null
+ if (isTrue == false && this
+ .carList.get(id)
+ .productSn == '') {
+ this.carList.get(id)
+ .productSn =
+ purchaseDetails[0]
+ .productSn
+ }
+ if (isTrue == false) {
+ if (purchaseDetails[0]
+ .productId) {
+ this.carList.get(id)
+ .id =
+ purchaseDetails[0]
+ .productId
+ this.carList.get(id)
+ .productId =
+ purchaseDetails[0]
+ .productId
+ this.carList.get(id)
+ .isNew = false
+ id = purchaseDetails[0]
+ .productId
+
+ } else if (purchaseDetails[
+ 0].productSn ==
+ '' || purchaseDetails[
+ 0].productSn ==
+ null) {
+ this.carList.get(id)
+ .id =
+ purchaseDetails[0]
+ .productName
+ id = purchaseDetails[0]
+ .productName
+ } else if (purchaseDetails[
+ 0].productSn ==
+ '货号') {
+ this.carList.get(id)
+ .productSn =
+ purchaseDetails[0]
+ .productName
+ this.carList.get(id)
+ .id =
+ purchaseDetails[0]
+ .productName
+ id = purchaseDetails[0]
+ .productName
+ } else if (purchaseDetails[
+ 0].productSn) {
+ this.carList.get(id)
+ .id =
+ purchaseDetails[0]
+ .productSn
+ id = purchaseDetails[0]
+ .productSn
+ }
+ }
+ })
+ if (this.carList.get(id).purchasePrice ==
+ '' || this.carList.get(id)
+ .purchasePrice == null) {
+ if (voiceData.purchasePrice) {
+ this.carList.get(id)
+ .purchasePrice = voiceData
+ .purchasePrice
} else {
- this.carList
- .get(id)
- .stockLogList
- .set(
- purchaseDetails[
- j]
- .stockLogList1[
- i]
- .attributeList,
- purchaseDetails[
- j]
- .stockLogList1[
- i])
+ this.carList.get(id)
+ .purchasePrice =
+ purchaseDetails[0]
+ .purchasePrice
}
+
}
- this.carList.get(id)
- .productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
- }
- }
- this.carList.get(id).price1 =
- Number(this.carList.get(id)
- .productCount) * this
- .carList.get(id)
- .purchasePrice
- if (this.carList.get(id)
- .stockLogList.get(
- '{"颜色":"均色","尺码":"均码"}'
- ).productCount == 0 &&
- purchaseDetails[0]
- .stockLogList1.length > 0
- ) {
- this.carList.get(id)
- .stockLogList.delete(
- '{"颜色":"均色","尺码":"均码"}'
- )
- }
- })
- }
-
- this.$nextTick(() => {
- this.getAllPrice()
- this.oneGoodsId = ''
- })
- } else {
- this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
- }
- } else {
- for (let i = 0; i < purchaseDetails.length; i++) {
- let data = {
- id: "",
- price: purchaseDetails[i].price,
- productCount: 0,
- attrId: purchaseDetails[i].attrId,
- categoryId: purchaseDetails[i]
- .categoryId == '' ? this
- .categoryList.categoryId :
- purchaseDetails[i].categoryId,
- categoryName: purchaseDetails[i]
- .categoryName == '' ? this
- .categoryList.categoryName :
- purchaseDetails[i].categoryName,
- wholesalePrice: voiceData
- .wholesalePrice ? voiceData
- .wholesalePrice : purchaseDetails[
- i].wholesalePrice,
- purchasePrice: voiceData
- .purchasePrice ? voiceData
- .purchasePrice : purchaseDetails[i]
- .purchasePrice,
- isNew: purchaseDetails[i].productId ==
- null ? true : false,
- productId: purchaseDetails[i]
- .productId,
- productName: purchaseDetails[i]
- .productName,
- productSn: purchaseDetails[i]
- .productSn,
- productPicture: purchaseDetails[i]
- .productPicture,
- supplierName: purchaseDetails[i]
- .supplierName,
- productPictures: [],
- saleDetailQueryDTO: []
- }
- if (purchaseDetails[i].productId) {
- data.id = purchaseDetails[i].productId
- } else if (purchaseDetails[i].productSn ==
- '' || purchaseDetails[i].productSn ==
- null) {
- data.id = purchaseDetails[i].productName
- } else if (purchaseDetails[i].productSn ==
- '货号') {
- data.productSn = purchaseDetails[i]
- .productName
- data.id = purchaseDetails[i].productName
- } else if (purchaseDetails[i].productSn) {
- data.id = purchaseDetails[i].productSn
- }
- for (let m = 0; m < purchaseDetails[i]
- .stockLogList1.length; m++) {
- let list = {
- attributeList: this.getAttribute(
- purchaseDetails[i]
- .stockLogList1[m]
- .attributeList),
- productCount: Number(purchaseDetails[i]
- .stockLogList1[m]
- .productCount) ||
- Number(purchaseDetails[i]
- .stockLogList1[m]
- .productCounts),
- productNum: '',
- name: this.sliceMsg(this
- .getAttribute(
- purchaseDetails[i]
- .stockLogList1[m]
- .attributeList)),
- price: purchaseDetails[i]
- .stockLogList1[m].purchasePrice
+ this.carList.get(id).customerCategoryList =
+ purchaseDetails[0].customerCategoryRule != null ? JSON.parse(purchaseDetails[0].customerCategoryRule) : this.customerCategoryList1
+ if (this.carList.get(id).productPicture ==
+ '') {
+ this.carList.get(id).productPicture =
+ purchaseDetails[0].productPicture
+ }
+ if (purchaseDetails[0].productId) {
+ this.carList.get(id).attrId =
+ purchaseDetails[0].attrId
+ this.carList.get(id).wholesalePrice =
+ purchaseDetails[0].wholesalePrice
+ this.carList.get(id).lsPrice =
+ purchaseDetails[0].lsPrice
+ }
+
+ let specMap =
+ new Map() //新的临时存放值那个更改过的值的map
+ this.$nextTick(() => {
+ this.carList.forEach(function(
+ value, key) {
+ if (key != value
+ .id) {
+ specMap.set(
+ value
+ .id,
+ value)
+ } else {
+ specMap.set(
+ key,
+ value)
+ }
+ })
+ this.carList = specMap
+ })
+ this.$nextTick(() => {
+ for (let j = 0; j <
+ purchaseDetails.length; j++
+ ) {
+ for (let i = 0; i <
+ purchaseDetails[j]
+ .stockLogList1
+ .length; i++) {
+ purchaseDetails[j]
+ .stockLogList1[i]
+ .name = this
+ .sliceMsg(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .attributeList)
+ if (this.carList.get(
+ id)
+ .stockLogList
+ .size == 0) {
+ this.carList.get(
+ id)
+ .stockLogList
+ .set(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .attributeList,
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i])
+ } else {
+ if (this.carList
+ .get(id)
+ .stockLogList
+ .has(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .attributeList
+ ) == true
+ ) {
+ this.carList
+ .get(id)
+ .stockLogList
+ .get(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .attributeList
+ )
+ .productCount +=
+ Number(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .productCount
+ )
+ } else {
+ this.carList
+ .get(id)
+ .stockLogList
+ .set(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .attributeList,
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i])
+ }
+ }
+ this.carList.get(id)
+ .productCount +=
+ Number(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .productCount)
+ }
+ }
+ this.carList.get(id).price1 =
+ Number(this.carList.get(id)
+ .productCount) * this
+ .carList.get(id)
+ .purchasePrice
+ if (this.carList.get(id)
+ .stockLogList.get(
+ '{"颜色":"均色","尺码":"均码"}'
+ ).productCount == 0 &&
+ purchaseDetails[0]
+ .stockLogList1.length > 0
+ ) {
+ this.carList.get(id)
+ .stockLogList.delete(
+ '{"颜色":"均色","尺码":"均码"}'
+ )
+ }
+ })
+ }
+
+ this.$nextTick(() => {
+ this.getAllPrice()
+ this.oneGoodsId = ''
+ })
+ } else {
+ this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
+ }
+ } else {
+ for (let i = 0; i < purchaseDetails.length; i++) {
+ let data1 = {
+ id: "",
+ price: purchaseDetails[i].price,
+ productCount: 0,
+ customerCategoryList:purchaseDetails[i].customerCategoryRule != null?JSON.parse(purchaseDetails[i].customerCategoryRule) : this.customerCategoryList1,
+ attrId: purchaseDetails[i].attrId,
+ categoryId: purchaseDetails[i]
+ .categoryId == '' ? this
+ .categoryList.categoryId :
+ purchaseDetails[i].categoryId,
+ categoryName: purchaseDetails[i]
+ .categoryName == '' ? this
+ .categoryList.categoryName :
+ purchaseDetails[i].categoryName,
+ wholesalePrice: voiceData
+ .wholesalePrice ? voiceData
+ .wholesalePrice : purchaseDetails[
+ i].wholesalePrice,
+ purchasePrice: voiceData
+ .purchasePrice ? voiceData
+ .purchasePrice : purchaseDetails[i]
+ .purchasePrice,
+ isNew: purchaseDetails[i].productId ==
+ null ? true : false,
+ productId: purchaseDetails[i]
+ .productId,
+ productName: purchaseDetails[i]
+ .productName,
+ productSn: purchaseDetails[i]
+ .productSn,
+ productPicture: purchaseDetails[i]
+ .productPicture,
+ supplierName: purchaseDetails[i]
+ .supplierName,
+ productPictures: [],
+ saleDetailQueryDTO: []
+ }
+ if (purchaseDetails[i].productId) {
+ data1.id = purchaseDetails[i].productId
+ } else if (purchaseDetails[i].productSn ==
+ '' || purchaseDetails[i].productSn ==
+ null) {
+ data1.id = purchaseDetails[i].productName
+ } else if (purchaseDetails[i].productSn ==
+ '货号') {
+ data1.productSn = purchaseDetails[i]
+ .productName
+ data1.id = purchaseDetails[i].productName
+ } else if (purchaseDetails[i].productSn) {
+ data1.id = purchaseDetails[i].productSn
+ }
+ for (let m = 0; m < purchaseDetails[i]
+ .stockLogList1.length; m++) {
+ let list = {
+ attributeList: this.getAttribute(
+ purchaseDetails[i]
+ .stockLogList1[m]
+ .attributeList),
+ productCount: Number(
+ purchaseDetails[i]
+ .stockLogList1[m]
+ .productCount) ||
+ Number(purchaseDetails[i]
+ .stockLogList1[m]
+ .productCounts),
+ productNum: purchaseDetails[i]
+ .stockLogList1[m].stockCount,
+ name: this.sliceMsg(this
+ .getAttribute(
+ purchaseDetails[i]
+ .stockLogList1[m]
+ .attributeList)),
+ price: purchaseDetails[i]
+ .stockLogList1[m].purchasePrice
+ }
+ data1.productCount += Number(
+ purchaseDetails[i]
+ .stockLogList1[m].productCount)
+ data1.saleDetailQueryDTO.push(list)
+ }
+ this.carList1.push(data1)
+ }
+ if (i == convertedStr.length - 1) {
+ this.$nextTick(() => {
+ setTimeout(res => {
+ this.AiVoice()
+ }, 300)
+ })
+ }
}
- data.productCount += Number(purchaseDetails[i]
- .stockLogList1[m].productCount)
- data.saleDetailQueryDTO.push(list)
- }
- this.carList1.push(data)
- }
- if (i == convertedStr.length - 1) {
- this.$nextTick(() => {
- setTimeout(res => {
- this.AiVoice()
- }, 300)
- })
+ } else {
+ this.tui.toast(res1.message)
}
- }
+ }).catch((res) => {})
+
} else {
this.voiceText = ''
this.voiceText1 = ''
@@ -2366,27 +2587,30 @@
.match(regexZCount);
}
if (voiceData.purchasePrice) {
- voiceData.purchasePrice = this.replaceCharAfterNumber(voiceData
- .purchasePrice, '块','.')
+ voiceData.purchasePrice = this
+ .replaceCharAfterNumber(voiceData
+ .purchasePrice, '块', '.')
if (voiceData.purchasePrice.indexOf('元') != -1) {
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '')
+ voiceData.purchasePrice = voiceData
+ .purchasePrice.replace(/元/g, '')
}
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
-
+ voiceData.purchasePrice = voiceData.purchasePrice
+ .replace(/[^0-9.]/g, "");
+
}
if (voiceData.wholesalePrice) {
voiceData.wholesalePrice = this
.replaceCharAfterNumber(
voiceData.wholesalePrice, '块', '.')
if (voiceData.wholesalePrice.indexOf('元') != -1) {
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
+ voiceData.wholesalePrice = voiceData
+ .wholesalePrice.replace(/元/g, '')
}
voiceData.wholesalePrice = voiceData.wholesalePrice
- .replace(
- /[^0-9.]/g, "");
+ .replace(/[^0-9.]/g, "");
}
let data = {
- id: voiceData.productSn,
+ id: voiceData.productSn ? voiceData.productSn : generateUUID(),
productCount: Number(voiceData.productCount) || 0,
productName: voiceData.productName,
productSn: voiceData.productSn,
@@ -2396,8 +2620,7 @@
wholesalePrice: voiceData.wholesalePrice || 0,
stockLogList1: [{
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData
- .productCount),
+ productCount: Number(voiceData.productCount) || 1,
stockCount: null
}]
}
@@ -2410,41 +2633,26 @@
if (this.carList.get(id).productSn != '') {
for (let j = 0; j < purchaseDetails
.length; j++) {
- for (let i = 0; i < purchaseDetails[j]
- .stockLogList1.length; i++) {
- if (this.carList.get(id)
- .productName == '') {
- this.carList.get(id)
- .productName =
- purchaseDetails[0]
- .productName
+ for (let i = 0; i < purchaseDetails[j].stockLogList1.length; i++) {
+ if (this.carList.get(id).productName == '') {
+ this.carList.get(id).productName = purchaseDetails[0].productName
}
- if (this.carList.get(id).attrId ==
- '') {
- this.carList.get(id).attrId =
- purchaseDetails[0].attrId
+ if (this.carList.get(id).productSn == '') {
+ this.carList.get(id).productSn = purchaseDetails[0].productSn
}
- if (this.carList.get(id)
- .purchasePrice == '' || this
- .carList.get(id)
- .purchasePrice == null) {
- this.carList.get(id)
- .purchasePrice =
- purchaseDetails[0]
- .purchasePrice
+ if (this.carList.get(id).attrId =='') {
+ this.carList.get(id).attrId =purchaseDetails[0].attrId
}
- if (this.carList.get(id)
- .productPicture == '') {
- this.carList.get(id)
- .productPicture =
- purchaseDetails[0]
- .productPicture
+ if (this.carList.get(id).wholesalePrice == '' || this.carList.get(id).wholesalePrice == null) {
+ this.carList.get(id).wholesalePrice =purchaseDetails[0].wholesalePrice
}
- purchaseDetails[j].stockLogList1[i]
- .name = this.sliceMsg(
- purchaseDetails[j]
- .stockLogList1[i]
- .attributeList)
+ if (this.carList.get(id).purchasePrice == '' || this.carList.get(id).purchasePrice == null) {
+ this.carList.get(id).purchasePrice =purchaseDetails[0].purchasePrice
+ }
+ if (this.carList.get(id).productPicture == '') {
+ this.carList.get(id).productPicture =purchaseDetails[0].productPicture
+ }
+ purchaseDetails[j].stockLogList1[i].name = this.sliceMsg(purchaseDetails[j].stockLogList1[i].attributeList)
if (this.carList.get(id)
.stockLogList.size == 0) {
this.carList.get(id)
@@ -2460,16 +2668,17 @@
purchaseDetails[j]
.stockLogList1[i]
.attributeList) == true
- ) {
+ ) {
this.carList.get(id)
.stockLogList.get(
purchaseDetails[j]
.stockLogList1[i]
.attributeList)
.productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
+ Number(purchaseDetails[
+ j]
+ .stockLogList1[i]
+ .productCount)
} else {
this.carList.get(id)
.stockLogList.set(
@@ -2483,7 +2692,8 @@
this.carList.get(id)
.productCount +=
Number(purchaseDetails[j]
- .stockLogList1[i].productCount)
+ .stockLogList1[i]
+ .productCount)
}
}
if (this.carList.get(id).stockLogList.get(
@@ -2493,8 +2703,10 @@
this.carList.get(id).stockLogList
.delete('{"颜色":"均色","尺码":"均码"}')
}
- this.carList.get(id).price1 = Number(this.carList
- .get(id).productCount) * this.carList
+ this.carList.get(id).price1 = Number(this
+ .carList
+ .get(id).productCount) * this
+ .carList
.get(id).purchasePrice
} else {
@@ -2506,7 +2718,7 @@
isTrue = true
that.tui.toast(
'该货号被页面其他商品占用,请重新输入!'
- )
+ )
that.carList.get(id)
.productSn = ''
setTimeout(res => {
@@ -2533,48 +2745,21 @@
.productSn
}
if (isTrue == false) {
- if (purchaseDetails[0]
- .productId) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productId
- this.carList.get(id)
- .isNew = false
- id = purchaseDetails[0]
- .productId
- } else if (purchaseDetails[
- 0].productSn ==
- '' || purchaseDetails[
- 0].productSn ==
- null) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productName
- id = purchaseDetails[0]
- .productName
- } else if (purchaseDetails[
- 0].productSn ==
- '货号') {
- this.carList.get(id)
- .productSn =
- purchaseDetails[0]
- .productName
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productName
- id = purchaseDetails[0]
- .productName
- } else if (purchaseDetails[
- 0].productSn) {
- this.carList.get(id)
- .id =
- purchaseDetails[0]
- .productSn
- id = purchaseDetails[0]
- .productSn
+ if (purchaseDetails[0].productId) {
+ this.carList.get(id).id =purchaseDetails[0].productId
+ this.carList.get(id).isNew = false
+ id = purchaseDetails[0].productId
+ } else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn ==null) {
+ this.carList.get(id).id = purchaseDetails[0].productName
+ id = purchaseDetails[0].productName
+ } else if (purchaseDetails[0].productSn == '货号') {
+ this.carList.get(id).productSn =
+ purchaseDetails[0].productName
+ this.carList.get(id).id = purchaseDetails[0].productName
+ id = purchaseDetails[0].productName
+ } else if (purchaseDetails[0].productSn) {
+ this.carList.get(id).id = purchaseDetails[0].productSn
+ id = purchaseDetails[0].productSn
}
}
})
@@ -2599,20 +2784,13 @@
this.carList.get(id).wholesalePrice =
purchaseDetails[0].wholesalePrice
let specMap =
- new Map() //新的临时存放值那个更改过的值的map
+ new Map() //新的临时存放值那个更改过的值的map
this.$nextTick(() => {
- this.carList.forEach(function(
- value, key) {
- if (key != value
- .id) {
- specMap.set(
- value
- .id,
- value)
+ this.carList.forEach(function(value, key) {
+ if (key != value.id) {
+ specMap.set(value.id,value)
} else {
- specMap.set(
- key,
- value)
+ specMap.set(key,value)
}
})
this.carList = specMap
@@ -2620,7 +2798,7 @@
this.$nextTick(() => {
for (let j = 0; j <
purchaseDetails.length; j++
- ) {
+ ) {
for (let i = 0; i <
purchaseDetails[j]
.stockLogList1
@@ -2661,8 +2839,8 @@
.stockLogList1[
i]
.attributeList
- ) == true
- ) {
+ ) == true
+ ) {
this.carList
.get(id)
.stockLogList
@@ -2672,11 +2850,15 @@
.stockLogList1[
i]
.attributeList
- )
+ )
.productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
+ Number(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .productCount
+ )
} else {
this.carList
.get(id)
@@ -2695,27 +2877,30 @@
}
this.carList.get(id)
.productCount +=
- Number(purchaseDetails[j]
- .stockLogList1[i]
- .productCount)
+ Number(
+ purchaseDetails[
+ j]
+ .stockLogList1[
+ i]
+ .productCount)
}
}
this.carList.get(id).price1 =
Number(this.carList.get(id)
- .productCount) * this
+ .productCount) * this
.carList.get(id)
.purchasePrice
if (this.carList.get(id)
.stockLogList.get(
'{"颜色":"均色","尺码":"均码"}'
- ).productCount == 0 &&
+ ).productCount == 0 &&
purchaseDetails[0]
.stockLogList1.length > 0
- ) {
+ ) {
this.carList.get(id)
.stockLogList.delete(
'{"颜色":"均色","尺码":"均码"}'
- )
+ )
}
})
}
@@ -2729,20 +2914,26 @@
}
} else {
if (voiceData.purchasePrice) {
- voiceData.purchasePrice = this.replaceCharAfterNumber(voiceData
- .purchasePrice, '块','.')
- if (voiceData.purchasePrice.indexOf('元') != -1) {
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '')
+ voiceData.purchasePrice = this
+ .replaceCharAfterNumber(voiceData
+ .purchasePrice, '块', '.')
+ if (voiceData.purchasePrice.indexOf('元') != -
+ 1) {
+ voiceData.purchasePrice = voiceData
+ .purchasePrice.replace(/元/g, '')
}
- voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
-
+ voiceData.purchasePrice = voiceData
+ .purchasePrice.replace(/[^0-9.]/g, "");
+
}
if (voiceData.wholesalePrice) {
voiceData.wholesalePrice = this
.replaceCharAfterNumber(
voiceData.wholesalePrice, '块', '.')
- if (voiceData.wholesalePrice.indexOf('元') != -1) {
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
+ if (voiceData.wholesalePrice.indexOf('元') != -
+ 1) {
+ voiceData.wholesalePrice = voiceData
+ .wholesalePrice.replace(/元/g, '')
}
voiceData.wholesalePrice = voiceData
.wholesalePrice.replace(
@@ -2788,14 +2979,17 @@
} else if (purchaseDetails[i].productSn ==
'' || purchaseDetails[i].productSn ==
null) {
- data.id = purchaseDetails[i].productName
+ data.id = purchaseDetails[i].productName ||
+ purchaseDetails[i].id
} else if (purchaseDetails[i].productSn ==
'货号') {
data.productSn = purchaseDetails[i]
.productName
- data.id = purchaseDetails[i].productName
+ data.id = purchaseDetails[i].productName ||
+ purchaseDetails[i].id
} else if (purchaseDetails[i].productSn) {
- data.id = purchaseDetails[i].productSn
+ data.id = purchaseDetails[i].productSn ||
+ purchaseDetails[i].id
}
for (let m = 0; m < purchaseDetails[i]
.stockLogList1.length; m++) {
@@ -2804,12 +2998,13 @@
purchaseDetails[i]
.stockLogList1[m]
.attributeList),
- productCount: Number(purchaseDetails[i]
- .stockLogList1[m]
- .productCount) ||
+ productCount: Number(
+ purchaseDetails[i]
+ .stockLogList1[m]
+ .productCount) ||
Number(purchaseDetails[i]
- .stockLogList1[m]
- .productCounts),
+ .stockLogList1[m]
+ .productCounts),
productNum: '',
name: this.sliceMsg(this
.getAttribute(
@@ -2819,7 +3014,8 @@
price: purchaseDetails[i]
.stockLogList1[m].purchasePrice
}
- data.productCount += Number(purchaseDetails[i]
+ data.productCount += Number(
+ purchaseDetails[i]
.stockLogList1[m].productCount)
data.saleDetailQueryDTO.push(list)
}
@@ -2859,18 +3055,23 @@
if (purchaseDetails.length > 0) {
if (this.carList.get(id).productSn != '') {
for (let j = 0; j < purchaseDetails.length; j++) {
- if(purchaseDetails[j].purchasePrice == "" || purchaseDetails[j].purchasePrice == null){
+ if (purchaseDetails[j].purchasePrice == "" || purchaseDetails[
+ j].purchasePrice == null) {
purchaseDetails[j].purchasePrice = 0
}
- if(purchaseDetails[j].wholesalePrice == "" || purchaseDetails[j].wholesalePrice == null){
+ if (purchaseDetails[j].wholesalePrice == "" || purchaseDetails[
+ j].wholesalePrice == null) {
purchaseDetails[j].wholesalePrice = 0
}
- if(purchaseDetails[j].price == "" || purchaseDetails[j].price == null){
+ if (purchaseDetails[j].price == "" || purchaseDetails[j]
+ .price == null) {
purchaseDetails[j].price = 0
}
for (let i = 0; i < purchaseDetails[j].stockLogList1
.length; i++) {
- if(purchaseDetails[j].stockLogList1[i].productCount == "" || purchaseDetails[j].stockLogList1[i].productCount == null){
+ if (purchaseDetails[j].stockLogList1[i].productCount ==
+ "" || purchaseDetails[j].stockLogList1[i]
+ .productCount == null) {
purchaseDetails[j].stockLogList1[i].productCount = 0
}
if (this.carList.get(id).productName == '') {
@@ -2887,7 +3088,8 @@
}
if (this.carList.get(id).wholesalePrice == '' || this
.carList.get(id).wholesalePrice == null) {
- this.carList.get(id).wholesalePrice = purchaseDetails[0]
+ this.carList.get(id).wholesalePrice = purchaseDetails[
+ 0]
.wholesalePrice
}
if (this.carList.get(id).productPicture == '') {
@@ -2896,6 +3098,8 @@
}
purchaseDetails[j].stockLogList1[i].name = this.sliceMsg(
purchaseDetails[j].stockLogList1[i].attributeList)
+ purchaseDetails[j].stockLogList1[i].productNum =
+ purchaseDetails[j].stockLogList1[i].stock
if (this.carList.get(id).stockLogList.size == 0) {
this.carList.get(id).stockLogList.set(purchaseDetails[
j].stockLogList1[i].attributeList,
@@ -2908,7 +3112,7 @@
purchaseDetails[j].stockLogList1[i]
.attributeList).productCount +=
Number(purchaseDetails[j].stockLogList1[i]
- .productCount)
+ .productCount)
} else {
this.carList.get(id).stockLogList.set(
purchaseDetails[j].stockLogList1[i]
@@ -2916,7 +3120,8 @@
.stockLogList1[i])
}
}
- this.carList.get(id).productCount += Number(purchaseDetails[j]
+ this.carList.get(id).productCount += Number(
+ purchaseDetails[j]
.stockLogList1[i].productCount)
}
}
@@ -2926,7 +3131,8 @@
this.carList.get(id).stockLogList.delete(
'{"颜色":"均色","尺码":"均码"}')
}
- this.carList.get(id).price1 = Number(this.carList.get(id).productCount) *
+ this.carList.get(id).price1 = Number(this.carList.get(id)
+ .productCount) *
this.carList.get(id).purchasePrice
} else {
@@ -2948,6 +3154,7 @@
this.carList.get(id).productName = purchaseDetails[
0].productName
}
+ this.carList.get(id).customerCategoryList = JSON.parse(purchaseDetails[0].customerCategoryRule)
if (isTrue == false && this.carList.get(id)
.productSn == '') {
this.carList.get(id).productSn = purchaseDetails[0]
@@ -3027,8 +3234,9 @@
purchaseDetails[j]
.stockLogList1[i].attributeList
).productCount +=
- Number(purchaseDetails[j].stockLogList1[i]
- .productCount)
+ Number(purchaseDetails[j]
+ .stockLogList1[i]
+ .productCount)
} else {
this.carList.get(id).stockLogList.set(
purchaseDetails[j]
@@ -3040,11 +3248,13 @@
}
this.carList.get(id).productCount +=
Number(purchaseDetails[j].stockLogList1[i]
- .productCount)
+ .productCount)
}
}
- this.carList.get(id).price1 = Number(this.carList.get(id)
- .productCount) * this.carList.get(id).purchasePrice
+ this.carList.get(id).price1 = Number(this.carList.get(
+ id)
+ .productCount) * this.carList.get(id)
+ .purchasePrice
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}').productCount == 0 &&
purchaseDetails[0].stockLogList1.length > 0) {
@@ -3068,6 +3278,7 @@
price: purchaseDetails[i].price,
productCount: 0,
attrId: purchaseDetails[i].attrId,
+ customerCategoryList:purchaseDetails[i].customerCategoryRule == null ? this.customerCategoryList1 : JSON.parse(purchaseDetails[i].customerCategoryRule),
categoryId: purchaseDetails[i].categoryId == '' ? this
.categoryList.categoryId : purchaseDetails[i].categoryId,
categoryName: purchaseDetails[i].categoryName == '' ? this
@@ -3102,8 +3313,9 @@
.stockLogList1[m]
.attributeList),
productCount: Number(purchaseDetails[i].stockLogList1[m]
- .productCount) ||
- Number(purchaseDetails[i].stockLogList1[m].productCounts),
+ .productCount) ||
+ Number(purchaseDetails[i].stockLogList1[m]
+ .productCounts),
productNum: '',
name: this.sliceMsg(this.getAttribute(purchaseDetails[i]
.stockLogList1[m]
@@ -3150,17 +3362,21 @@
if (purchaseDetails.length > 0) {
if (this.carList.get(id).productSn != '') {
for (let j = 0; j < purchaseDetails.length; j++) {
- if(purchaseDetails[j].purchasePrice == "" || purchaseDetails[j].purchasePrice == null){
+ if (purchaseDetails[j].purchasePrice == "" || purchaseDetails[j]
+ .purchasePrice == null) {
purchaseDetails[j].purchasePrice = 0
}
- if(purchaseDetails[j].wholesalePrice == "" || purchaseDetails[j].wholesalePrice == null){
+ if (purchaseDetails[j].wholesalePrice == "" || purchaseDetails[j]
+ .wholesalePrice == null) {
purchaseDetails[j].wholesalePrice = 0
}
- if(purchaseDetails[j].price == "" || purchaseDetails[j].price == null){
+ if (purchaseDetails[j].price == "" || purchaseDetails[j].price ==
+ null) {
purchaseDetails[j].price = 0
}
for (let i = 0; i < purchaseDetails[j].stockLogList1.length; i++) {
- if(purchaseDetails[j].stockLogList1[i].productCount == "" || purchaseDetails[j].stockLogList1[i].productCount == null){
+ if (purchaseDetails[j].stockLogList1[i].productCount == "" ||
+ purchaseDetails[j].stockLogList1[i].productCount == null) {
purchaseDetails[j].stockLogList1[i].productCount = 0
}
if (this.carList.get(id).productName == '') {
@@ -3186,6 +3402,8 @@
}
purchaseDetails[j].stockLogList1[i].name = this.sliceMsg(
purchaseDetails[j].stockLogList1[i].attributeList)
+ purchaseDetails[j].stockLogList1[i].productNum =
+ purchaseDetails[j].stockLogList1[i].stockCount
if (this.carList.get(id).stockLogList.size == 0) {
this.carList.get(id).stockLogList.set(purchaseDetails[j]
.stockLogList1[i].attributeList, purchaseDetails[j]
@@ -3196,7 +3414,8 @@
this.carList.get(id).stockLogList.get(purchaseDetails[
j].stockLogList1[i].attributeList)
.productCount +=
- Number(purchaseDetails[j].stockLogList1[i].productCount)
+ Number(purchaseDetails[j].stockLogList1[i]
+ .productCount)
} else {
this.carList.get(id).stockLogList.set(purchaseDetails[
j].stockLogList1[i].attributeList,
@@ -3207,8 +3426,9 @@
.stockLogList1[i].productCount)
}
}
- this.$nextTick(()=>{
- this.carList.get(id).price1 = Number(this.carList.get(id).productCount) * this
+ this.$nextTick(() => {
+ this.carList.get(id).price1 = Number(this.carList.get(id)
+ .productCount) * this
.carList.get(id).purchasePrice
this.getAllPrice()
this.oneGoodsId = ''
@@ -3218,7 +3438,7 @@
) {
this.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}')
}
-
+
} else {
let isTrue = false
@@ -3275,6 +3495,8 @@
this.carList.get(id).purchasePrice = purchaseDetails[0]
.purchasePrice
}
+ this.carList.get(id).customerCategoryList = JSON.parse(purchaseDetails[0]
+ .customerCategoryRule)
if (this.carList.get(id).wholesalePrice == '' || this.carList.get(id)
.wholesalePrice == null) {
this.carList.get(id).wholesalePrice = purchaseDetails[0]
@@ -3285,6 +3507,7 @@
.productPicture
}
if (purchaseDetails[0].productId) {
+ this.carList.get(id).productId = purchaseDetails[0].productId
this.carList.get(id).attrId = purchaseDetails[0].attrId
this.carList.get(id).wholesalePrice = purchaseDetails[0]
.wholesalePrice
@@ -3321,8 +3544,9 @@
this.carList.get(id).stockLogList.get(
purchaseDetails[j].stockLogList1[i]
.attributeList).productCount +=
- Number(purchaseDetails[j].stockLogList1[i]
- .productCount)
+ Number(purchaseDetails[j]
+ .stockLogList1[i]
+ .productCount)
} else {
this.carList.get(id).stockLogList.set(
purchaseDetails[j].stockLogList1[i]
@@ -3332,7 +3556,7 @@
}
this.carList.get(id).productCount +=
Number(purchaseDetails[j].stockLogList1[i]
- .productCount)
+ .productCount)
}
}
this.carList.get(id).price1 = Number(this.carList.get(id)
@@ -3345,7 +3569,7 @@
}
})
}
- console.log('carList',this.carList)
+ console.log('carList', this.carList)
this.$nextTick(() => {
this.getAllPrice()
this.oneGoodsId = ''
@@ -3360,6 +3584,7 @@
price: purchaseDetails[i].price,
productCount: 0,
attrId: purchaseDetails[i].attrId,
+ customerCategoryList:purchaseDetails[i].customerCategoryRule == null ? this.customerCategoryList1 : JSON.parse(purchaseDetails[i].customerCategoryRule),
categoryId: purchaseDetails[i].categoryId == '' ? this.categoryList
.categoryId : purchaseDetails[i].categoryId,
categoryName: purchaseDetails[i].categoryName == '' ? this
@@ -3393,15 +3618,16 @@
.stockLogList1[m]
.attributeList),
productCount: Number(purchaseDetails[i].stockLogList1[m]
- .productCount) ||
+ .productCount) ||
Number(purchaseDetails[i].stockLogList1[m].productCounts),
- productNum: '',
+ productNum: purchaseDetails[i].stockLogList1[m].stockCount,
name: this.sliceMsg(this.getAttribute(purchaseDetails[i]
.stockLogList1[m]
.attributeList)),
price: purchaseDetails[i].stockLogList1[m].purchasePrice
}
- data.productCount += Number(purchaseDetails[i].stockLogList1[m].productCount)
+ data.productCount += Number(purchaseDetails[i].stockLogList1[m]
+ .productCount)
data.saleDetailQueryDTO.push(list)
}
this.carList1.push(data)
@@ -3446,7 +3672,8 @@
res.result.records[i].discountAmount = oneData
.wholesalePrice
}
- res.result.records[i].productCount = Number(oneData.productCount)
+ res.result.records[i].productCount = Number(oneData
+ .productCount)
if (oneData.purchasePrice) {
res.result.records[i].purchasePrice = oneData.purchasePrice
}
@@ -3464,8 +3691,8 @@
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(oneData.productCount),
- stockCount: null
+ productCount: Number(oneData.productCount) || 1,
+ stockCount: res.result.records[0].defaultStockCount
}
res.result.records[0].productId = res.result.records[0].id
res.result.records[0].saleDetailQueryDTO = []
@@ -3484,6 +3711,12 @@
purchaseDetails[0]
.productName
}
+
+ this.carList.get(id).customerCategoryList =
+ purchaseDetails[0]
+ .customerCategoryRule != null ?JSON.parse(purchaseDetails[0]
+ .customerCategoryRule) : this.customerCategoryList1
+
if (this.carList.get(id).attrId == '') {
this.carList.get(id).attrId =
purchaseDetails[0].attrId
@@ -3537,8 +3770,8 @@
.attributeList)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
} else {
this.carList.get(id).stockLogList.set(
purchaseDetails[
@@ -3550,7 +3783,7 @@
}
this.carList.get(id).productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i].productCount)
+ .saleDetailQueryDTO[i].productCount)
}
}
if (this.carList.get(id).stockLogList.get(
@@ -3562,8 +3795,9 @@
this.carList.get(id).stockLogList.delete(
'{"颜色":"均色","尺码":"均码"}')
}
- this.carList.get(id).price1 = Number(this.carList.get(id)
- .productCount) *
+ this.carList.get(id).price1 = Number(this.carList.get(
+ id)
+ .productCount) *
this.carList.get(id).purchasePrice
} else {
@@ -3709,9 +3943,11 @@
i]
.attributeList)
.productCount +=
- Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ Number(purchaseDetails[
+ j]
+ .saleDetailQueryDTO[
+ i]
+ .productCount)
} else {
this.carList.get(id)
.stockLogList.set(
@@ -3727,12 +3963,14 @@
this.carList.get(id)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
}
}
- this.carList.get(id).price1 = Number(this.carList
- .get(id).productCount) * this.carList.get(id)
+ this.carList.get(id).price1 = Number(this
+ .carList
+ .get(id).productCount) * this
+ .carList.get(id)
.purchasePrice
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}')
@@ -3760,6 +3998,7 @@
price: purchaseDetails[0].price,
productCount: 0,
attrId: purchaseDetails[0].attrId,
+ customerCategoryList: purchaseDetails[0].customerCategoryRule != null ? JSON.parse(purchaseDetails[0].customerCategoryRule): this.customerCategoryList1,
categoryId: purchaseDetails[0].categoryId == '' ?
this
.categoryList
@@ -3801,11 +4040,12 @@
.saleDetailQueryDTO[0]
.attributeList),
productCount: Number(purchaseDetails[0]
- .saleDetailQueryDTO[0]
- .productCount) ||
+ .saleDetailQueryDTO[0]
+ .productCount) ||
Number(purchaseDetails[0].saleDetailQueryDTO[0]
- .productCounts),
- productNum: '',
+ .productCounts),
+ productNum: purchaseDetails[0].saleDetailQueryDTO[0]
+ .stockCount,
name: this.sliceMsg(this.getAttribute(
purchaseDetails[0]
.saleDetailQueryDTO[0]
@@ -3853,6 +4093,7 @@
0,
productName: oneData.productName,
productSn: oneData.productSn,
+ customerCategoryList: this.customerCategoryList1,
categoryId: this.categoryList
.categoryId,
categoryName: this.categoryList
@@ -3865,7 +4106,7 @@
attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(
oneData
- .productCount),
+ .productCount) || 1,
stockCount: null
}]
}
@@ -3897,6 +4138,12 @@
purchaseDetails[
0].attrId
}
+
+ this.carList.get(id)
+ .customerCategoryList =
+ purchaseDetails[
+ 0].customerCategoryList
+
if (this.carList.get(id)
.purchasePrice == '' ||
this.carList.get(
@@ -3960,8 +4207,8 @@
)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
} else {
this.carList.get(
id)
@@ -3981,8 +4228,8 @@
this.carList.get(id)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
}
}
if (this.carList.get(id)
@@ -3998,7 +4245,7 @@
)
}
this.carList.get(id).price1 = Number(this
- .carList.get(id).productCount) * this
+ .carList.get(id).productCount) * this
.carList.get(id).purchasePrice
} else {
@@ -4035,6 +4282,12 @@
0]
.productName
}
+
+ this.carList.get(id)
+ .customerCategoryList =
+ purchaseDetails[0]
+ .customerCategoryList
+
if (isTrue == false &&
this.carList.get(
id)
@@ -4250,8 +4503,8 @@
)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
} else {
this.carList
.get(
@@ -4279,14 +4532,14 @@
.get(id)
.productCount +=
Number(purchaseDetails[j]
- .saleDetailQueryDTO[i]
- .productCount)
+ .saleDetailQueryDTO[i]
+ .productCount)
}
}
this.carList.get(id)
.price1 = Number(this
- .carList.get(id)
- .productCount) *
+ .carList.get(id)
+ .productCount) *
this.carList.get(id)
.purchasePrice
if (this.carList.get(
@@ -4327,6 +4580,8 @@
productCount: 0,
attrId: purchaseDetails[i]
.attrId,
+ customerCategoryList:purchaseDetails[i]
+ .customerCategoryList,
categoryId: purchaseDetails[i]
.categoryId == '' ? this
.categoryList
@@ -4388,11 +4643,11 @@
m]
.attributeList),
productCount: Number(purchaseDetails[i]
- .saleDetailQueryDTO[m]
- .productCount) ||
+ .saleDetailQueryDTO[m]
+ .productCount) ||
Number(purchaseDetails[i]
- .saleDetailQueryDTO[m]
- .productCounts),
+ .saleDetailQueryDTO[m]
+ .productCounts),
productNum: '',
name: this.sliceMsg(this
.getAttribute(
@@ -4408,7 +4663,7 @@
}
data.productCount +=
Number(purchaseDetails[i]
- .saleDetailQueryDTO[m].productCount)
+ .saleDetailQueryDTO[m].productCount)
data.saleDetailQueryDTO.push(list)
}
this.carList1.push(data)
@@ -4512,11 +4767,14 @@
this.goodsDetail.attributeList[1].value.push(data)
this.dataObj.set(data.value, '尺码')
}
+ this.$refs.clearInput.onClear()
+ this.categoryText = ''
this.$forceUpdate()
},
dialogClose() {
this.inputVal = '';
this.$refs.inputDialog.close()
+ this.$refs.clearInput.onClear()
this.categoryText = ''
},
//去掉空格和换行
@@ -4546,6 +4804,7 @@
}, false, true).then((res) => {
if (res.code == 200) {
this.indexList = res.result;
+ this.$refs.clearInput.onClear()
this.categoryText = ""
} else {
this.tui.toast(res.message)
@@ -4622,23 +4881,32 @@
sourceType: ['album', 'camera'],
camera: 'back',
success(res) {
- uni.uploadFile({
- url: that.tui.interfaceUrl() + '/upload/file',
- filePath: res.tempFiles[0].tempFilePath,
- name: 'file',
- header: {
- "content-type": "multipart/form-data",
- 'accessToken': that.tui.getToken()
- },
- formData: {},
- success: (uploadFileRes) => {
- that.carList.get(value[0]).productPicture = ''
- let path = JSON.parse(uploadFileRes.data)
- //后端返回的地址,存入图片地址
- that.carList.get(value[0]).productPicture = path.result
- that.$forceUpdate()
+ uni.compressImage({
+ src: res.tempFiles[0].tempFilePath,
+ quality: 50,
+ success: res1 => {
+
+ uni.uploadFile({
+ url: that.tui.interfaceUrl() + '/upload/file',
+ filePath: res1.tempFilePath,
+ name: 'file',
+ header: {
+ "content-type": "multipart/form-data",
+ 'accessToken': that.tui.getToken()
+ },
+ formData: {},
+ success: (uploadFileRes) => {
+ that.carList.get(value[0]).productPicture = ''
+ let path = JSON.parse(uploadFileRes.data)
+ //后端返回的地址,存入图片地址
+ that.carList.get(value[0]).productPicture = path
+ .result
+ that.$forceUpdate()
+ }
+ });
}
- });
+ })
+
}
})
},
@@ -4744,16 +5012,19 @@
this.carList.get(index).stockLogList.get(index1).productCount--
await this.carList.get(index).stockLogList.forEach(function(value, key) {
if (value.productCount < 0) {
- that.carList.get(index).returnCount = Number(that.carList.get(index).returnCount) + Math.abs(
- value.productCount)
+ that.carList.get(index).returnCount = Number(that.carList.get(index).returnCount) +
+ Math.abs(
+ value.productCount)
} else {
- that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value
- .productCount)
+ that.carList.get(index).productCount = Number(that.carList.get(index).productCount) +
+ Number(value
+ .productCount)
}
})
await this.$nextTick(() => {
// if (that.discountType != 0) { //单品折扣
- that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that.carList
+ that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that
+ .carList
.get(index).purchasePrice
// }
})
@@ -4802,10 +5073,12 @@
this.carList.get(id).stockLogList.forEach(function(value, key) {
if (value.productCount < 0) {
- that.carList.get(id).returnCount = Number(that.carList.get(id).returnCount) + Math.abs(value
+ that.carList.get(id).returnCount = Number(that.carList.get(id).returnCount) + Math.abs(
+ value
.productCount)
} else {
- that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount)
+ that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(
+ value.productCount)
}
})
this.$nextTick(() => {
@@ -5278,6 +5551,12 @@
if (convertedStr.indexOf('批发价') != -1) {
convertedStr = convertedStr.replace(/批发价/g, ',批发价:')
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
+ if (!convertedStr.startsWith("货号")) {
+ convertedStr = "货号" + convertedStr;
+ }
if (convertedStr.indexOf('货号,') != -1) {
convertedStr = convertedStr.replace(/货号,/g, '货号')
}
@@ -5296,9 +5575,7 @@
if (convertedStr.indexOf(',') == 0) {
convertedStr = convertedStr.substr(1)
}
- if (convertedStr.startsWith("号")) {
- convertedStr = "货号" + convertedStr.substr(1);
- }
+
if (that.voiceText == '' || that.voiceText == null) {
that.voiceText = convertedStr
that.voiceText1 = convertedStr
@@ -5359,6 +5636,7 @@
convertChineseToArabic(str) {
const chineseNumToArabic = {
'零': 0,
+ '幺': 1,
'一': 1,
'二': 2,
'两': 2,
@@ -5399,7 +5677,8 @@
'时9': '19',
};
- const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|事件|世间|实践|实件|景|警|颈|括号|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g;
+ const regex =
+ /(幺|零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|事件|世间|实践|实件|景|警|颈|括号|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
//合并已有
@@ -5413,9 +5692,11 @@
that.carList.get(value).stockLogList.set(keys, that.carList.get(that.mergeId).stockLogList
.get(keys))
}
- that.carList.get(value).productCount += Number(that.carList.get(that.mergeId).stockLogList.get(keys)
+ that.carList.get(value).productCount += Number(that.carList.get(that.mergeId).stockLogList.get(
+ keys)
.productCount)
- that.carList.get(value).price1 = Number(that.carList.get(value).productCount) * that.carList.get(value)
+ that.carList.get(value).price1 = Number(that.carList.get(value).productCount) * that.carList
+ .get(value)
.purchasePrice
})
this.carList.delete(this.mergeId)
@@ -5466,39 +5747,48 @@
async upLoadFile(path, time) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
- await uni.uploadFile({
- url: that.tui.interfaceUrl() + '/upload/file',
- filePath: path,
- name: 'file',
- header: {
- "content-type": "multipart/form-data",
- 'accessToken': hiver_token
- },
- formData: {},
- success: (uploadFileRes) => {
- let pathData = JSON.parse(uploadFileRes.data)
- if (that.childrenId != '') {
- let data = {
- productPicture: pathData.result
- }
- that.carList.get(that.childrenId).productPictures.push(data)
- that.$forceUpdate()
- } else {
- setTimeout(function() {
- that.isSnList(pathData.result)
- }, 100 * time);
+ await uni.compressImage({
+ src: path,
+ quality: 50,
+ success: res1 => {
- // that.addPageGoods(pathData.result)
- }
- },
- fail: (err) => {
- uni.hideLoading();
- uni.showToast({
- title: JSON.stringify(err),
- icon: 'none'
- })
+ uni.uploadFile({
+ url: that.tui.interfaceUrl() + '/upload/file',
+ filePath: res1.tempFilePath,
+ name: 'file',
+ header: {
+ "content-type": "multipart/form-data",
+ 'accessToken': hiver_token
+ },
+ formData: {},
+ success: (uploadFileRes) => {
+ let pathData = JSON.parse(uploadFileRes.data)
+ if (that.childrenId != '') {
+ let data = {
+ productPicture: pathData.result
+ }
+ that.carList.get(that.childrenId).productPictures.push(
+ data)
+ that.$forceUpdate()
+ } else {
+ setTimeout(function() {
+ that.isSnList(pathData.result)
+ }, 100 * time);
+
+ // that.addPageGoods(pathData.result)
+ }
+ },
+ fail: (err) => {
+ uni.hideLoading();
+ uni.showToast({
+ title: JSON.stringify(err),
+ icon: 'none'
+ })
+ }
+ });
}
- });
+ })
+
await setTimeout(res => {
uni.hideLoading();
}, 1000)
@@ -5737,8 +6027,10 @@
if (value.stockLogList1
.length == (i + 1)) {
let obj = {
- productCount: Number(values
- .productCount),
+ productCount: Number(
+ values
+ .productCount
+ ),
name: values
.name,
attributeList: keys,
@@ -5829,9 +6121,19 @@
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)
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ this.tui.request('/app/product/getByProductSn', "post", {
+ productSn: res1.result
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result != '') {
+ this.generateSn(value)
+ } else {
+ this.addPageGoods(img, res1.result)
+ }
+ }
+ })
} else {
uni.hideLoading()
this.tui.toast(res.message)
@@ -5853,6 +6155,7 @@
productId: "",
productName: "",
wholesalePrice: 0,
+ customerCategoryList:this.customerCategoryList1,
lsprice: 0,
isNew: true,
productPictures: [],
@@ -5861,6 +6164,7 @@
stockLogList: new Map(),
stockLogList1: []
}
+
let key = '{"颜色":"均色","尺码":"均码"}'
let value = {
name: '均色/均码',
@@ -5868,6 +6172,7 @@
}
obj.stockLogList.set(key, value)
this.carList.set(obj.id, obj)
+ console.log('111',this.carList)
this.$forceUpdate()
uni.hideLoading()
},
@@ -5931,6 +6236,7 @@
id: this.goodsDetail.productId ? this.goodsDetail.productId : this.goodsDetail.id,
price: 0,
num: this.zNum,
+ customerCategoryRule:this.goodsDetail.customerCategoryRule != null?JSON.parse(this.goodsDetail.customerCategoryRule):null,
productId: this.goodsDetail.productId,
productName: this.goodsDetail.productName,
wholesalePrice: this.goodsDetail.wholesalePrice,
@@ -5966,6 +6272,7 @@
productCount: 0,
id: carList1[i].id,
productId: carList1[i].id,
+ customerCategoryList:carList1[i].customerCategoryRule != null?carList1[i].customerCategoryRule: this.customerCategoryList1,
wholesalePrice: this.goodsDetail.wholesalePrice,
categoryName: this.goodsDetail.categoryName,
categoryId: carList1[i].categoryId,
@@ -6054,7 +6361,8 @@
}
this.carList.get(carList1[i].id).productCount += Number(carList1[i].saleDetailQueryDTO[
m].productCount)
- that.carList.get(carList1[i].id).price1 = Number(that.carList.get(carList1[i].id).productCount) *
+ that.carList.get(carList1[i].id).price1 = Number(that.carList.get(carList1[i].id)
+ .productCount) *
that.carList.get(carList1[i].id).purchasePrice
}
} else { //商品不同
@@ -6066,6 +6374,7 @@
productId: carList1[i].id,
categoryId: carList1[i].categoryId,
attrId: carList1[i].attrId,
+ customerCategoryList:carList1[i].customerCategoryRule != null?carList1[i].customerCategoryRule: this.customerCategoryList1,
productName: carList1[i].productName,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price,
@@ -6285,20 +6594,23 @@
content: "确定删除此条规格吗?",
success: function(res) {
if (res.confirm) {
- console.log('删除规格',that.carList.get(id))
+ console.log('删除规格', that.carList.get(id))
if (that.carList.get(id).stockLogList.size == 1) {
- that.carList.get(id).productCount = Number(that.carList.get(id).stockLogList.get(name)
+ that.carList.get(id).productCount = Number(that.carList.get(id).stockLogList
+ .get(name)
.productCount);
} else {
- that.carList.get(id).productCount -= Number(that.carList.get(id).stockLogList.get(
- name).productCount);
+ that.carList.get(id).productCount -= Number(that.carList.get(id).stockLogList
+ .get(
+ name).productCount);
}
let count = Number(that.carList.get(id).stockLogList.get(name).productCount)
that.carList.get(id).stockLogList.delete(name)
- that.carList.get(id).price1 = Number(that.carList.get(id).productCount) * that.carList.get(
- id).purchasePrice
+ that.carList.get(id).price1 = Number(that.carList.get(id).productCount) * that
+ .carList.get(
+ id).purchasePrice
if (that.carList.get(id).stockLogList.size == 0) {
let key = '{"颜色":"均色","尺码":"均码"}'
let value = {
@@ -6363,6 +6675,7 @@
}
let purchaseDetails = [];
await this.carList.forEach(function(value, key) {
+ value.customerCategoryRule = JSON.stringify(value.customerCategoryList)
if (that.userType == 1) {
value.purchasePrice = ''
}
@@ -6371,7 +6684,7 @@
title: "货号必须维护~",
icon: 'none'
})
- throw Error("11")
+ throw Error("11")
} else {
value.price = value.lsprice
value.stockLogList1 = []
@@ -6439,7 +6752,8 @@
this.carList.get(id).purchasePrice = Number(e.detail.value)
}
}
- this.carList.get(id).price1 = Number(this.carList.get(id).productCount) * this.carList.get(id).purchasePrice
+ this.carList.get(id).price1 = Number(this.carList.get(id).productCount) * this.carList.get(id)
+ .purchasePrice
this.getAllPrice()
},
//编辑每一个的批和零售
@@ -6512,10 +6826,12 @@
this.carList.get(index[0]).stockLogList.get(index1).productCount = Number(e)
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
- that.carList.get(index[0]).productCount = Number(that.carList.get(index[0]).productCount) + Number(value
- .productCount)
- that.carList.get(index[0]).price1 = Number(that.carList.get(index[0]).productCount) * that.carList.get(
- index[0]).purchasePrice
+ that.carList.get(index[0]).productCount = Number(that.carList.get(index[0]).productCount) +
+ Number(value
+ .productCount)
+ that.carList.get(index[0]).price1 = Number(that.carList.get(index[0]).productCount) * that
+ .carList.get(
+ index[0]).purchasePrice
})
that.getAllPrice()
}
@@ -6696,13 +7012,10 @@
.bottom-box {
width: 100%;
- position: fixed;
- bottom: 0rpx;
display: flex;
background: #fff;
border-top: 1px solid #eee;
- height: 150rpx;
- z-index: 98;
+ height: 10%;
}
.bottom-left {
@@ -6748,6 +7061,15 @@
margin-bottom: 30rpx;
overflow: scroll;
}
+ .popup-content {
+ align-items: center;
+ justify-content: center;
+ padding: 15px;
+ height: 1200rpx;
+ background-color: #fff;
+ margin-bottom: 30rpx;
+ overflow: scroll;
+ }
.shop-popup-title {
display: flex;
@@ -6986,7 +7308,7 @@
}
.scroll-content {
- height: 90%;
+ height: 60%;
}
.zuni-numbox {
diff --git a/package1/index/order.vue b/package1/index/order.vue
index c59a15e..7033458 100644
--- a/package1/index/order.vue
+++ b/package1/index/order.vue
@@ -306,7 +306,7 @@
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
- obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount?item.saleDetailDTOList[i].discountAmount:item.saleDetailDTOList[i].wholesalePrice
+ obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark
diff --git a/package1/index/orderDetail.vue b/package1/index/orderDetail.vue
index 718c55c..c52ecce 100644
--- a/package1/index/orderDetail.vue
+++ b/package1/index/orderDetail.vue
@@ -2,7 +2,7 @@
+ :title="sales.userName == null ?'暂无':sales.userName+'('+(order.phone==undefined?'':order.phone)+')'">
{{sales.province== null?'':sales.province + sales.city== null?'':sales.city + sales.area== null?'':sales.area + sales.receiveAddress== null?'':sales.receiveAddress== null?'':sales.receiveAddress}}
@@ -23,7 +23,7 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture">
暂无图片
- 【销】{{item.productName ? item.productName :''}}
+ {{item.productName ? item.productName :''}}
({{item.productSn == null ? '暂无':item.productSn}})
单价:{{item.discountAmount == null ? '暂无':item.discountAmount}}
数量:{{item.productCount == null ? '暂无':item.productCount}}
@@ -35,8 +35,10 @@
- {{item1.attributeList | sliceMsg}}
- 数量:{{item1.productCount}}
+ 【补】
+ 【销】
+ {{item1.attributeList | sliceMsg}}
+ 数量:{{item1.productCount}}
@@ -64,8 +66,9 @@
- {{item2.attributeList | sliceMsg}}
- 数量:{{item2.productCount}}
+ 【退】
+ {{item2.attributeList | sliceMsg}}
+ 数量:{{item2.productCount}}
@@ -97,14 +100,16 @@
{{ sales.totalAmount == null ?'暂无':sales.totalAmount }}
-
+
退货数量
¥
{{ returnNum == null ?'暂无':returnNum }}
-
+
退货金额
¥
@@ -351,10 +356,6 @@
-
-
-
{
if (res.code == 200) {
+ this.shopName = res.result.shopName;
+ console.log(this.shopName)
this.shopRemark = res.result.remark.split('\n');
console.log('shopRemark', this.shopRemark)
+ this.jinjuPhone = res.result.contactPhone
let qrCode = res.result.shopIcon
// let qrCode = '店铺https://u.wechat.com/EOzom56XQ_1MKeVPPqgwMlI?uVsMiaUpfpOk8MxSE19t4ao0TCVrd,微信wxp://f2f0QYU_-Jjd882vOWEqu7GA8F9Vbo_ftIqsS9muVsMiaUpfpOk8MxSE19t4ao0TCVrd,收款https://life.qujie365.com/smpay/unionpay/index.html?qrcode=80000013007399283719457'
if (qrCode != '') {
@@ -838,7 +845,7 @@
getPrintHeight() {
let that = this;
console.log('newData', that.newData)
- this.printHeight = 940
+ this.printHeight = 960
for (let i = 0; i < that.newData.length; i++) {
this.printHeight += 40
for (let m = 0; m < that.newData[i].stockLogList1.length; m++) {
@@ -872,13 +879,14 @@
console.log('printHeight', this.printHeight)
let strCmd = ''
let pageNum = 1
- that.yNum = 390
+ let Xindex = 0
+ that.yNum = 405
strCmd = blesdk.CreatCPCLPage(1080, this.printHeight >= (1990 * pageNum) ? 1990 : this.printHeight, 1, 0,
0);
strCmd += blesdk.addCPCLSETMAG(4, 4)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
- strCmd += blesdk.addCPCLText('0', '120', '24', '0', 0, uni.getStorageSync('shopName'))
+ strCmd += blesdk.addCPCLText('0', '120', '24', '0', 0, this.shopName)
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
@@ -901,8 +909,8 @@
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 25) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 25), 1, 0, 162);
that.yNum = 0
pageNum++
@@ -913,55 +921,57 @@
'-----------------------------------------------------------------------------------')
}
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
console.log('商品pageNum', pageNum)
console.log('规格', that.yNum)
-
+
for (var m = 0; m < that.newData[i].stockLogList1.length; m++) {
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (
- this.printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (
+ this.printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
console.log('规格pageNum', pageNum)
if (that.newData[i].stockLogList1[m].isReturn) {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn)
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn +
'(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
- if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].productName == that.newData[i].productSn && that.order.name !=
+ '散客') {
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn)
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn)
}
} else {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
@@ -969,8 +979,7 @@
}
- if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that
- .shopId == '1811579958284390400') {
+ if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') {
if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) {
that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m]
.attributeList.replace(/均色/g, '分色')
@@ -1000,30 +1009,32 @@
console.log('规格不等于pageNum', pageNum)
if (that.newData[i].stockLogList1[m].isReturn) {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn)
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn +
'(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
- if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].productName == that.newData[i].productSn && that.order.name !=
+ '散客') {
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn)
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn)
}
} else {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
@@ -1031,8 +1042,7 @@
}
- if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that
- .shopId == '1811579958284390400') {
+ if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') {
if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) {
that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m]
.attributeList.replace(/均色/g, '分色')
@@ -1065,49 +1075,50 @@
console.log('规格', that.yNum)
for (var m = 0; m < that.newData[i].stockLogList1.length; m++) {
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (
- this.printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (
+ this.printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
console.log('规格pageNum', pageNum)
if (that.newData[i].stockLogList1[m].isReturn) {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn)
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn +
'(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
if (that.newData[i].productName == that.newData[i].productSn) {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn)
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn)
}
} else {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
}
}
- if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that
- .shopId == '1811579958284390400') {
+ if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') {
if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) {
that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m]
.attributeList.replace(/均色/g, '分色')
@@ -1138,37 +1149,38 @@
console.log('规格不等于pageNum', pageNum)
if (that.newData[i].stockLogList1[m].isReturn) {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn)
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【退】' + that
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that
.newData[i].productSn +
'(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
if (that.newData[i].productName == that.newData[i].productSn) {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn)
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn)
}
} else {
- if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !=
+ '散客') { //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
- }else{ // 0是没买过
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ } else { // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
}
}
- if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that
- .shopId == '1811579958284390400') {
+ if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') {
if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) {
that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m]
.attributeList.replace(/均色/g, '分色')
@@ -1206,17 +1218,30 @@
// that.yNum = 0
// strCmd = blesdk.CreatCPCLPage(1080, 700, 1, 0);
- strCmd += blesdk.addCPCLText('0', that.yNum += 25, '24', '0', 0,
- '-----------------------------------------------------------------------------------')
+ if (that.yNum + 25 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 25) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 25), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+
+ strCmd += blesdk.addCPCLText('0', that.yNum += 25, '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.yNum += 25, '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ }
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
- if(this.shopId == '1820391948796694529'){
- if (that.yNum + 30 >= 1990 * pageNum) {
+ if (this.shopId == '1820391948796694529') {
+ if (that.yNum + 54 >= 1990 * pageNum) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 30), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 54) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 54), 1, 0, 162);
that.yNum = 0
pageNum++
strCmd +=
@@ -1226,7 +1251,7 @@
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales
.balanceDeductionAmount))
// strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
-
+
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '销售数量:' + that.sales.productCount)
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount)
@@ -1235,15 +1260,15 @@
.balanceDeductionAmount))
// strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
}
-
+
console.log('销售数量', that.yNum)
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 30 >= 1990) {
+ if (that.yNum + 54 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 30), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 54) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 54), 1, 0, 162);
that.yNum = 0
pageNum++
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '退货数量:' + that.returnNum)
@@ -1254,25 +1279,27 @@
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice)
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '其他费用:' + (that.sales.otherExpense))
}
-
+
console.log('退货数量', that.yNum)
- if (that.yNum + 30 >= 1990) {
+ if (that.yNum + 54 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 30), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 54) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 54), 1, 0, 162);
that.yNum = 0
pageNum++
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '欠款抵退货:' + that.sales
.debtDeductionAmount)
- strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount)
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales
+ .saleDeductionAmount)
strCmd += blesdk.addCPCLSETMAG(1, 2)
if (that.dealingsRecord.lastDebtAmount >= 0) {
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord
.lastDebtAmount)
} else if (that.dealingsRecord.lastDebtAmount < 0) {
- strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord
+ strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that
+ .dealingsRecord
.lastDebtAmount))
} else {
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '之前欠款:0')
@@ -1280,7 +1307,8 @@
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '欠款抵退货:' + that.sales
.debtDeductionAmount)
- strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount)
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales
+ .saleDeductionAmount)
// strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales
// .balanceDeductionAmount))
strCmd += blesdk.addCPCLSETMAG(1, 1)
@@ -1295,18 +1323,18 @@
strCmd += blesdk.addCPCLText('580', (that.yNum), '24', '0', 0, '之前欠款:0')
}
}
-
+
console.log('欠款抵退货', that.yNum)
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 30 >= 1990) {
+ if (that.yNum + 54 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 30), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 54) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 54), 1, 0, 162);
that.yNum = 0
pageNum++
-
+
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单应收:' + that.sales.realAmount)
if (that.sales.noEarn >= 0) {
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
@@ -1323,10 +1351,10 @@
} else {
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '累计欠款:0')
}
-
+
} else {
-
-
+
+
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单应收:' + that.sales.realAmount)
if (that.sales.noEarn >= 0) {
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
@@ -1344,24 +1372,128 @@
strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '累计欠款:0')
}
}
- if (that.yNum + 30 >= 1990) {
+ if (that.yNum + 54 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 54) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 54), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('580', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
+ .alreadyEarn)
+ } else {
+
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('580', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
+ .alreadyEarn)
+ }
+ }else if(this.shopId == '1821406205034237952' || this.shopId == '1810179818189361152') { //董大姐
+ if (that.yNum + 64 >= 1990 * pageNum) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 30), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '合计:')
+ strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount+'件')
+ strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥'+that.sales.totalAmount)
+ } else {
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '合计:')
+ strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount+'件')
+ strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥'+that.sales.totalAmount)
+ }
+ if (that.yNum + 60 >= 1990 * pageNum) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 60), 1, 0, 162);
that.yNum = 0
pageNum++
-
strCmd += blesdk.addCPCLSETMAG(1, 2)
- strCmd += blesdk.addCPCLText('580', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' +that.sales.realAmount +'('+ this.convertToChineseNumeral(that.sales.realAmount)+')')
} else {
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' +that.sales.realAmount +'('+ this.convertToChineseNumeral(that.sales.realAmount)+')')
+ }
+ if (that.yNum + 60 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 60), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
+ .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn)+ ')')
+ } else {
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales
+ .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn)+ ')')
+ }
+ if (that.yNum + 60 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 60), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ if (that.dealingsRecord.lastDebtAmount >= 0) {
+ strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前欠款:' + that.dealingsRecord
+ .lastDebtAmount)
+ } else if (that.dealingsRecord.lastDebtAmount < 0) {
+ strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前余额:' + Math.abs(that
+ .dealingsRecord
+ .lastDebtAmount))
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前欠款:0')
+ }
+ if (that.dealingsRecord.balanceDue >= 0) {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
+ .balanceDue)
+ } else if (that.dealingsRecord.balanceDue < 0) {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that
+ .dealingsRecord.balanceDue))
+ } else {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:0')
+ }
+ } else {
strCmd += blesdk.addCPCLSETMAG(1, 2)
- strCmd += blesdk.addCPCLText('580', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
+ if (that.dealingsRecord.lastDebtAmount >= 0) {
+ strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前欠款:' + that.dealingsRecord
+ .lastDebtAmount)
+ } else if (that.dealingsRecord.lastDebtAmount < 0) {
+ strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前余额:' + Math.abs(that
+ .dealingsRecord
+ .lastDebtAmount))
+ } else {
+ strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前欠款:0')
+ }
+
+ if (that.dealingsRecord.balanceDue >= 0) {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
+ .balanceDue)
+ } else if (that.dealingsRecord.balanceDue < 0) {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that
+ .dealingsRecord.balanceDue))
+ } else {
+ strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:0')
+ }
}
- }else{
- if (that.yNum + 60 >= 1990 * pageNum) {
+ if (that.yNum + 60 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
@@ -1369,6 +1501,60 @@
.printHeight - that.yNum + 60), 1, 0, 162);
that.yNum = 0
pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ } else {
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ }
+
+ console.log('销售数量', that.yNum)
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+
+ if (that.yNum + 30 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 30), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ if (that.sales.noEarn >= 0) {
+ strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales
+ .noEarn))
+ }
+ if(that.returnPrice > 0){
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum)
+ strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice)
+ }
+ } else {
+ if (that.sales.noEarn >= 0) {
+ strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales
+ .noEarn))
+ }
+ if(that.returnPrice > 0){
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum)
+ strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice)
+ }
+ }
+
+ console.log('退货数量', that.yNum)
+
+ } else {
+ if (that.yNum + 84 >= 1990 * pageNum) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 84) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 84), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
strCmd +=
blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '销售数量:' + that.sales.productCount)
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount)
@@ -1376,7 +1562,7 @@
strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales
.balanceDeductionAmount))
// strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
-
+
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '销售数量:' + that.sales.productCount)
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount)
@@ -1385,15 +1571,15 @@
.balanceDeductionAmount))
// strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
}
-
+
console.log('销售数量', that.yNum)
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 60 >= 1990) {
+ if (that.yNum + 84 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 60), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 84) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 84), 1, 0, 162);
that.yNum = 0
pageNum++
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '退货数量:' + that.returnNum)
@@ -1404,25 +1590,27 @@
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice)
strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '其他费用:' + (that.sales.otherExpense))
}
-
+
console.log('退货数量', that.yNum)
- if (that.yNum + 60 >= 1990) {
+ if (that.yNum + 84 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 60), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 84) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 84), 1, 0, 162);
that.yNum = 0
pageNum++
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '欠款抵退货:' + that.sales
.debtDeductionAmount)
- strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount)
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales
+ .saleDeductionAmount)
strCmd += blesdk.addCPCLSETMAG(1, 2)
if (that.dealingsRecord.lastDebtAmount >= 0) {
strCmd += blesdk.addCPCLText('600', that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord
.lastDebtAmount)
} else if (that.dealingsRecord.lastDebtAmount < 0) {
- strCmd += blesdk.addCPCLText('600', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord
+ strCmd += blesdk.addCPCLText('600', that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that
+ .dealingsRecord
.lastDebtAmount))
} else {
strCmd += blesdk.addCPCLText('600', that.yNum, '24', '0', 0, '之前欠款:0')
@@ -1430,12 +1618,14 @@
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '欠款抵退货:' + that.sales
.debtDeductionAmount)
- strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount)
+ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '销售抵退货:' + that.sales
+ .saleDeductionAmount)
// strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales
// .balanceDeductionAmount))
strCmd += blesdk.addCPCLSETMAG(1, 2)
if (that.dealingsRecord.lastDebtAmount >= 0) {
- strCmd += blesdk.addCPCLText('610', (that.yNum - 10), '24', '0', 0, '之前欠款:' + that.dealingsRecord
+ strCmd += blesdk.addCPCLText('610', (that.yNum - 10), '24', '0', 0, '之前欠款:' + that
+ .dealingsRecord
.lastDebtAmount)
} else if (that.dealingsRecord.lastDebtAmount < 0) {
strCmd += blesdk.addCPCLText('610', (that.yNum - 10), '24', '0', 0, '之前余额:' + Math.abs(that
@@ -1445,38 +1635,44 @@
strCmd += blesdk.addCPCLText('610', (that.yNum - 10), '24', '0', 0, '之前欠款:0')
}
}
-
+
console.log('欠款抵退货', that.yNum)
- strCmd += blesdk.addCPCLSETMAG(1, 2)
- if (that.yNum + 60 >= 1990) {
+
+ if (that.yNum + 94 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 60), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 94) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 94), 1, 0, 162);
that.yNum = 0
pageNum++
- strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
- strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount)
-
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount+'('+that.convertToChineseNumeral(that.sales.realAmount)+')')
+ strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
+
+
} else {
-
- strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
- strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount)
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount+'(' + that.convertToChineseNumeral(that.sales.realAmount)+')')
+ strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn)
+
}
- if (that.yNum + 60 >= 1990) {
+
+ if (that.yNum + 114 >= 1990) {
+
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
-
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 60), 1, 0, 162);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 114) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 114), 1, 0, 162);
that.yNum = 0
pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
if (that.sales.noEarn >= 0) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
+ strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + that.sales.noEarn + '('+ that.convertToChineseNumeral(that.sales.noEarn) +')')
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales
- .noEarn))
+ .noEarn) + '('+ that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) +')')
}
if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
@@ -1488,11 +1684,12 @@
strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '累计欠款:0')
}
} else {
+ strCmd += blesdk.addCPCLSETMAG(1, 2)
if (that.sales.noEarn >= 0) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + (that.sales.noEarn))
+ strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + (that.sales.noEarn) + '('+ that.convertToChineseNumeral(that.sales.noEarn) +')')
} else {
strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales
- .noEarn))
+ .noEarn) + '('+ that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) +')')
}
if (that.dealingsRecord.balanceDue >= 0) {
strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord
@@ -1505,35 +1702,39 @@
}
}
}
- strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 60 >= 1990) {
+
+ if (that.yNum + 40 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
.printHeight - that.yNum + 40), 1, 0, 162);
that.yNum = 0
pageNum++
- strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0,
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0,
'-----------------------------------------------------------------------------------')
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0,
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0,
'-----------------------------------------------------------------------------------')
}
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
if (that.sales.remark) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '订单备注:' + that.sales.remark)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
'-----------------------------------------------------------------------------------')
}
} else {
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
if (that.sales.remark) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '订单备注:' + that.sales.remark)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
@@ -1543,14 +1744,15 @@
//店铺地址
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
for (let i = 0; i < this.addressArr.length; i++) {
// strCmd += blesdk.addCPCLText('50', yNum += 40, '24', '0', 0, this.addressArr[i])
if (i == 0) {
@@ -1576,33 +1778,66 @@
//店铺电话
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 40 >= 1990) {
- strCmd += blesdk.addCPCLPrint();
- that.bufferData.push(strCmd);
+ if (this.shopId == '1820391948796694529') {
+ if (that.yNum + 64 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
- that.yNum = 0
- pageNum++
- strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync(
- 'shopOwnerPhone')?uni.getStorageSync('shopOwnerPhone'): uni.getStorageSync('username')))
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + this.jinjuPhone)
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + this.jinjuPhone)
+ }
+ }else if (this.shopId == '1834512626093264897' || this.shopId == '1810179818189361152') {
+ if (that.yNum + 64 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:13191998128')
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:13191998128')
+ }
} else {
- strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync(
- 'shopOwnerPhone')?uni.getStorageSync('shopOwnerPhone'): uni.getStorageSync('username')))
+ if (that.yNum + 64 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync(
+ 'shopOwnerPhone') ? uni.getStorageSync('shopOwnerPhone') : uni.getStorageSync(
+ 'username')))
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync(
+ 'shopOwnerPhone') ? uni.getStorageSync('shopOwnerPhone') : uni.getStorageSync(
+ 'username')))
+ }
}
+
//物流
if (this.sales.companyName != null) {
strCmd += blesdk.addCPCLSETMAG(1, 1)
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
-
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '发货方式:' + this.sales
.companyName + ' ' + this.sales.companyPhone)
} else {
@@ -1614,27 +1849,42 @@
//店铺备注
if (this.shopRemark.length > 0) {
for (let i = 0; i < this.shopRemark.length; i++) {
- if (that.yNum + 40 >= 1990) {
+ if (that.yNum + 64 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 40) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 40), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
that.yNum = 0
pageNum++
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, this.shopRemark[i])
} else {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, this.shopRemark[i])
}
}
}
-
+
+ if (that.yNum + 64 >= 1990) {
+ strCmd += blesdk.addCPCLPrint();
+ that.bufferData.push(strCmd);
+
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 64), 1, 0, 162);
+ that.yNum = 0
+ pageNum++
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ } else {
+ strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
+ '-----------------------------------------------------------------------------------')
+ }
if (that.yNum + 300 >= 1990) {
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
- strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 260) >= 1990 ? 1990 : (this
- .printHeight - that.yNum + 260), 1, 0, 162);
+ strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 270) >= 1990 ? 1990 : (this
+ .printHeight - that.yNum + 270), 1, 0, 162);
that.yNum = 0
pageNum++
if (that.qrArr.length != 0) {
@@ -1642,24 +1892,21 @@
for (let i = 0; i < that.qrArr.length; i++) {
//店铺二维码
if (i == 0) {
- strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 80),
- that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 220),
- '24',
- '0', 0, that.qrArr[i].name)
+ 40),'24','0', 0, that.qrArr[i].name)
+ strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
+ 40),
+ that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
+
+
} else {
- strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -=
- 220),
- that
- .qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLSETMAG(1, 1)
- strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 220),
- '24',
- '0', 0, that.qrArr[i].name)
+ strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -=
+ 40),'24','0', 0, that.qrArr[i].name)
+ strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
+ 40),that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
+
}
if (that.qrArr.length == (i + 1)) {
strCmd += blesdk.addCPCLPrint();
@@ -1676,24 +1923,23 @@
for (let i = 0; i < that.qrArr.length; i++) {
//店铺二维码
if (i == 0) {
- strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 80),
- that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 220),
- '24',
- '0', 0, that.qrArr[i].name)
+ 40),'24','0', 0, that.qrArr[i].name)
+ strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
+ 40),
+ that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
+
+
} else {
- strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -=
- 220),
+ strCmd += blesdk.addCPCLSETMAG(1, 1)
+ strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -=
+ 40),'24','0', 0, that.qrArr[i].name)
+ strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
+ 40),
that
.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
- strCmd += blesdk.addCPCLSETMAG(1, 1)
- strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum +=
- 220),
- '24',
- '0', 0, that.qrArr[i].name)
+
}
if (that.qrArr.length == (i + 1)) {
strCmd += blesdk.addCPCLPrint();
@@ -1942,15 +2188,16 @@
undefined) {
that.returnList.push(res.result)
that.shopList.push(...res.result.saleDetailDTOList);
-
+
for (let j = 0; j < res.result.saleDetailDTOList
.length; j++) {
let isTure = true
res.result.saleDetailDTOList[j].productCount = 0
for (let m = 0; m < res.result.saleDetailDTOList[j]
.stockLogList1.length; m++) {
- res.result.saleDetailDTOList[j].productCount +=
- res.result.saleDetailDTOList[j].stockLogList1[m].productCount
+ res.result.saleDetailDTOList[j].productCount +=
+ res.result.saleDetailDTOList[j]
+ .stockLogList1[m].productCount
res.result.saleDetailDTOList[j].stockLogList1[
m].isReturn = true
res.result.saleDetailDTOList[j].stockLogList1[
@@ -1974,7 +2221,7 @@
}
}).catch((res) => {})
})
-
+
} else {
for (let i = 0; i < that.list.length; i++) {
for (let z = 0; z < that.list[i].stockLogList1.length; z++) {
@@ -1993,6 +2240,91 @@
}, 500)
})
},
+ // 金额转大写
+ convertToChineseNumeral(money) {
+ let fu = false
+ console.log('金额转大写',money)
+ if(money == 0){
+ return '零元整'
+ }
+ if(JSON.stringify(money).indexOf('-') != -1){
+ money = JSON.stringify(money).split('-')[1]
+ fu = true
+ }
+ const cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
+ const cnIntRadice = ['', '拾', '佰', '仟']
+ const cnIntUnits = ['', '万', '亿', '兆']
+ const cnDecUnits = ['角', '分', '毫', '厘']
+ const cnInteger = '整'
+ const cnIntLast = '元'
+ const maxNum = 999999999999999.9999
+ let integerNum
+ let decimalNum
+ let chineseStr = ''
+ let parts
+ if (money == '') {
+ return ''
+ }
+ money = parseFloat(money)
+ if (money >= maxNum) {
+ return ''
+ }
+ if (money == 0) {
+ chineseStr = cnNums[0] + cnIntLast + cnInteger
+ return chineseStr
+ }
+ money = money.toString()
+ if (money.indexOf('.') == -1) {
+ integerNum = money
+ decimalNum = ''
+ } else {
+ parts = money.split('.')
+ integerNum = parts[0]
+ decimalNum = parts[1].substr(0, 4)
+ }
+ if (parseInt(integerNum, 10) > 0) {
+ let zeroCount = 0
+ const IntLen = integerNum.length
+ for (let i = 0; i < IntLen; i++) {
+ const n = integerNum.substr(i, 1)
+ const p = IntLen - i - 1
+ const q = p / 4
+ const m = p % 4
+ if (n == '0') {
+ zeroCount++
+ } else {
+ if (zeroCount > 0) {
+ chineseStr += cnNums[0]
+ }
+ zeroCount = 0
+ chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]
+ }
+ if (m == 0 && zeroCount < 4) {
+ chineseStr += cnIntUnits[q]
+ }
+ }
+ chineseStr += cnIntLast
+ }
+ if (decimalNum != '') {
+ const decLen = decimalNum.length
+ for (let i = 0; i < decLen; i++) {
+ const n = decimalNum.substr(i, 1)
+ if (n != '0') {
+ chineseStr += cnNums[Number(n)] + cnDecUnits[i]
+ }
+ }
+ }
+ if (chineseStr == '') {
+ chineseStr += cnNums[0] + cnIntLast + cnInteger
+ } else if (decimalNum == '') {
+ chineseStr += cnInteger
+ }
+ if(fu == true){
+ chineseStr = '负' + chineseStr
+ }
+ console.log('金额转大写',chineseStr)
+ return chineseStr
+ },
getAllGoodsList() {
let that = this;
this.newData = JSON.parse(JSON.stringify(this.list))
@@ -2398,7 +2730,6 @@
}
.shop-collapse text {
- flex: 1;
text-align: center;
// padding-right: 40rpx;
border-right: 1px solid #eee;
diff --git a/package1/index/peopleList.vue b/package1/index/peopleList.vue
index f215f64..b0bb6e8 100644
--- a/package1/index/peopleList.vue
+++ b/package1/index/peopleList.vue
@@ -11,11 +11,11 @@
+ @confirm="search" @clear="clearSearch" />
+ @confirm="search" @clear="clearSearch" />
@@ -61,11 +61,16 @@
-
+
-
- 欠款人数:{{allData.personCount?allData.personCount:0}}
- 欠款总金额:{{allData.amountOwed?allData.amountOwed:0}}
+
+ {{allData.personCount?allData.personCount:0}}欠款人数
+ {{allData.amountOwed?allData.amountOwed:0}}欠款总额
+ {{allData.purchasingCount?allData.purchasingCount:0}}今日入库件数
+
+
+ 欠款人数:{{allData.personCount?allData.personCount:0}}
+ 欠款总额:{{allData.amountOwed?allData.amountOwed:0}}
{{item.consigneeMobile != 'undefined' &&item.consigneeMobile != null &&item.consigneeMobile != undefined ?item.consigneeMobile:'-'}}
- {{item.name}}({{item.notBuyDays+'天未拿货'}})
- {{item.phone}}
+
+ {{item.name}}
+ ({{item.categoryName}})
+
+
+ {{item.phone}}
+
{{(item.name == '散客' || item.consigneeName == '默认供应商') && item.city != null && item.city != undefined?'-':item.province + item.city + item.area}}
@@ -93,7 +103,10 @@
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
-
+
+
+ {{item.notBuyDays+'天未拿货'}}
+
充值
@@ -572,6 +585,12 @@
this.popleList = []
this.getPeopleType()
},
+ clearSearch(){
+ this.pages = 1
+ this.searchName = ""
+ this.popleList = []
+ this.getPeopleType()
+ },
//查询拉包工和快递人员的列表
kdyOrlbgList() {
this.status = 'loading';
@@ -615,7 +634,8 @@
if (res.code == 200) {
this.pages = 1
this.popleList = []
- this.khOrGysList()
+ this.khOrGysList()
+ this.getAllPeople()
this.tui.toast('充值成功')
this.keyboardNum = ''
this.$refs.inputDialog.close()
@@ -639,7 +659,7 @@
},
goDetail(data){
uni.navigateTo({
- url: "/pages/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
+ url: "/package1/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
})
},
//打开弹出层
diff --git a/package1/inventory/addGoods.vue b/package1/inventory/addGoods.vue
index 1a2ed5a..4622031 100644
--- a/package1/inventory/addGoods.vue
+++ b/package1/inventory/addGoods.vue
@@ -1,4 +1,4 @@
-
+
@@ -6,164 +6,189 @@
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.attributeName}}
+
+
+
+ {{item1.value}}
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
- {{item.attributeName}}
-
-
-
- {{item1.value}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -202,12 +227,32 @@
+
+
+
+
-