Browse Source

新增了客户分类及修改了一些bug

master
wangfukang 2 years ago
parent
commit
5965fbec9f
  1. 48
      package1/AI/AIHangOrderList.vue
  2. 89
      package1/AI/AiChangeGoods.vue
  3. 2525
      package1/AI/voiceInventory.vue
  4. 52
      package1/index/order.vue
  5. 14
      package1/index/orderDetail.vue
  6. 2
      package1/index/peopleList.vue
  7. 82
      package1/inventory/addGoods.vue
  8. 95
      package1/inventory/inventoryConfirm.vue
  9. 87
      package1/stock/addStock.vue

48
package1/AI/AIHangOrderList.vue

@ -909,7 +909,26 @@
} }
} }
return name; return name;
}, },
//把unitPrice变成折前价,用于去开单的时候切换折扣
getUnitPrice(item,items){
if(item.discount != 10){
if(item.discount == null || item.discount == 0 || item.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (item.discount * 100) / 10).toFixed(2)
}
}else if(items.discount!= 10){
if(items.discount == null || items.discount == 0 || items.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (items.discount * 100) / 10).toFixed(2)
}
}else{
return items.discountAmount || items.wholesalePrice
}
},
//带参数跳转到开单页 //带参数跳转到开单页
goSaleGoods(item) { goSaleGoods(item) {
let dataList = [] let dataList = []
@ -919,10 +938,10 @@
this.returnList.forEach(function(value, key) { this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value) item.saleDetailDTOList.push(value)
}) })
item.discount = item.discount==null?10:item.discount
if (item.saleDetailDTOList.length>0) { if (item.saleDetailDTOList.length>0) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) { for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {} let obj = {}
let attrMap = new Map() let attrMap = new Map()
let newSaleDetailDTOList = [] let newSaleDetailDTOList = []
@ -944,14 +963,16 @@
} }
obj.attrId = item.saleDetailDTOList[i].attrId obj.attrId = item.saleDetailDTOList[i].attrId
obj.saleDetailQueryDTO = newSaleDetailDTOList obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0 obj.num = 0
obj.buyCount = item.saleDetailDTOList[i].buyCount
obj.customerCategoryRule = item.saleDetailDTOList[i].customerCategoryRule != null ?JSON.parse(item.saleDetailDTOList[i].customerCategoryRule):null
obj.discount = item.saleDetailDTOList[i].discount
obj.id = item.saleDetailDTOList[i].productId obj.id = item.saleDetailDTOList[i].productId
obj.price = item.saleDetailDTOList[i].price obj.price = item.saleDetailDTOList[i].price
obj.lsprice = item.saleDetailDTOList[i].price obj.lsprice = item.saleDetailDTOList[i].price
obj.categoryId = item.saleDetailDTOList[i].categoryId obj.categoryId = item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i] obj.unitPrice = this.getUnitPrice(item,item.saleDetailDTOList[i])
.wholesalePrice
obj.discountAmount = item.saleDetailDTOList[i].discountAmount obj.discountAmount = item.saleDetailDTOList[i].discountAmount
obj.productName = item.saleDetailDTOList[i].productName obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime() obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
@ -975,18 +996,17 @@
dataList.push(obj) dataList.push(obj)
} }
setTimeout(res11=>{ setTimeout(res11=>{
this.tui.request("/app/customer/list", "post", { this.tui.request("/app/debt/selectByUserId", "post", {
notBuyDays: "", shopId:uni.getStorageSync('shopId'),
pageNum: 1, userId:item.userId
pageSize: 10, }, false, true).then((res) => {
searchStr: item.userName,
sort: "",
}, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.returnList = new Map() this.returnList = new Map()
console.log('dataList',dataList) console.log('dataList',dataList)
uni.setStorageSync('khName', JSON.stringify(res.result.records[0])) res.result.name = res.result.userName
uni.setStorageSync('khName', JSON.stringify(res.result))
uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('discountAll', item.discount != null ?item.discount:10)
uni.setStorageSync('hangOrder', true) uni.setStorageSync('hangOrder', true)
uni.switchTab({ uni.switchTab({
url: '/pages/inventory/goodsList1' url: '/pages/inventory/goodsList1'

89
package1/AI/AiChangeGoods.vue

@ -45,9 +45,12 @@
<text>{{item.price}}</text> <text>{{item.price}}</text>
<text>零售价</text> <text>零售价</text>
</view> </view>
<view class="price-box"> <view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
<text>{{item.stockCount}}</text> <text>{{item.stockCount + item.minusStockCount}}</text>
<text>库存</text> <view>
库存
<uni-icons type="help" size="15"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -61,7 +64,7 @@
<view class="noPic" v-else>暂无图片</view> <view class="noPic" v-else>暂无图片</view>
</view> </view>
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{item.productName}}</view> <view class="box-right-name">{{item.productName == null ?'':item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view> <view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price"> <view class="box-right-price">
<view class="price-box"> <view class="price-box">
@ -76,15 +79,52 @@
<text>{{item.price}}</text> <text>{{item.price}}</text>
<text>零售价</text> <text>零售价</text>
</view> </view>
<view class="price-box"> <view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
<text>{{item.stockCount}}</text> <text>{{item.stockCount + item.minusStockCount}}</text>
<text>库存</text> <view>
库存
<uni-icons type="help" size="15"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 显示正负库存弹窗 -->
<uni-popup ref="showPopup" background-color="#fff">
<view class="popup-pay-content" style="width: 550rpx;">
<view class="popup-pay-title">
<text>库存数</text>
</view>
<view style="width: 100%;height: 150rpx;">
<view
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 20rpx;">
<text style="font-weight: bold;">
正数库存
</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
{{zheng}}
</text>
</view>
<view
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 40rpx;">
<text style="font-weight: bold;">
负数库存
</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
{{fu}}
</text>
</view>
</view>
<view class="popup-pay-container" style="display: flex;margin-top: 50rpx;background: #89CFF0;">
<view @tap='$refs.showPopup.close()'
style="flex:1;text-align: center;border-right: 1px solid #eee;background: #088FEB;font-size:32rpx;">
确认
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -95,7 +135,9 @@
return { return {
indexList: [], indexList: [],
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
zheng:'',
fu:'',
shopList1: [], shopList1: [],
categoryId: '', //分类id categoryId: '', //分类id
searchName: '', //搜索框输入值 searchName: '', //搜索框输入值
@ -110,6 +152,11 @@
this.getGategoryList() this.getGategoryList()
}, },
methods: { methods: {
seeStockCount(zheng,fu){
this.zheng = zheng;
this.fu = fu;
this.$refs.showPopup.open()
},
//初始化获取分类列表 //初始化获取分类列表
getGategoryList() { getGategoryList() {
this.tui.request("/app/productCategory/list", "get", { this.tui.request("/app/productCategory/list", "get", {
@ -382,4 +429,30 @@
color: #777; color: #777;
background: #eee; background: #eee;
} }
.popup-pay-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-pay-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
</style> </style>

2525
package1/AI/voiceInventory.vue

File diff suppressed because it is too large

52
package1/index/order.vue

@ -37,7 +37,7 @@
<checkbox-group @change="checkboxChange"> <checkbox-group @change="checkboxChange">
<label class="uni-list-cell uni-list-cell-pd" > <label class="uni-list-cell uni-list-cell-pd" >
<checkbox v-if="btnStatus==false" :value="item" style="float: left;width: 60rpx;line-height: 300rpx;margin: 0 20rpx;" /> <checkbox v-if="btnStatus==false" :value="item" style="float: left;width: 60rpx;line-height: 300rpx;margin: 0 20rpx;" />
<view :style="{width:btnStatus==false?'95%':'100%'}" @tap="gotoDetail(item.id)"> <view :style="{width:btnStatus==false?'95%':'100%'}" @tap="gotoDetail(item.id,item.userId)">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)"> <uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)">
<view class="uni-body" style="font-weight: bold;font-size: 30rpx;"> <view class="uni-body" style="font-weight: bold;font-size: 30rpx;">
<text class="cardText" style="font-size: 30rpx;">单号:</text> <text class="cardText" style="font-size: 30rpx;">单号:</text>
@ -59,7 +59,7 @@
<view class="uni-body"> <text class="cardText"> <view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}} 订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view> </view>
<view class="floatRight" v-if="item.status == 6" @tap.stop="goSaleGoods(item)">去开单</view> <view class="floatRight" v-if="item.status == 6" @tap.stop="goSaleGoods(item,'')">去开单</view>
<view class="floatRight" v-if="item.status == 4" @tap.stop="cancelOrder(item,'',index)">撤销</view> <view class="floatRight" v-if="item.status == 4" @tap.stop="cancelOrder(item,'',index)">撤销</view>
<view class="floatRight" v-if="item.status == 4" @tap.stop="cancelOrder(item,'goPay')">撤销并复制</view> <view class="floatRight" v-if="item.status == 4" @tap.stop="cancelOrder(item,'goPay')">撤销并复制</view>
<view class="floatRight" v-if="item.status == 2" @tap.stop="goSaleGoods(item)">重新开单</view> <view class="floatRight" v-if="item.status == 2" @tap.stop="goSaleGoods(item)">重新开单</view>
@ -124,11 +124,11 @@
}, },
methods: { methods: {
gotoDetail(id) { gotoDetail(id,userId) {
// this.page = 1 // this.page = 1
uni.setStorageSync('noReload',true) uni.setStorageSync('noReload',true)
uni.navigateTo({ uni.navigateTo({
url: '/package1/index/orderDetail?id=' + id url: '/package1/index/orderDetail?id=' + id +'&userId='+userId
}) })
}, },
searchList(res) { searchList(res) {
@ -252,7 +252,7 @@
}, true, true).then((res1) => { }, true, true).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
if (type == 'goPay') { if (type == 'goPay') {
that.goSaleGoods(item) that.goSaleGoods(item,'cancel')
} else { } else {
that.inventoryList[index].status = 2 that.inventoryList[index].status = 2
that.$forceUpdate() that.$forceUpdate()
@ -263,15 +263,33 @@
} }
}).catch((res1) => {}) }).catch((res1) => {})
}, },
getUnitPrice(item,items){
if(item.discount != 10){
if(item.discount == null || item.discount == 0 || item.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (item.discount * 100) / 10).toFixed(2)
}
}else if(items.discount!= 10){
if(items.discount == null || items.discount == 0 || items.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (items.discount * 100) / 10).toFixed(2)
}
}else{
return items.discountAmount || items.wholesalePrice
}
},
//带参数跳转到开单页 //带参数跳转到开单页
goSaleGoods(item) { goSaleGoods(item,type) {
let dataList = [] let dataList = []
if(!item.saleDetailDTOList){ if(!item.saleDetailDTOList){
item.saleDetailDTOList = [] item.saleDetailDTOList = []
} }
this.returnList.forEach(function(value, key) { this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value) item.saleDetailDTOList.push(value)
}) })
item.discount = item.discount==null?10:item.discount
if (item.saleDetailDTOList) { if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) { for (let i = 0; i < item.saleDetailDTOList.length; i++) {
@ -295,14 +313,16 @@
} }
obj.saleDetailQueryDTO = newSaleDetailDTOList obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0 obj.num = 0
obj.customerCategoryRule = item.saleDetailDTOList[i].customerCategoryRule != null ?JSON.parse(item.saleDetailDTOList[i].customerCategoryRule):null
obj.id = item.saleDetailDTOList[i].productId obj.id = item.saleDetailDTOList[i].productId
obj.price = item.saleDetailDTOList[i].price obj.price = item.saleDetailDTOList[i].price
obj.buyCount = item.saleDetailDTOList[i].buyCount
obj.lsprice = item.saleDetailDTOList[i].price obj.lsprice = item.saleDetailDTOList[i].price
obj.categoryId = item.saleDetailDTOList[i].categoryId obj.categoryId = item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i] obj.attrId = item.saleDetailDTOList[i].attrId
.wholesalePrice obj.discountAmount = item.saleDetailDTOList[i].discountAmount
obj.productName = item.saleDetailDTOList[i].productName obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime() obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn obj.productSn = item.saleDetailDTOList[i].productSn
@ -311,7 +331,12 @@
obj.saleId = item.id obj.saleId = item.id
obj.remark = item.remark obj.remark = item.remark
obj.xsyId = item.createBy obj.xsyId = item.createBy
obj.createByName = item.createByName obj.createByName = item.createByName
if(type == 'cancel'){
obj.unitPrice = this.getUnitPrice(item,item.saleDetailDTOList[i])
}else{
obj.unitPrice = item.saleDetailDTOList[i].discountAmount
}
dataList.push(obj) dataList.push(obj)
} }
} else { } else {
@ -336,6 +361,9 @@
res.result.id = item.userId res.result.id = item.userId
uni.setStorageSync('khName', JSON.stringify(res.result)) uni.setStorageSync('khName', JSON.stringify(res.result))
uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('carList1', JSON.stringify(dataList))
if(type == 'cancel'){
uni.setStorageSync('discountAll', item.discount != null ?item.discount:10)
}
uni.setStorageSync('hangOrder', true) uni.setStorageSync('hangOrder', true)
uni.switchTab({ uni.switchTab({
url: '/pages/inventory/goodsList1' url: '/pages/inventory/goodsList1'

14
package1/index/orderDetail.vue

@ -350,6 +350,10 @@
<view class="tui-item-title">店铺电话:</view> <view class="tui-item-title">店铺电话:</view>
<view class="tui-item-content">{{ shopOwnerPhone }}</view> <view class="tui-item-content">{{ shopOwnerPhone }}</view>
</view> </view>
<view class="tui-order-flex">
<view class="tui-item-title">店铺备注:</view>
<view class="tui-item-content">{{ shopRemark1 }}</view>
</view>
</view> </view>
</view> </view>
<!-- 小静家的临时二维码 --> <!-- 小静家的临时二维码 -->
@ -490,6 +494,7 @@
popupShow: false, popupShow: false,
shopAddress: uni.getStorageSync('shopAddress'), shopAddress: uni.getStorageSync('shopAddress'),
shopOwnerPhone: uni.getStorageSync('shopOwnerPhone'), shopOwnerPhone: uni.getStorageSync('shopOwnerPhone'),
shopRemark1:uni.getStorageSync('shopRemark'),
sales: {}, sales: {},
dealingsRecord: {}, dealingsRecord: {},
order: {}, order: {},
@ -524,6 +529,7 @@
qrArr: [], qrArr: [],
isShare: false, isShare: false,
isDownKH: false, isDownKH: false,
userId:'',
addressArr: [], addressArr: [],
jinjuPhone: '', //金桔家单独改成这个电话 jinjuPhone: '', //金桔家单独改成这个电话
modal_qr: false, modal_qr: false,
@ -602,10 +608,12 @@
} }
this.saleId = option.id this.saleId = option.id
this.userId = option.userId
this.isShare = option.shopId ? true : false this.isShare = option.shopId ? true : false
if (option.id != null && option.id != undefined && option.id != "") { if (option.id != null && option.id != undefined && option.id != "") {
if (option.type == 'gys') { if (option.type == 'gys') {
this.type = option.type; this.type = option.type;
console.log("222")
this.tui.request("/app/purchase/getPurchaseAllData", "post", { this.tui.request("/app/purchase/getPurchaseAllData", "post", {
id: option.id id: option.id
}, false, true).then((res) => { }, false, true).then((res) => {
@ -619,7 +627,10 @@
} }
}).catch((res) => {}) }).catch((res) => {})
} else { } else {
this.tui.request("/app/sale/get/" + option.id, "GET", null, false, false).then((res) => { console.log("333")
this.tui.request("/app/sale/get/" + option.id, "GET", {
customerId:this.userId
}, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) { if (res.code == 200 && res.result != null && res.result != undefined) {
this.sales = res.result.sale this.sales = res.result.sale
if (res.result.dealingsRecord != null) { if (res.result.dealingsRecord != null) {
@ -750,6 +761,7 @@
}, },
//打印小票二维码,分割二维码字符串 //打印小票二维码,分割二维码字符串
analysisQrCode() { analysisQrCode() {
console.log("1111")
let that = this; let that = this;
that.tui.request("/app/shop/getShopInfoById", "post", { that.tui.request("/app/shop/getShopInfoById", "post", {
id: this.shopId, id: this.shopId,

2
package1/index/peopleList.vue

@ -113,7 +113,7 @@
<view v-if="item.name != '散客' && item.consigneeName !='默认供应商'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="bottom: 86rpx;"> <view v-if="item.name != '散客' && item.consigneeName !='默认供应商'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="bottom: 86rpx;">
编辑 编辑
</view> </view>
<view class="name-edit" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16rpx"> <view class="name-edit" v-if="userType==0" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16rpx">
查看明细 查看明细
</view> </view>
</view> </view>

82
package1/inventory/addGoods.vue

@ -39,10 +39,10 @@
</view> </view>
</view> </view>
</uni-forms-item> </uni-forms-item>
<!-- <uni-forms-item label="客户价格" name="categoryId" v-if="customerCategoryList != null"> <uni-forms-item label="客户价格" name="categoryId">
<view class="content-list"> <view class="content-list">
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="根据客户分类自定义价格" disabled :value="formData.userCategoryName" <input type="text" placeholder="根据客户分类自定义价格" disabled
style="border-bottom: 1px solid #fff;text-align: center;" @tap="addCustomPrice"> style="border-bottom: 1px solid #fff;text-align: center;" @tap="addCustomPrice">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons>
@ -56,7 +56,7 @@
{{item.categoryName}}:{{item.categoryPrice}} {{item.categoryName}}:{{item.categoryPrice}}
</view> </view>
</view> </view>
</view> --> </view>
<uni-forms-item label="添加规格" name="categoryId"> <uni-forms-item label="添加规格" name="categoryId">
<view class="content-list"> <view class="content-list">
<view class="list-val"> <view class="list-val">
@ -435,7 +435,7 @@
typeItem: {}, typeItem: {},
arrtChange: [], arrtChange: [],
categoryId: '', categoryId: '',
dataList: [], dataList: {},
zPrice: 0, zPrice: 0,
type: 'add', type: 'add',
customerCategoryList:[], customerCategoryList:[],
@ -513,8 +513,10 @@
if (this.typeItem) { if (this.typeItem) {
this.formData.categoryId = this.typeItem.id this.formData.categoryId = this.typeItem.id
} }
}, },
onLoad(option) { onLoad(option) {
this.getCustomerCategoryList()
if (option.dataList) { if (option.dataList) {
this.dataList = JSON.parse(option.dataList) this.dataList = JSON.parse(option.dataList)
this.tui.request("/app/product/getById/" + this.dataList.id, "POST", { this.tui.request("/app/product/getById/" + this.dataList.id, "POST", {
@ -522,13 +524,15 @@
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.type = 'edit' this.type = 'edit'
this.customerCategoryList = JSON.parse(res.result.customerCategoryRule) this.customerCategoryList = this.checkPriceRule((res.result.customerCategoryRule != '' && res.result.customerCategoryRule != null)? JSON.parse(res.result.customerCategoryRule): null)
console.log('customerCategoryList',this.customerCategoryList) console.log('customerCategoryList',this.customerCategoryList)
this.formData.attrId = res.result.attrId this.formData.attrId = res.result.attrId
this.formData.productName = res.result.productName this.formData.productName = res.result.productName
this.formData.barcode = res.result.barcode this.formData.barcode = res.result.barcode
this.formData.price = res.result.price this.formData.price = res.result.price
this.formData.productSn = res.result.productSn this.formData.productSn = res.result.productSn
this.formData.stockCount = this.dataList.stockCount
this.formData.minusStockCount = this.dataList.minusStockCount
this.formData.purchasePrice = res.result.purchasePrice this.formData.purchasePrice = res.result.purchasePrice
this.oldPurchasePrice = res.result.purchasePrice this.oldPurchasePrice = res.result.purchasePrice
this.formData.wholesalePrice = res.result.wholesalePrice this.formData.wholesalePrice = res.result.wholesalePrice
@ -543,8 +547,6 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
}else{
this.getCustomerCategoryList()
} }
this.userType = uni.getStorageSync('type') this.userType = uni.getStorageSync('type')
@ -752,7 +754,14 @@
} }
}, },
addCustomPrice(){ addCustomPrice(){
this.$refs.customPopup.open() if(this.customerCategoryList == null){
uni.navigateTo({
url: '/package1/index/customClassList'
})
}else{
this.$refs.customPopup.open()
}
}, },
generateSn(value) { generateSn(value) {
this.tui.request("/app/productSn/getNewProductSn", "POST", { this.tui.request("/app/productSn/getNewProductSn", "POST", {
@ -782,6 +791,31 @@
this.$refs.customPopup.close() this.$refs.customPopup.close()
this.$forceUpdate() this.$forceUpdate()
}, },
checkPriceRule(ruleArr){
if(ruleArr != null && ruleArr != ''){
if(this.customerCategoryList != '' && this.customerCategoryList != null){
let categorySon = []
for(let i=0;i<this.customerCategoryList.length;i++){
let isHae = false
for(let j=0;j<ruleArr.length;j++){
if(this.customerCategoryList[i].categoryId == ruleArr[j].categoryId){
isHae = true
}
}
if(isHae == false){
ruleArr.push(this.customerCategoryList[i])
}
}
}else{
ruleArr = this.customerCategoryList
}
}else{
ruleArr = this.customerCategoryList
}
return ruleArr
},
async startGetSn() { async startGetSn() {
var that = this; var that = this;
if (this.prefixRule == '') { if (this.prefixRule == '') {
@ -942,7 +976,7 @@
} else { } else {
this.formData.purchasePrice = e.target.value this.formData.purchasePrice = e.target.value
console.log('改变', this.formData) console.log('改变', this.formData)
if (this.dataList == '') { if (this.dataList.id) {
uni.hideLoading() uni.hideLoading()
return return
} }
@ -1015,20 +1049,22 @@
}, },
//货号是否重复 //货号是否重复
getSnIsRepeat() { getSnIsRepeat() {
this.tui.request('/app/product/getByProductSn', "post", { if(this.formData.productSn != '' && this.dataList.productSn != this.formData.productSn){
productSn: this.formData.productSn this.tui.request('/app/product/getByProductSn', "post", {
}, false, true).then((res1) => { productSn: this.formData.productSn
if (res1.code == 200) { }, false, true).then((res1) => {
if (res1.result != '') { if (res1.code == 200) {
this.tui.toast('当前货号已被商品:“' + res1.result[0].productName + '”占用,请重新输入') if (res1.result != '') {
this.formData.productSn = '' this.tui.toast('当前货号已被商品:“' + res1.result[0].productName + '”占用,请重新输入')
this.formData.productSn = ''
}
} }
})
} }
})
}, },
ejectRuleSelect() { ejectRuleSelect() {
if (this.dataList != '') { if (this.dataList.id) {
//颜色 //颜色
for (let m = 0; m < this.multipleList[0].productAttributeValueVoList.length; m++) { for (let m = 0; m < this.multipleList[0].productAttributeValueVoList.length; m++) {
let isTrue = true let isTrue = true
@ -1064,7 +1100,7 @@
} }
this.$nextTick(() => { this.$nextTick(() => {
this.oldMultipleList = this.multipleList this.oldMultipleList = this.multipleList
if (this.dataList == '') { if (this.dataList.id) {
this.multipleList = [] this.multipleList = []
} }
this.$refs.addTypeDialog.open('bottom') this.$refs.addTypeDialog.open('bottom')
@ -1075,7 +1111,7 @@
let that = this; let that = this;
let url = '' let url = ''
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if (that.dataList != '') { if (that.dataList.id) {
url = '/app/product/edit' url = '/app/product/edit'
this.formData.id = that.dataList.id this.formData.id = that.dataList.id
this.formData.stockCount = that.dataList.stockCount this.formData.stockCount = that.dataList.stockCount
@ -1112,7 +1148,7 @@
console.log('purchasePrice', this.formData) console.log('purchasePrice', this.formData)
that.tui.request(url, "post", this.formData, false, false).then((res1) => { that.tui.request(url, "post", this.formData, false, false).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
if (that.dataList != '') { //编辑商品 if (that.dataList.id) { //编辑商品
let pages = getCurrentPages(); let pages = getCurrentPages();
let prevPage = pages[pages.length - 3]; let prevPage = pages[pages.length - 3];
let shopList = prevPage.$vm.shopList let shopList = prevPage.$vm.shopList

95
package1/inventory/inventoryConfirm.vue

@ -126,6 +126,7 @@
purchaseDetails:'', purchaseDetails:'',
aiinventory:0, //1是AI入库 0是普通入库 2采购退货 aiinventory:0, //1是AI入库 0是普通入库 2采购退货
userType:1, userType:1,
claerSubmitBtn:0,
leijiqiankuan:0, leijiqiankuan:0,
zhiqianqiankuan:0, zhiqianqiankuan:0,
yuedikou:0 yuedikou:0
@ -178,52 +179,58 @@
this.leijiqiankuan = option.leijiqiankuan this.leijiqiankuan = option.leijiqiankuan
}, },
methods: { methods: {
inventorySubmit() { inventorySubmit() {
let url; this.claerSubmitBtn += 1
uni.showLoading({ if(this.claerSubmitBtn == 1){
title: '加载中...' let url;
}) uni.showLoading({
if(this.aiinventory == 1){ title: '加载中...'
url = '/app/stock/putInPriceOfAi' })
for(let i=0;i<this.purchaseDetails.length;i++){ if(this.aiinventory == 1){
delete this.purchaseDetails[i].id; url = '/app/stock/putInPriceOfAi'
} for(let i=0;i<this.purchaseDetails.length;i++){
}else if(this.aiinventory == 0){ delete this.purchaseDetails[i].id;
url = '/app/stock/putInOfProduct' }
}else{ }else if(this.aiinventory == 0){
url = '/app/stock/putOutPrice' url = '/app/stock/putInOfProduct'
for(let i=0;i<this.purchaseDetails.length;i++){ }else{
delete this.purchaseDetails[i].id; url = '/app/stock/putOutPrice'
for(let i=0;i<this.purchaseDetails.length;i++){
delete this.purchaseDetails[i].id;
}
} }
this.$nextTick(()=>{
this.purchase.balanceDeductionAmount = this.yuedikou
this.tui.request(url, "post", {
purchase: this.purchase,
purchaseDetails: this.purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "成功",
icon: 'none'
})
setTimeout(res => {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
} else {
uni.showToast({
title: "失败",
icon: 'none'
})
}
})
})
setTimeout(res => {
uni.hideLoading();
}, 2000)
}else{
this.tui.toast("请勿重复提交!")
} }
this.$nextTick(()=>{
this.purchase.balanceDeductionAmount = this.yuedikou
this.tui.request(url, "post", {
purchase: this.purchase,
purchaseDetails: this.purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "成功",
icon: 'none'
})
setTimeout(res => {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
} else {
uni.showToast({
title: "失败",
icon: 'none'
})
}
})
})
setTimeout(res => {
uni.hideLoading();
}, 2000)
}, },
batchPrint(){ batchPrint(){
uni.navigateTo({ uni.navigateTo({

87
package1/stock/addStock.vue

@ -40,9 +40,12 @@
<text>{{item.price}}</text> <text>{{item.price}}</text>
<text>零售价</text> <text>零售价</text>
</view> </view>
<view class="price-box"> <view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
<text>{{item.stockCount}}</text> <text>{{item.stockCount + item.minusStockCount}}</text>
<text>库存</text> <view>
库存
<uni-icons type="help" size="15"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -74,9 +77,12 @@
<text>{{item.price}}</text> <text>{{item.price}}</text>
<text>零售价</text> <text>零售价</text>
</view> </view>
<view class="price-box"> <view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
<text>{{item.stockCount}}</text> <text>{{item.stockCount + item.minusStockCount}}</text>
<text>库存</text> <view>
库存
<uni-icons type="help" size="15"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -142,6 +148,40 @@
<u-loadmore :status="status" /> <u-loadmore :status="status" />
</view> </view>
</uni-popup> </uni-popup>
<!-- 显示正负库存弹窗 -->
<uni-popup ref="showPopup" background-color="#fff">
<view class="popup-pay-content" style="width: 550rpx;">
<view class="popup-pay-title">
<text>库存数</text>
</view>
<view style="width: 100%;height: 150rpx;">
<view
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 20rpx;">
<text style="font-weight: bold;">
正数库存
</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
{{zheng}}
</text>
</view>
<view
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 40rpx;">
<text style="font-weight: bold;">
负数库存
</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
{{fu}}
</text>
</view>
</view>
<view class="popup-pay-container" style="display: flex;margin-top: 50rpx;background: #89CFF0;">
<view @tap='$refs.showPopup.close()'
style="flex:1;text-align: center;border-right: 1px solid #eee;background: #088FEB;font-size:32rpx;">
确认
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -155,7 +195,9 @@
status: 'loadmore', status: 'loadmore',
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
shopList1: [], shopList1: [],
zheng:'',
fu:'',
pages: 1, pages: 1,
totalPages: 0, totalPages: 0,
info: 0, info: 0,
@ -246,6 +288,11 @@
this.storageType = uni.getStorageSync('type') this.storageType = uni.getStorageSync('type')
}, },
methods: { methods: {
seeStockCount(zheng,fu){
this.zheng = zheng;
this.fu = fu;
this.$refs.showPopup.open()
},
//初始化获取分类列表 //初始化获取分类列表
getGategoryList() { getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => { this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => {
@ -743,4 +790,30 @@
width: 90%; width: 90%;
// margin-top: 20upx; // margin-top: 20upx;
} }
.popup-pay-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-pay-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
</style> </style>
Loading…
Cancel
Save