Browse Source

修改开单选择商品逻辑

master
wangfukang 3 years ago
parent
commit
cb137cbf88
  1. BIN
      pages/.DS_Store
  2. 74
      pages/billing/addUser.vue
  3. 8
      pages/billing/billing.vue
  4. 294
      pages/billing/changeGoods1.vue
  5. 1
      pages/billing/goodsOutInfo.vue
  6. 4
      pages/billing/outOrder.vue
  7. 26
      pages/billing/saveOrder.vue
  8. 16
      pages/index/addHangOrder.vue
  9. 1
      pages/index/checkShop.vue
  10. 267
      pages/index/downStearmList.vue
  11. 1
      pages/index/downstream.vue
  12. 15
      pages/index/index.vue
  13. 7
      pages/index/order.vue
  14. 47
      pages/index/orderDetail.vue
  15. 11
      pages/index/peopleList.vue
  16. 14
      pages/index/shareStyle.vue
  17. 1
      pages/index/shopInfo.vue
  18. 1
      pages/index/uparrears.vue
  19. 1
      pages/index/upstream.vue
  20. 2
      pages/index/waitStorageDetail.vue
  21. 133
      pages/info/editStore.vue
  22. 48
      pages/info/index.vue
  23. 19
      pages/info/info.vue
  24. 49
      pages/inventory/addGoods.vue
  25. 284
      pages/inventory/changeGoods1.vue
  26. 20
      pages/inventory/gategoryLow.vue
  27. 74
      pages/inventory/goodsList1.vue
  28. 2
      pages/inventory/inventoryDetail.vue

BIN
pages/.DS_Store

Binary file not shown.

74
pages/billing/addUser.vue

@ -102,14 +102,9 @@
// 需要在onReady中设置规则
this.$refs.form.setRules(this.rules)
},
onLoad(option) {
// if(option.data){
// let data = JSON.parse(option.data)
// }
onLoad(option) {
this.popleType = option.popleType
this.type=option.type
console.log(option.popleType)
console.log(option.type)
this.type=option.type
if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area
this.formData.address = data.address
@ -119,8 +114,7 @@
this.formData.id = data.id
this.formData.consigneeMobile = data.consigneeMobile
this.formData.consigneeName = data.consigneeName
}
console.log(this.formData)
}
},
methods: {
del() {
@ -144,34 +138,16 @@
})
}
})
// this.tui.request("/app/customer/delById", "post", {
// id: this.userInfo.id,
// }, false, true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "删除成功",
// icon: 'none'
// })
// uni.navigateBack()
// } else {
// uni.showToast({
// title: "删除失败",
// icon: 'none'
// })
// }
// })
},
nameBlur() {
this.formData.username = this.formData.phone;
},
openPicker() {
console.log('执行打开地址选择器')
this.show = true
},
onhideShow() {
this.show = false
console.log('执行了关闭地址选择器')
},
//选中省市区
onsetCity(e) {
@ -184,8 +160,6 @@
city: data.city,
area: data.area,
}
console.log(this.formData, this.addressObj);
},
// 触发提交表单
submit() {
@ -242,50 +216,8 @@
}
})
}
// if (that.type == 'edit') {
// res.id = that.userInfo.id
// that.tui.request("/app/supplier/edit", "post", this.formData, false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "修改成功",
// icon: 'none'
// })
// uni.navigateBack()
// } else {
// uni.showToast({
// title: "修改失败",
// icon: 'none'
// })
// }
// })
// } else {
// that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "添加成功",
// icon: 'none'
// })
// let pages =
// getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
// let prevPage = pages[pages.length - 2]; //上一页页面实例
// prevPage.$vm.popleType = 'gysName'
// uni.navigateBack({
// delta: 1
// })
// } else {
// uni.showToast({
// title: "添加失败",
// icon: 'none'
// })
// }
// })
// }
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}

8
pages/billing/billing.vue

@ -26,13 +26,6 @@
totalPages: 1,
}
},
onShow() {
// this.tui.request("/app/sale/list", "post", {
// pageNumber: this.pageIndex,
// pageSize: this.pageSize,
// }, false, false).then((res) => {
// })
},
methods: {
scanCodeAdd() {
@ -52,7 +45,6 @@
})
},
goodsAdd() {
// &purchaseDetails=" + encodeURIComponent(JSON.stringify(this.saleDetailList))
uni.navigateTo({
url: "/pages/inventory/goodsList?type=billing"
})

294
pages/billing/changeGoods1.vue

@ -63,23 +63,16 @@
<view class="popup-content">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png"
<img :src="goodsDetail.productPicture"
alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view>
<view class="popup-title-right-box">{{goodsDetail.productSn}}</view>
<!-- <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">修改价格</text>
</view> -->
</view>
</view>
<view class="popup-container">
<!-- <view class="purchase-price" v-if="storageType == 0">
<view style="margin-right: 20rpx;">实际价格</view>
<uni-easyinput type="text" v-model="purchasePrice" placeholder="请输入实际价格" />
</view> -->
<ul style="border-top:20rpx;">
<li v-for="(items,index) in goodsDetail.attributeList" :key="index">
<view class="title-fur">
@ -104,7 +97,7 @@
<view class="popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="popup-bottom-left">
<text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text>
<!-- <text>¥{{zPrice}}</text> -->
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view>
@ -113,51 +106,36 @@
</view>
</uni-popup>
</view>
<!-- 弹出输入框 -->
<uni-popup ref="inputDialog" background-color="#fff" @change="change">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择商品价格</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.price)">
<text style="display: inline-block">零售价:¥{{goodsDetail.price}}</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.wholesalePrice)">
<text style="display: inline-block">批发价:¥{{goodsDetail.wholesalePrice}}</text>
</view>
</view>
</uni-popup>
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;">
<view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png"
<img :src="item.productPicture"
alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{value[1].price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box">
<text style="margin-right:20rpx;">供应商:{{item.supplierName}}</text>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])">
<view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{values[0] | sliceMsg}}
{{item1.attributeList | sliceMsg}}
</view>
<uni-number-box max="100000" v-model="values[1]" @change="change" />
<uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view>
</view>
</view>
@ -204,9 +182,7 @@
storageType: '',
carNum: 0,
carType: 0,
type: '',
oldList: [],
newList: new Map()
type: ''
}
},
filters: {
@ -235,9 +211,7 @@
methods: {
//初始化获取分类列表
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
// shopId: 1,
}, false, true).then((res) => {
this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => {
if (res.code == 200) {
this.indexList = res.result;
for (var i = 0; i < this.indexList.length; i++) {
@ -298,15 +272,15 @@
if (this.temporaryList.length == 0) {
this.temporaryList.push(this.attributeList);
} else {
for (var i = 0; i < this.temporaryList.length; i++) {
for (var i = 0; i < this.temporaryList.length; i++) {
console.log(this.temporaryList[i].name.indexOf(this.attributeList.name))
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList
return
} else {
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
return
}
}else{
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
return
}
}
}
@ -316,9 +290,7 @@
},
temporaryChange(val) {
console.log(val)
this.zNum = 0
console.log(this.temporaryList)
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
}
@ -343,24 +315,36 @@
pageSize: '10'
}, false, false).then((res) => {
if (res.code == 200) {
console.log(res.result.records)
this.shopList = res.result.records
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
change(){
},
//获取弹出层状态
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
//
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.carNum += this.carList[i].num
}
},
//弹出购物车或者商品规格选择弹窗
toggle(type, item) {
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
this.oldList = this.carList
console.log(this.carList)
this.oldList = this.carList
this.newFun()
// this.newFun()
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
@ -373,114 +357,55 @@
}
},
newFun() {
//newList 已经是map格式了 新数组 初始为空
//carList 旧数组
for (let i = 0; i < this.carList.length; i++) {
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
}
}
}
},
//选择商品查询商品规格
checkGoods(item) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
if(item.id == this.carList[i].id){
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].saleDetailQueryDTO
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
} else {
this.tui.toast(res.message)
newArr.push({
name: val,
value: valueObj
})
}
}).catch((res) => {})
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//顶部搜索框
search(res) {
@ -513,9 +438,9 @@
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id)
},
inputDialogToggle() {
this.$refs.inputDialog.open()
},
// inputDialogToggle() {
// this.$refs.inputDialog.open()
// },
//临时改价
changePrice(val) {
this.goodsDetail.price = this.temporaryList[0].price = val
@ -534,16 +459,30 @@
saleDetailQueryDTO1: [],
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
if(this.carList.length == 0){
this.carList.push(data)
}else{
let aa = true;
for(let i = 0; i < this.carList.length; i++){
if(this.carList[i].id == data.id){
this.carList[i] = data
aa = false
}
}
if(aa){
this.carList.push(data)
}
}
this.carList.push(data)
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
}
}
console.log(this.carList)
this.temporaryList = []
this.purchasePrice = ''
this.zPrice = ''
@ -558,33 +497,50 @@
},
//删除整条商品
delShop(id) {
delShop(item) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
if (that.newList.has(id) == true) {
that.newList.delete(id)
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].id == item.id){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//删除商品下的某一个规格
delShopSpec(name) {
delShopSpec(index,index1) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.newList.get(id).stockLogList.delete(name)
if (that.newList.get(id).stockLogList.size == 0) {
that.newList.delete(id)
for(let i=0;i<that.carList.length;i++){
for(let m=0;m<that.carList[i].saleDetailQueryDTO.length;m++){
if(that.carList[i].id == index){
if(that.carList[i].saleDetailQueryDTO[m].attributeList == index1){
that.carList[i].num -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carNum -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carList[i].saleDetailQueryDTO.splice(m, 1)
continue;
}
}
}
if(that.carList[i].saleDetailQueryDTO.length == 0){
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}

1
pages/billing/goodsOutInfo.vue

@ -103,7 +103,6 @@ export default {
},
async getAttributeList() {
const res = await this.tui.request('/app/attribute/list','get',{type:2,categoryId:2},false,false,false)
console.log(res)
}
}
}

4
pages/billing/outOrder.vue

@ -118,9 +118,9 @@ export default {
// 触发提交表单
submit() {
this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}

26
pages/billing/saveOrder.vue

@ -86,7 +86,6 @@
if (res.code == 200) {
this.categoryList = res.result;
this.candidates = res.result.map(item =>{ return item.name})
// this.formData.name = "";
this.formData.address1 = "";
this.formData.address = "";
@ -98,18 +97,13 @@
if (res.code !== 200) return
this.staffList = res.result;
this.createCandidates = res.result.map(item =>{ return item.nickname})
console.log(this.createCandidates,'this.createCandidates');
})
},
onLoad(options) {
this.purchase = JSON.parse(decodeURIComponent(options.purchase))
this.saleDetailList = JSON.parse(decodeURIComponent(options.saleDetailList))
},
// computed:{
// payStatus() {
// }
// }
methods:{
addUser( type ) {
if(type == 'add') {
@ -133,7 +127,6 @@
if(obj.length > 0) {
this.userObj = obj[0]
this.userObj.address1 = obj[0].province + obj[0].city + obj[0].area;
// this.formData = Object.assign(this.formData, this.userObj)
this.formData.address1 = this.userObj.address1
this.formData.address = this.userObj.address
this.formData.area = this.userObj.area
@ -196,15 +189,6 @@
}
})
},
/**
* 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
* @param {String} name 字段名称
* @param {String} value 表单域的值
*/
// binddata(name,value){
// 通过 input 事件设置表单指定 name 的值
// this.$refs.form.setValue(name, value)
// },
// 触发提交表单
submit() {
let companyId
@ -235,7 +219,7 @@
} else {
payStatus = 0
}
console.log(this.purchase,'this.purchase');
let obj = {
orderByWorker: workerId,
sale: {
@ -257,9 +241,9 @@
saleDetailList: this.saleDetailList,
transCompany: companyId,
}
console.log(this.formData,this.saleDetailList, workerId, companyId ,this.company,this.orderByWorkerList, obj);
this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
@ -277,7 +261,7 @@
}
})
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}

16
pages/index/addHangOrder.vue

@ -50,7 +50,7 @@
</view>
<!-- 语音识别弹出层 -->
<view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="popup-title">
<text>语音录入</text>
@ -77,7 +77,7 @@
</view>
<!-- 弹出层 -->
<view>
<uni-popup ref="shopPopup" background-color="#fff" @change="change">
<uni-popup ref="shopPopup" background-color="#fff">
<view class="shop-popup-content">
<view class="shop-popup-title">
<view class="shop-popup-title-left">
@ -105,7 +105,7 @@
</view>
<view class="shop-attrs">
<uni-data-checkbox v-model="value" :localdata="range"
@change="change"></uni-data-checkbox>
></uni-data-checkbox>
<text v-for="(itemTag, index1) in items.value" :key="index1"
@tap.stop="attrNameChange(index,index1) "
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
@ -132,7 +132,7 @@
</uni-popup>
</view>
<!-- 弹出输入框 -->
<uni-popup ref="payDialog" background-color="#fff" @change="change">
<uni-popup ref="payDialog" background-color="#fff">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择商品价格</text>
@ -156,7 +156,7 @@
@confirm="setDetail"></uni-popup-dialog>
</uni-popup>
<!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change">
<uni-popup ref="imgPopup" background-color="#fff">
<view class="img-popup-content">
<img :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view>
@ -244,9 +244,6 @@
clickCollapse(item) {
item.isCollapse = !item.isCollapse
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//关闭弹出层
close() {
this.$refs.popup.close()
@ -561,7 +558,6 @@
delGoods(item, productId) {
let that = this;
this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
@ -582,7 +578,6 @@
delGoodsPrecs(item, index, index1) {
let that = this;
this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({
title: "提示",
content: "确定删除此条规格吗?",
@ -643,7 +638,6 @@
obj.createByName = item.createByName
dataList.push(obj)
}
console.log(dataList)
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('khName', '')
}

1
pages/index/checkShop.vue

@ -145,7 +145,6 @@ export default {
}else{
this.tui.toast(res.message)
}
console.log(res)
})
}
}

267
pages/index/downStearmList.vue

@ -54,7 +54,7 @@
<view class="popup-content">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="goodsDetail.productPicture" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
@ -129,10 +129,10 @@
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
<view v-for="item in carList" style="position: relative;">
<view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="item.productPicture" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
@ -140,22 +140,22 @@
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{item.price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item.id)">
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="items in item.stockLogList1">
<view class="popup-container" v-for="(item1,index1) in item.stockLogList1">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(items.name)">
<view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)" :key="index1">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{items.name}}
{{item1.name}}
</view>
<uni-number-box max="100000" v-model="items.productCount" @change="change" />
<uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view>
</view>
</view>
@ -165,7 +165,7 @@
<text>{{carType}} 款 {{carNum}} 件</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="">选好了</view>
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view>
</view>
</view>
@ -271,7 +271,8 @@
}
this.keyList.map((item, index) => {
obj[item] = evalue[index]
})
})
let jishuqi = 0;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
if (this.goodsDetail.attributeList[i].isChecked == true) {
@ -296,18 +297,21 @@
if (this.temporaryList.length == 0) {
this.temporaryList.push(this.attributeList);
} else {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList
return
} else {
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
return
}
}
for (var i = 0; i < this.temporaryList.length; i++) {
console.log(this.temporaryList[i].name.indexOf(this.attributeList.name))
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
console.log(this.temporaryList)
return
}else{
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
console.log(this.temporaryList)
return
}
}
}
}
}
}
},
temporaryChange(val) {
@ -323,18 +327,19 @@
},
//获取弹出层状态
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//弹出购物车或者商品规格选择弹窗
toggle(type, item) {
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
this.$refs.carPopup.open('bottom')
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
}
if (type == 'carPopup') {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
}
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length
} else {
this.checkGoods(item);
@ -344,46 +349,54 @@
},
//选择商品查询商品规格
checkGoods(item) {
this.purchasePrice = item.price;
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
this.purchasePrice = item.price;
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
if(item.id == this.carList[i].productId){
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].stockLogList1
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
} else {
this.tui.toast(res.message)
newArr.push({
name: val,
value: valueObj
})
}
}).catch((res) => {})
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//顶部搜索框
search(res) {
@ -392,6 +405,17 @@
},
inputDialogToggle() {
this.$refs.inputDialog.open()
},
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
this.carNum += this.carList[i].num
}
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
@ -406,8 +430,30 @@
stockLogList1: this.temporaryList,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
this.carList.push(data)
}
if(this.carList.length == 0){
this.carList.push(data)
}else{
let aa = true;
for(let i = 0; i < this.carList.length; i++){
if(this.carList[i].productId == data.productId){
this.carList[i] = data
aa = false
}
}
if(aa){
this.carList.push(data)
}
}
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
}
this.temporaryList = []
this.purchasePrice = ''
this.zPrice = ''
@ -421,46 +467,57 @@
this.$refs.popup.close()
},
//删除整条商品
delShop(id) {
var that = this;
console.log(this.carList)
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].id == id) {
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.carList.splice(i, 1)
}
}
})
}
}
},
//删除商品下的某一个规格
delShopSpec(name) {
var that = this;
console.log(this.carList)
for (let i = 0; i < this.carList.length; i++) {
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
if (this.carList[i].stockLogList1[m].name == name) {
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.carList[i].stockLogList1.splice(m, 1)
if (that.carList[i].stockLogList1.length == 0) {
that.carList.splice(i, 1)
//删除整条商品
delShop(item) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == item.productId){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//删除商品下的某一个规格
delShopSpec(index,index1) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == index){
for(let m=0;m<that.carList[i].stockLogList1.length;m++){
if(that.carList[i].stockLogList1[m].attributeList == index1){
that.carList[i].num -= that.carList[i].stockLogList1[m].productCount
that.carNum -= that.carList[i].stockLogList1[m].productCount
that.carList[i].stockLogList1.splice(m, 1)
continue;
}
}
}
}
})
}
}
}
}
if(that.carList[i].stockLogList1.length == 0){
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//点击底部下单按钮
backPrevPage() {
@ -492,18 +549,18 @@
}
})
}).catch(err => {
console.log('表单错误信息:', err);
})
},
openPicker() {
console.log('执行打开地址选择器')
this.show = true
},
onhideShow() {
this.show = false
console.log('执行了关闭地址选择器')
},
//选中省市区
onsetCity(e) {
@ -517,7 +574,7 @@
area: data.area,
}
console.log(this.formData, this.addressObj);
},
//点击分类获取商品列表
getShareList(id) {

1
pages/index/downstream.vue

@ -48,7 +48,6 @@ export default {
}, false, true).then((res) => {
if(res.code == 200){
this.list = res.result
console.log(res)
}else{
this.tui.toast(res.message)
}

15
pages/index/index.vue

@ -140,7 +140,6 @@
settingShow: false,
chartData: {},
shopName:'',
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
// color: ["#1890FF", "#73C0DE"],
padding: [15, 10, 0, 15],
@ -208,7 +207,6 @@
}, false, false).then((res) => {
if(res.code == 200){
this.shopInfo = res.result
console.log(res)
}else{
this.tui.toast(res.message)
}
@ -217,9 +215,6 @@
},
goToInfo() {
this.settingShow = true
// uni.navigateTo({
// url: '/pages/info/index'
// })
},
gotoSearchData() {
uni.navigateTo({
@ -259,7 +254,7 @@
let dataList = {
categories: this.getWeek(),
series: [{
name: "周销售额",
name: "七天营收统计",
linearColor: [
[0,"#1890FF"],
[0.33,"#00B5FF"],
@ -278,10 +273,6 @@
})
},
getWeek() {
// var date = new Date();
// var day = date.getDay();
// var names = ["周日","周一","周二","周三","周四","周五","周六"];
// return names[day];
let days = 7
let week = ["周日","周一","周二","周三","周四","周五","周六"];
let dateList = Array.from({length:days},(v,i)=> i).map(day =>{
@ -320,12 +311,8 @@
top: var(--status-bar-height);
.contentPadding {
// margin: 24upx;
padding: 28upx 20upx;
// text-align: center;
background-color: #fff;
// border-radius: 14rpx;
// box-shadow: 0px 1px 10px 2px #e2e2e2;
color: #909399;
.title {

7
pages/index/order.vue

@ -43,7 +43,6 @@
};
},
onLoad(options) {
console.log('options', options);
this.type = options.type;
this.listStatus = options.listStatus
@ -59,15 +58,9 @@
},
methods: {
gotoDetail(id) {
// if(this.type =='order') {
uni.navigateTo({
url: '/pages/index/orderDetail?id=' + id
})
// } else {
// uni.navigateTo({
// url: '/pages/index/returnList?id=' + id
// })
// }
},
searchList() {
this.page = 1;

47
pages/index/orderDetail.vue

@ -4,19 +4,7 @@
<view class="uni-body" v-if="sales.province != null">{{sales.province + sales.area + sales.city + sales.receiveAddress}} </view>
</uni-card>
<view class="tui-order-item boxbg">
<!-- <u-collapse>
<u-collapse-item :open="isReturn" v-for="(item,index) in list" :key="index" :title="item.productName"
:name="item.saleId"
:value="'单价:'+ (item.wholesalePrice == null ?'暂无':item.wholesalePrice) + ' 折扣: ' + (item.discount == null ?'暂无':item.discount + '折')">
<view class="u-collapse-content" v-if="item.stockLogList1 != ''" v-for="(val, index2) in item.stockLogList1" :key="index2">
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}}
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0"
v-model="val.returnCount"></u-number-box>
</view>
</u-collapse-item>
</u-collapse> -->
<view class="tui-order-item boxbg">
<view class="content-box">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in list" :key="index">
<view class="shop-name" style="position: relative;">
@ -267,10 +255,8 @@
computed: {
returnAmount() {
if (this.changeAmount) {
console.log(this.changeAmount, 'this.changeAmount');
if (this.sales.noEarn >= this.changeAmount) {
this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2);
console.log(this.sales.newNoEarn);
return 0
} else {
this.sales.newNoEarn = 0
@ -282,9 +268,7 @@
if (this.isReturn) {
let sum = 0
this.list.forEach(item1 => {
console.log(item1);
item1.stockLogList1.forEach(v => {
console.log(v);
if (v.returnCount) {
sum = v.returnCount * item1.wholesalePrice + sum
}
@ -342,10 +326,6 @@
this.tui.toast(res.message)
}
}).catch((res) => {})
// this.tui.request("/app/return/get/" + option.id, "GET", null, false, false).then((res) => {
// if (res.code == 200 && res.result != null && res.result != undefined) {
// }
// }).catch((res) => {})
this.getReturnOrder(option.id)
this.collectionList(option.id)
}
@ -385,17 +365,7 @@
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:'+this.sales.shopName)
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702')
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059')
// strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字
// for (let item in this.list) {
// console.log(item, this.list,this.list[item] );
// strCmd += blesdk.addCPCLText('50', '', this.list[item].productName + ' ¥' + this.list[item].wholesalePrice + ' * ' + (this.sales.discount < 10 ? this.sales.discount : this.list[item].discount),'', '', '')
// this.list[item].saleDetailQueryDTO.forEach(val => {
// strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '')
// })
// }
// strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '')
// strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
@ -441,7 +411,6 @@
this.editNoPrice = true;
},
getNoPay(en) {
console.log(en, 'en');
if (en != undefined) {
if (0 < en && en <= this.sales.noEarn) {
this.sales.noEarn = this.sales.newEarn - en;
@ -467,7 +436,6 @@
if (res.code == 200 && res.result != null && res.result !=
undefined) {
this.shopList.push(...res.result.saleDetailDTOList);
console.log(this.shopList);
}
}).catch((res) => {})
})
@ -493,19 +461,13 @@
}
})
},
valChange() {
console.log(this.list);
},
open() {
this.popupShow = true
// console.log('open');
},
close() {
this.popupShow = false
// console.log('close');
},
sureReturn() {
console.log(this.list);
this.list.forEach(item1 => {
item1.stockLogList1.forEach(item2 => {
if (item2.returnCount) {
@ -518,10 +480,7 @@
})
let worderId = ''
if (this.orderByWorker) {
console.log(this.orderByWorker);
for (let key in this.orderByWorkerList) {
console.log(this.orderByWorker, this.orderByWorkerList[key].workerName, this.orderByWorker == this
.orderByWorkerList[key].workerName);
if (this.orderByWorker == this.orderByWorkerList[key].workerName) {
worderId = this.orderByWorkerList[key].workerId
}
@ -530,7 +489,6 @@
this.sales.noEarn = this.sales.newNoEarn;
this.sales.saleId = this.sales.id;
this.sales.totalAomount = this.returnAmount;
console.log(this.sales, this.list, this.orderByWorker);
this.tui.request("/app/return/rtg", "post", {
returnSale: this.sales,
returnSaleDetailList: this.list,
@ -571,7 +529,6 @@
status: 3
}, true, true).then((res1) => {
if (res1.code == 200) {
console.log(res1)
this.tui.toast("取消订单成功")
uni.navigateBack()
} else {

11
pages/index/peopleList.vue

@ -40,7 +40,7 @@
</view>
</view>
<view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content" v-for="item in popleList" :key="item">
<view class="popup-title">
<text>收费标准</text>
@ -77,8 +77,7 @@
},
onLoad(options) {
this.popleType = options.popleType
this.companyType = options.companyType || ''
console.log(options.companyType)
this.companyType = options.companyType || ''
// this.radioType = options.radioType
if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户
this.khOrGysList();
@ -151,8 +150,7 @@
})
},
//拨打电话
clickPhone(phone) {
console.log(phone);
clickPhone(phone) {
uni.makePhoneCall({
phoneNumber: phone
});
@ -182,9 +180,6 @@
this.type = type
this.$refs.popup.open(type)
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//关闭弹出层
close() {
this.$refs.popup.close()

14
pages/index/shareStyle.vue

@ -126,7 +126,7 @@
uni.hideHomeButton() //左上角HOME按钮
},
onLoad(options) {
console.log(options.khid)
if (options.khid != undefined) {
uni.redirectTo({
url: "/pages/index/downStearmList?khid=" + options.khid
@ -167,7 +167,7 @@
pageSize: '100'
}, false, false).then((res) => {
if (res.code == 200) {
console.log(res.result.records)
this.shopList.push(res.result.records)
this.goodsList = this.shopList[0]
} else {
@ -209,7 +209,7 @@
},
//选中商品
checkboxChange(item) {
console.log(item)
item.checked = !item.checked
if (this.carList.indexOf(item.id) != -1) {
this.carList.splice(this.carList.indexOf(item.id), 1)
@ -221,11 +221,11 @@
} else {
for (let i = 0; i < this.gwcList.length; i++) {
if (this.gwcList[i].id == item.id) {
console.log('这里')
this.gwcList.splice(i, 1)
} else {
if (this.gwcList.length == (i + 1)) {
console.log('是不是那里')
this.gwcList.push(item)
return
}
@ -234,7 +234,7 @@
}
}
console.log('gwcList', this.gwcList)
},
//点击分享按钮
clickShareBtn(e) {
@ -302,7 +302,7 @@
success: function(res) {
if (res.confirm) {
for (let i = 0; i < that.gwcList.length; i++) {
console.log('匹配吗?',that.goodsList)
if (that.gwcList[i].id == id) {
that.carList.splice(that.carList.indexOf(id), 1)
that.carType = that.carList.length

1
pages/index/shopInfo.vue

@ -52,7 +52,6 @@ export default {
}
},
onLoad(options) {
console.log(this.mobile)
this.addForm.mobile = this.mobile
},
methods:{

1
pages/index/uparrears.vue

@ -63,7 +63,6 @@
}, false, true).then((res) => {
if (res.code == 200) {
this.list = res.result
console.log(res)
} else {
this.tui.toast(res.message)
}

1
pages/index/upstream.vue

@ -51,7 +51,6 @@
}, false, true).then((res) => {
if (res.code == 200) {
this.list = res.result
console.log(res)
} else {
this.tui.toast(res.message)
}

2
pages/index/waitStorageDetail.vue

@ -249,8 +249,6 @@
changePrice(val) {
let that = this;
that.shouldPay = 0
console.log(that.goodsList)
console.log(this.index)
that.goodsList[that.index].purchasePrice = val
that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;
that.goodsList.forEach(function(value, key) {

133
pages/info/editStore.vue

@ -1,133 +0,0 @@
<template>
<view class="edit-store-page">
<view class="edit-form-wrapper">
<uni-forms :modelValue="editForm" ref="editForm" label-width="150">
<uni-forms-item label="店铺名称" required>
<uni-easyinput v-model="editForm.shopName" placeholder="请输入店铺名称" />
</uni-forms-item>
<uni-forms-item label="店铺员工" required>
<uni-data-checkbox v-model="editForm.clerks" :multiple="true" :localdata="hobbys" />
</uni-forms-item>
</uni-forms>
</view>
<view class="button-wrapper">
<u-button type="primary" @click="onAddButtonClick">添加员工</u-button>
</view>
<view class="button-wrapper">
<u-button type="success">保存</u-button>
</view>
<view>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog" class="popup-wrap">
<uni-card title="添加员工">
<uni-forms :modelValue="addForm" ref="addForm" label-width="160rpx" label-align="right">
<uni-forms-item label="员工姓名" required>
<uni-easyinput v-model="addForm.name" placeholder="请输入员工姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" required>
<uni-easyinput v-model="addForm.name" placeholder="请输入员工手机号" />
</uni-forms-item>
<uni-forms-item label="是否店长" required>
<uni-data-checkbox v-model="addForm.sex" :localdata="sexs" />
</uni-forms-item>
</uni-forms>
<view class="action-area">
<u-button type="info" plain>取消</u-button>
<u-button type="info" plain>保存</u-button>
</view>
</uni-card>
</uni-popup>
</view>
</view>
</template>
<script>
export default {
data() {
return {
editForm: {
shopName: '',
clerks: [],
},
addForm: {
},
hobbys: [{
text: '张三',
value: 0
}, {
text: '李四',
value: 1
}, {
text: '王五',
value: 2
}, {
text: '赵六',
value: 3
}, {
text: '田七',
value: 4
}, {
text: '钱八',
value: 5
}],
sexs: [{
text: '是',
value: 0
}, {
text: '不是',
value: 1
}, {
text: '其他',
value: 2
}],
customStyle: {
margin: '15px',
}
}
},
methods: {
// 选中某个复选框时,由checkbox时触发
checkboxChange(e) {
console.log(e);
},
// 选中任一checkbox时,由checkbox-group触发
checkboxGroupChange(e) {
console.log(e);
},
// 对话框
dialogInputConfirm(e) {
console.log(e)
},
onAddButtonClick() {
this.$refs.inputDialog.open()
}
}
}
</script>
<style scoped lang="scss">
.edit-store-page {
padding: 15rpx;
}
.edit-form-wrapper {
min-height: 800rpx;
}
.button-wrapper {
margin: 15rpx 0;
}
.popup-wrap {
background-color: #fff;
}
.action-area {
display: flex;
.action-area-button {
margin: 0 15rpx;
}
}
</style>

48
pages/info/index.vue

@ -1,48 +0,0 @@
<template>
<view>
<view class="container u-skeleton">
<view class="userinfo">
<block>
<!--u-skeleton-circle 绘制圆形-->
<u-avatar :src="src"></u-avatar>
<!--u-skeleton-fillet 绘制圆角矩形-->
<text class="u-skeleton-fillet">{{nickName || '超级管理员'}}</text>
</block>
</view>
<view style="margin: 20px 0">
<view v-for="(item,index) in lists" :key="index" class="lists">
<!--u-skeleton-rect 绘制矩形-->
<text class="u-skeleton-rect">{{item}}</text>
</view>
</view>
</view>
<!--引用组件-->
<u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
export default {
computed: mapState(['avatar', 'nickname', 'type']),
data() {
return {
loading: false, // 是否显示骨架屏组件 修改一下 提交
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
};
},
created() {
console.log(mapState, 'mapState', this.avatar)
},
onLoad() {
console.log(mapState, 'mapState', this.avatar)
}
}
</script>
<style lang="scss">
</style>

19
pages/info/info.vue

@ -1,19 +0,0 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

49
pages/inventory/addGoods.vue

@ -67,7 +67,8 @@
categoryList: [],
productId:'',
arrtList: [],
arrtChange: [],
arrtChange: [],
dataList:[],
rules: {
categoryId: {
rules: [{
@ -121,18 +122,19 @@
// })
},
onLoad(option) {
console.log(JSON.parse(option.dataList))
this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName
this.formData.price = this.dataList.price
this.formData.productSn = this.dataList.productSn
this.formData.wholesalePrice = this.dataList.wholesalePrice
this.formData.productPicture = this.dataList.productPicture
this.formData.productIntro = this.dataList.productIntro
this.formData.categoryId = this.dataList.categoryId
this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn
console.log('option',option)
if(option.dataList){
this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName
this.formData.price = this.dataList.price
this.formData.productSn = this.dataList.productSn
this.formData.wholesalePrice = this.dataList.wholesalePrice
this.formData.productPicture = this.dataList.productPicture
this.formData.productIntro = this.dataList.productIntro
this.formData.categoryId = this.dataList.categoryId
this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn
}
this.tui.request("/app/productCategory/list", "get", {
// shopId: 1,
}, false, true).then((res) => {
@ -155,12 +157,12 @@
},
// 新增图片
async afterRead(event) {
console.log(event);
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
if (this.formData.productPicture == undefined) this.formData.productPicture = [];
let fileListLen = this[`fileList${event.name}`].length
console.log(lists, 'lists');
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
@ -168,7 +170,7 @@
message: '上传中'
})
})
console.log(this.formData.productPicture);
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
@ -181,7 +183,7 @@
}
},
uploadFilePromise(url) {
console.log(url);
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'https://storage.xenjoyou.com/hiver/upload/file',
@ -193,7 +195,7 @@
},
formData: {},
success: (uploadFileRes) => {
console.log("这里", uploadFileRes)
let path = JSON.parse(uploadFileRes.data)
//后端返回的地址,存入图片地址
this.formData.productPicture = path.result
@ -206,18 +208,19 @@
},
// 触发提交表单
submit() {
let that = this;
let url = ''
this.$refs.form.validate().then(res => {
if(this.dataList.id !=''){
if(that.dataList !=''){
url = '/app/product/edit'
res.id = this.dataList.id
res.id = that.dataList.id
}else{
url = '/app/product/save'
}
this.tui.request(url, "post", res, false, false).then((res1) => {
that.tui.request(url, "post", res, false, false).then((res1) => {
if (res1.code == 200) {
uni.navigateBack({
delta: 2
delta: 2
})
} else {
uni.showToast({
@ -227,7 +230,7 @@
}
})
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}

284
pages/inventory/changeGoods1.vue

@ -62,7 +62,7 @@
<view class="popup-content">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="goodsDetail.productPicture" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
@ -114,32 +114,32 @@
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;">
<view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="item.productPicture" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view>
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{value[1].price}}</text>
<text style="margin-right:20rpx;">¥{{item.price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)">
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])">
<view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{values[0] | sliceMsg}}
{{item1.attributeList | sliceMsg}}
</view>
<uni-number-box max="100000" v-model="values[1]" @change="change" />
<uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view>
</view>
</view>
@ -149,7 +149,7 @@
<text>{{carType}} 款 {{carNum}} 件</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">选好了</view>
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view>
</view>
</view>
@ -184,9 +184,7 @@
zNum:0,
storageType:0,
carNum:0,
carType:0,
oldList: [],
newList: new Map()
carType:0
}
},
filters: {
@ -280,7 +278,7 @@
} else {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList
return
} else {
if (this.temporaryList.length == (i+1)) {
@ -329,16 +327,24 @@
//获取弹出层状态
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.carNum += this.carList[i].num
}
},
//弹出购物车或者商品规格选择弹窗
toggle(type, item) {
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
this.oldList = this.carList
this.newFun()
if (type == 'carPopup') {
this.carNum = 0
for (let i=0;i<this.carList.length;i++) {
this.carNum += this.carList[i].num
@ -350,110 +356,52 @@
this.$refs.popup.open('bottom')
}
},
newFun() {
//newList 已经是map格式了 新数组 初始为空
//carList 旧数组
for (let i = 0; i < this.carList.length; i++) {
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
}
}
}
},
//选择商品查询商品规格
checkGoods(item) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
if(item.id == this.carList[i].id){
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].saleDetailQueryDTO
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
} else {
this.tui.toast(res.message)
newArr.push({
name: val,
value: valueObj
})
}
}).catch((res) => {})
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}
@ -501,67 +449,97 @@
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
// if(this.storageType == 0 && this.purchasePrice == 0){
// uni.showToast({
// title: "请输入采购价!",
// icon: 'none'
// })
// }else{
let data = {
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO:this.temporaryList
}
let data = {
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO:this.temporaryList
}
if(this.carList.length == 0){
this.carList.push(data)
console.log(this.carList)
this.temporaryList = []
this.purchasePrice = ""
this.zPrice = ''
this.zNum = ''
for(let i=0;i<this.goodsDetail.attributeList.length;i++){
this.goodsDetail.attributeList[i].isChecked = false;
for (let m=0;m<this.goodsDetail.attributeList[i].value.length;m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false
}else{
let aa = true;
for(let i = 0; i < this.carList.length; i++){
if(this.carList[i].id == data.id){
this.carList[i] = data
aa = false
}
}
this.$refs.popup.close()
// }
if(aa){
this.carList.push(data)
}
}
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
}
}
this.temporaryList = []
this.purchasePrice = ""
this.zPrice = ''
this.zNum = ''
for(let i=0;i<this.goodsDetail.attributeList.length;i++){
this.goodsDetail.attributeList[i].isChecked = false;
for (let m=0;m<this.goodsDetail.attributeList[i].value.length;m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
this.$refs.popup.close()
console.log(this.carList)
},
//删除整条商品
delShop(id){
delShop(item){
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
if (that.newList.has(id) == true) {
that.newList.delete(id)
}
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].id == item.id){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//删除商品下的某一个规格
delShopSpec(name){
delShopSpec(index,index1){
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.newList.get(id).stockLogList.delete(name)
if (that.newList.get(id).stockLogList.size == 0) {
that.newList.delete(id)
for(let i=0;i<that.carList.length;i++){
for(let m=0;m<that.carList[i].saleDetailQueryDTO.length;m++){
if(that.carList[i].id == index){
if(that.carList[i].saleDetailQueryDTO[m].attributeList == index1){
that.carList[i].num -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carNum -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carList[i].saleDetailQueryDTO.splice(m, 1)
continue;
}
}
}
if(that.carList[i].saleDetailQueryDTO.length == 0){
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}

20
pages/inventory/gategoryLow.vue

@ -73,7 +73,7 @@
this.attrList = res1.result;
if (res1.result.length > 0) {
this.attrList.forEach((items) => {
console.log(items.id)
this.tui.request(
"/app/productAttributeValue/selectByAttributeId",
"get", {
@ -81,11 +81,11 @@
}, false, true).then((res2) => {
if (res2.code == 200) {
items.attributeValue = res2.result;
// console.log(items.attributeValue);
//
}else{
this.tui.toast(res.message)
}
console.log(this.attrList)
}).catch((res) => {})
})
}
@ -129,7 +129,7 @@
},
// 获取属性值
getProductAttributeValue(index) {
console.log(index, this.indexList, this.indexList[index].attrName);
this.attrList.forEach((item) => {
this.tui.request("/app/productAttributeValue/selectByAttributeId", "get", {
id: item.id
@ -143,7 +143,7 @@
}).catch((res) => {})
})
this.showList = JSON.parse(JSON.stringify(this.attrList))
console.log(this.showList, 'shoeList', index);
},
inputDialogToggle(type, item, parent) {
this.typeModel = type;
@ -172,7 +172,7 @@
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
@ -251,7 +251,7 @@
categoryId: this.editItem.categoryId,
id: this.editItem.id
}, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
@ -283,7 +283,7 @@
this.tui.request("/app/productCategory/delById", "post", {
id: this.delItems.id,
}, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
@ -303,7 +303,7 @@
attributeName: this.delItems.attributeName,
id: this.delItems.id,
}, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
@ -323,7 +323,7 @@
value: this.delItems.value,
id: this.delItems.id,
}, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) {
this.getGategoryList()
uni.showToast({

74
pages/inventory/goodsList1.vue

@ -61,9 +61,8 @@
<view style="width: 100rpx;">{{item.name}}</view>
</label>
</radio-group>
<view class="discount-num" v-if="discountType == '1'">
<uni-number-box :min="0.1" :max="10" :value="discountNum" :step="0.1"
@change="change" />
<view class="discount-num" v-if="discountType == '1'">
<input type="digit" style="width:150rpx;" v-model="discountNum" @blur="change($event)">
</view>
</view>
@ -96,7 +95,7 @@
</view>
<view class="collapse-1">
<text>折扣(0-10)</text>
<input class="input" type="number" :value='value[1].discount | maxNum'
<input class="input" type="digit" :value='value[1].discount | maxNum'
@blur="changeDis($event,value[0])">
</view>
<view class="collapse-1">
@ -105,7 +104,7 @@
</view>
<view class="collapse-1">
<text>数量</text>
<input class="input" type="number" :value='value[1].productCount'>
<input class="input" type="number" :value='value[1].productCount' disabled>
</view>
</view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
@ -235,7 +234,7 @@
<view class="bottom-box">
<view class="bottom-left">
<text>合计:{{totalAmount}}</text>
<text style="color: #ffa200;">¥{{shouldPay}}</text>
<text style="color: #ffa200;">¥{{shouldPay == null ?0:shouldPay}}</text>
</view>
<view class="bottom-right">
<button class="bottom-btn" @tap.stop="clearAll">清空商品</button>
@ -300,7 +299,7 @@
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-popup-bottom-left">
<text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text>
<!-- <text>¥{{zPrice}}</text> -->
</view>
<view class="shop-popup-bottom-right">
<view class="bottom-btn" @tap.stop="temporaryCheck">选好了</view>
@ -426,7 +425,8 @@
radioType1: 0,
saleId: '',
saleDetailList: [],
yNum: 150
yNum: 150,
clearMsg:''
}
},
components: {
@ -489,9 +489,6 @@
}
this.carList.set(this.carList1[i].id, obj)
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
} else { //当前页有数据
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
@ -536,12 +533,11 @@
}
this.carList.set(this.carList1[i].id, obj)
}
uni.removeStorageSync('carList1')
this.carList1 = []
}
}
}
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
this.carList.forEach(function(value, key) {
if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice
@ -627,7 +623,7 @@
if (this.goodsDetail.attributeList.length == jishuqi) {
this.attributeList = {
attributeList: JSON.stringify(obj),
productCount: this.temporaryNum,
productCount: 0,
name: name,
price: this.purchasePrice
}
@ -659,7 +655,7 @@
},
changessPrice(e) {
console.log(e.target.value)
this.relPrice = e.target.value
},
changePrice(e) {
@ -667,8 +663,8 @@
this.noPay = this.relPrice - e.target.value;
},
getImg(key) {
console.log(key)
console.log('图片看这里', this.carList.get(key))
return this.carList.get(key).productPicture
// value[1].productPicture
},
@ -682,12 +678,14 @@
}
},
//扫一扫功能
scanCodeAdd() {
scanCodeAdd() {
// this.clearMsg = '1'
uni.scanCode({
success: (res) => {
this.toggle('bottom', res.result);
},
fail: (res) => {
fail: (res) => {
// this.clearMsg = '1'
uni.showToast({
title: '扫描失败',
icon: 'none'
@ -748,12 +746,12 @@
}
}).catch((res) => {})
},
temporaryChange(val) {
temporaryChange(val) {
console.log('扫一扫',this.temporaryList)
this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
}
this.zPrice = this.zNum * this.purchasePrice
},
//折扣种类选择
discountChange(e) {
@ -787,9 +785,15 @@
this.pbAddress = e.detail.value
},
//整体折扣数字框改变
change(e) {
console.log(e)
this.discountNum = e
change(e) {
if(e.detail.value > 10){
this.discountNum = 10
}else if(e.detail.value < 0){
this.discountNum = 0
}else{
this.discountNum = e.detail.value
}
this.shouldPay = this.price * 10000 * e / 10 / 10000
},
//点击发货方式按钮
@ -817,7 +821,7 @@
return
}
let companyType = this.radioType == 1 ? this.wlName.id : ''
console.log(companyType)
uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
})
@ -1004,9 +1008,9 @@
}
let obj = {
orderByWorker: this.lbgName.workerId,
saleId: this.saleId,
sale: {
// relPrice:,
// relPrice:,
saleId: this.saleId,
alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款
@ -1032,7 +1036,7 @@
}
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
console.log(value.stockLogList)
value.stockLogList.forEach(function(values, keys) {
let obj = {
productCount: values,
@ -1040,7 +1044,7 @@
}
value.stockLogList1.push(obj)
})
console.log(value)
purchaseDetails.push(value)
})
this.saleDetailList = purchaseDetails;
@ -1148,7 +1152,7 @@
},
//编辑每一个的单价
clickPrice(index) {
console.log(index)
this.index = index
this.wholesalePrice = this.carList.get(this.index).wholesalePrice
this.lsprice = this.carList.get(this.index).lsprice
@ -1236,14 +1240,14 @@
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
console.log(this.carList)
let that = this;
this.carList.get(index).stockLogList.set(index1, e)
this.carList.get(index).productCount = 0
this.shouldPay = 0
this.totalAmount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) {
console.log(that.carList.get(index))
that.carList.get(index).productCount = that.carList.get(index).productCount + value
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index)
.unitPrice

2
pages/inventory/inventoryDetail.vue

@ -3,7 +3,7 @@
<view class="content-box">
<view class="right-box">
<view class="box-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="dataList.productPicture" alt="">
</view>
<view class="box-right">
<view class="box-right-name">{{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})</view>

Loading…
Cancel
Save