wangfukang 2 years ago
parent
commit
7970739db1
  1. 7
      package1/AI/AIHangOrderList.vue
  2. 34
      package1/index/order.vue
  3. 106
      package1/index/orderDetail.vue
  4. 83
      package1/inventory/addGoods.vue
  5. 7
      package1/inventory/inventoryConfirm.vue

7
package1/AI/AIHangOrderList.vue

@ -949,12 +949,13 @@
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 = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i]
.wholesalePrice .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
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id obj.saleId = item.id
obj.remark = item.remark obj.remark = item.remark
obj.xsyId = item.createBy obj.xsyId = item.createBy

34
package1/index/order.vue

@ -324,23 +324,23 @@
obj.createByName = item.createByName obj.createByName = item.createByName
dataList.push(obj) dataList.push(obj)
} }
this.$nextTick(()=>{ this.$nextTick(()=>{
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, if (res.code == 200) {
sort: "", this.returnList = new Map()
}, false, false).then((res) => { res.result.noEarn = res.result.amountOwed
if (res.code == 200) { res.result.name = res.result.userName
this.returnList = new Map() res.result.id = item.userId
uni.setStorageSync('khName', JSON.stringify(res.result.records[0])) uni.setStorageSync('khName', JSON.stringify(res.result))
uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('hangOrder', true) uni.setStorageSync('hangOrder', true)
uni.switchTab({ uni.switchTab({
url: '/pages/inventory/goodsList1' url: '/pages/inventory/goodsList1'
}) })
} }
}) })
}) })
}, },

106
package1/index/orderDetail.vue

@ -97,6 +97,20 @@
<view class="tui-price-large">{{ sales.totalAmount == null ?'暂无':sales.totalAmount }}</view> <view class="tui-price-large">{{ sales.totalAmount == null ?'暂无':sales.totalAmount }}</view>
</view> </view>
</view> </view>
<view v-if="Math.abs(returnNum) > 0" class="tui-price-flex tui-size32 tui-pbtm20" style="font-weight:bold;">
<view class="tui-flex-shrink">退货数量</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ returnNum == null ?'暂无':returnNum }}</view>
</view>
</view>
<view v-if="Math.abs(returnNum) > 0" class="tui-price-flex tui-size32 tui-pbtm20" style="font-weight:bold;">
<view class="tui-flex-shrink">退货金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ returnPrice == null ?'暂无':returnPrice }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="userType == 0 && isDownKH == false"> <view class="tui-price-flex tui-size32" v-if="userType == 0 && isDownKH == false">
<view class="tui-flex-shrink">总成本</view> <view class="tui-flex-shrink">总成本</view>
@ -933,14 +947,24 @@
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
} }
} else { } else {
if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
.newData[i].productSn) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
.newData[i].productSn)
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn)
}
} else { } else {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
'(' + (that.newData[i] .newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} }
} }
@ -985,14 +1009,24 @@
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
} }
} else { } else {
if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
.newData[i].productSn) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
.newData[i].productSn)
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn)
}
} else { } else {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
'(' + (that.newData[i] .newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} }
} }
@ -1052,13 +1086,23 @@
} }
} else { } else {
if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].productName == that.newData[i].productSn) {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
.newData[i].productSn)
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn)
}
} else { } else {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
'(' + (that.newData[i] .newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} }
} }
@ -1104,13 +1148,23 @@
} }
} else { } else {
if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].productName == that.newData[i].productSn) {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
.newData[i].productSn)
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn)
}
} else { } else {
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
.newData[i].productSn + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
'(' + (that.newData[i] .newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')') .productName == null ? '' : that.newData[i].productName) + ')')
}else{ // 0是没买过
strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
.newData[i].productSn + '(' + (that.newData[i]
.productName == null ? '' : that.newData[i].productName) + ')')
}
} }
} }
if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that

83
package1/inventory/addGoods.vue

@ -17,7 +17,9 @@
<uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" /> <uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" />
<uni-icons type="refresh" color="#777" size='36' @tap="$refs.SNDialog.open('center')"></uni-icons> <uni-icons type="refresh" color="#777" size='36' @tap="$refs.SNDialog.open('center')"></uni-icons>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="采购价" name="price">
<input type="digit" class="content-input" v-model="formData.purchasePrice" @focus="obtainPrice($event,'purchasePrice')" @blur="changessPrice($event,'purchasePrice')" placeholder="请输入采购价">
</uni-forms-item>
<uni-forms-item label="批发价" name="wholesalePrice"> <uni-forms-item label="批发价" name="wholesalePrice">
<!-- <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> --> <!-- <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> -->
<input type="digit" class="content-input" v-model="formData.wholesalePrice" @focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" placeholder="请输入批发价"> <input type="digit" class="content-input" v-model="formData.wholesalePrice" @focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" placeholder="请输入批发价">
@ -200,6 +202,24 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 给供应商回款的弹层 -->
<uni-popup ref="warnPopup" background-color="#fff">
<view class="popup-content" style="width: 500rpx;height: 300rpx;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
您维护采购价后,现在有{{(guigeNum * differencePurchasePrice).toFixed(2)}}的差额,是否自动给供应商“{{dataList.supplierName}}”回款?
</view>
<view class="popup-bottom" style="position: absolute;">
<view class="popup-bottom-left">
<view class="bottom-btn" @tap="this.$refs.warnPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">不需要</view>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="supplierCollection">回款</view>
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -220,6 +240,7 @@
productName: '', productName: '',
price: 0, price: 0,
productSn: '', productSn: '',
purchasePrice:'',
wholesalePrice: 0, wholesalePrice: 0,
productPicture: '', productPicture: '',
productIntro: '', productIntro: '',
@ -360,7 +381,10 @@
categoryList: [], categoryList: [],
cancelArr:[], cancelArr:[],
productId:'', productId:'',
arrtList: [], arrtList: [],
guigeNum:0,//总共有多少件库存
differencePurchasePrice:0,//旧采购价和新维护采购价的差额差额
oldPurchasePrice:0,
userType: '', userType: '',
typeItem:{}, typeItem:{},
arrtChange: [], arrtChange: [],
@ -456,6 +480,8 @@
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.purchasePrice = res.result.purchasePrice
this.oldPurchasePrice = res.result.purchasePrice
this.formData.wholesalePrice = res.result.wholesalePrice this.formData.wholesalePrice = res.result.wholesalePrice
this.formData.productPicture = res.result.productPicture this.formData.productPicture = res.result.productPicture
this.formData.productIntro = res.result.productIntro this.formData.productIntro = res.result.productIntro
@ -521,6 +547,21 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
},
supplierCollection(){
this.tui.request('/app/debt/recharge', "post", {
userId:this.dataList.supplierId,
amountOwed:(this.guigeNum * this.differencePurchasePrice).toFixed(2),
userType:'1'
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast('回款成功')
this.$refs.warnPopup.close()
}else{
this.tui.toast(res.message)
this.$refs.warnPopup.close()
}
})
}, },
//进入页面,查询货号列表 //进入页面,查询货号列表
getSnList(){ getSnList(){
@ -618,6 +659,8 @@
this.formData.price = '' this.formData.price = ''
}else if(type=='wholesalePrice'){ }else if(type=='wholesalePrice'){
this.formData.wholesalePrice = '' this.formData.wholesalePrice = ''
}else if(type=='purchasePrice'){
this.formData.purchasePrice = ''
} }
}, },
generateSn(value){ generateSn(value){
@ -767,7 +810,7 @@
} }
} }
}else{ }else if(type == 'wholesalePrice'){
if(this.linshiPrice == e.target.value){ if(this.linshiPrice == e.target.value){
this.formData.wholesalePrice = e.target.value this.formData.wholesalePrice = e.target.value
}else{ }else{
@ -778,6 +821,40 @@
} }
} }
}else if(type == 'purchasePrice'){
uni.showLoading({
title: '加载中...',
mask:true
})
if(this.linshiPrice == e.target.value){
this.formData.purchasePrice = e.target.value
}else{
if(e.target.value == ''){
this.formData.purchasePrice = this.linshiPrice
}else{
this.differencePurchasePrice = Number(this.oldPurchasePrice) - Number(e.target.value)
this.tui.request("/app/purchase/getPurchaseListByProductId", "post", {
productId: this.dataList.id,
pageSize: 9999,
pageNum: this.pageNum
}, false, false).then((res) => {
if (res.code == 200) {
this.guigeNum = 0
for(let i=0;i<res.result.records.length;i++){
this.guigeNum += Number(res.result.records[i].purchase.totalAmount)
}
setTimeout(res=>{
this.$refs.warnPopup.open()
uni.hideLoading()
},1000)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.formData.purchasePrice = e.target.value
}
}
} }
}, },

7
package1/inventory/inventoryConfirm.vue

@ -177,6 +177,9 @@
url = '/app/stock/putInOfProduct' url = '/app/stock/putInOfProduct'
}else{ }else{
url = '/app/stock/putOutPrice' url = '/app/stock/putOutPrice'
for(let i=0;i<this.purchaseDetails.length;i++){
delete this.purchaseDetails[i].id;
}
} }
this.$nextTick(()=>{ this.$nextTick(()=>{
@ -187,7 +190,7 @@
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: "退货成功", title: "成功",
icon: 'none' icon: 'none'
}) })
setTimeout(res => { setTimeout(res => {
@ -197,7 +200,7 @@
}, 1000) }, 1000)
} else { } else {
uni.showToast({ uni.showToast({
title: "退货失败", title: "失败",
icon: 'none' icon: 'none'
}) })
} }

Loading…
Cancel
Save