|
|
@@ -285,7 +285,7 @@ Page({
|
|
|
fixed: true,
|
|
|
},
|
|
|
]
|
|
|
- },
|
|
|
+ },
|
|
|
popContentReverse: [{
|
|
|
code: 'sumAmount',
|
|
|
type: 'number',
|
|
|
@@ -594,7 +594,7 @@ Page({
|
|
|
params.addressName = params.address.addressName ? params.address.addressName : params.address.name
|
|
|
// params.salesChannel = params.channelId
|
|
|
params.canNegativeFlag = false
|
|
|
- params.outDate = params.outDate ? params.outDate : util.formatDayTime(new Date())
|
|
|
+ params.outDate = params.outDate ? params.outDate : util.formatDayTime(new Date())
|
|
|
|
|
|
params.btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
|
|
|
if (params.goodsList) { //算出 要收的钱
|
|
|
@@ -608,7 +608,7 @@ Page({
|
|
|
params.objInfo['cusPhone'] = params.cusPhone
|
|
|
params.objInfo['cusName'] = params.cusName
|
|
|
params.objInfo['objectId'] = params.cusId
|
|
|
- params.objectId= params.cusId
|
|
|
+ params.objectId = params.cusId
|
|
|
params.objInfo['addressFull'] = params.addressFull
|
|
|
params.formType = 11
|
|
|
delete params['goodsList']
|
|
|
@@ -719,8 +719,8 @@ Page({
|
|
|
formData = res.data.data.data
|
|
|
//销售订单列表转出库
|
|
|
formData.fromNo = formData.fromNo ? formData.fromNo : formData.orderNo
|
|
|
- console.log('formData',formData)
|
|
|
- formData.outDate = util.formatDayTime(new Date(formData.outDate ? formData.outDate : formData.deliveryDate))
|
|
|
+ console.log('formData', formData)
|
|
|
+ formData.outDate = util.formatDayTime(new Date(formData.outDate ? formData.outDate : formData.deliveryDate))
|
|
|
//处理地址
|
|
|
formData.address = this.setAddress(formData)
|
|
|
//处理明细
|
|
|
@@ -1130,30 +1130,39 @@ Page({
|
|
|
}
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
formData.goodsList.forEach(res => {
|
|
|
- if (res.invId) {
|
|
|
+ if (res.invId ) {
|
|
|
//选择的数量大于可售量
|
|
|
- if (Math.abs(key ? res[key] : res.outQty) > res.usableQty) {
|
|
|
- res['usableQtyInsufficientFlag'] = true //可售量不足
|
|
|
- res['usableQty'] = res.usableQty //可售量
|
|
|
- res['titpsItemColorFlagKey'] = true
|
|
|
- res['titpsLabel'] = '缺货'
|
|
|
- } else {
|
|
|
- res['usableQtyInsufficientFlag'] = false //可售量不足
|
|
|
- res['usableQty'] = res.usableQty //可售量
|
|
|
- res['titpsItemColorFlagKey'] = false
|
|
|
- res['titpsLabel'] = '有货'
|
|
|
+ //不包含外协
|
|
|
+ if(res.skuId){
|
|
|
+ if (Math.abs(key ? res[key] : res.outQty) > res.usableQty) {
|
|
|
+ res['usableQtyInsufficientFlag'] = true //可售量不足
|
|
|
+ res['usableQty'] = res.usableQty //可售量
|
|
|
+ res['titpsItemColorFlagKey'] = true
|
|
|
+ res['titpsLabel'] = '缺货'
|
|
|
+ } else {
|
|
|
+ res['usableQtyInsufficientFlag'] = false //可售量不足
|
|
|
+ res['usableQty'] = res.usableQty //可售量
|
|
|
+ res['titpsItemColorFlagKey'] = false
|
|
|
+ res['titpsLabel'] = '有货'
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
+ //不包含外协
|
|
|
+ if(res.skuId){
|
|
|
// res['usableQtyInsufficientFlag'] = true //可售量不足
|
|
|
// res['usableQty'] = res.usableQty //可售量
|
|
|
res['titpsItemColorFlagKey'] = true
|
|
|
res['titpsLabel'] = '缺货'
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
})
|
|
|
let usableQtyInsufficientFlagList = formData.goodsList.filter(item => {
|
|
|
return item.usableQtyInsufficientFlag
|
|
|
})
|
|
|
+ console.log('calculationSalesUsableQty')
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData),
|
|
|
goodsTagColor: usableQtyInsufficientFlagList.length > 0 ? '#E4002B' : null //设置颜色
|
|
|
@@ -1298,6 +1307,9 @@ Page({
|
|
|
formData.staffId = item.item.staffId
|
|
|
}
|
|
|
}
|
|
|
+ //处理库存量
|
|
|
+ this.setGoods()
|
|
|
+ this.calculationSalesUsableQty('outingQty')
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
})
|
|
|
@@ -1651,6 +1663,10 @@ Page({
|
|
|
// title: mixins.$t("actualTotalAmount")
|
|
|
// }
|
|
|
]
|
|
|
+
|
|
|
+ // if(){
|
|
|
+
|
|
|
+ // }
|
|
|
popContent = [{
|
|
|
code: 'outingQty',
|
|
|
type: 'step',
|
|
|
@@ -1678,12 +1694,20 @@ Page({
|
|
|
required: true,
|
|
|
readonly: true
|
|
|
},
|
|
|
+ // {
|
|
|
+ // code: 'whName',
|
|
|
+ // title: mixins.$t("warehouseId"),
|
|
|
+ // type: 'str',
|
|
|
+ // readonly: true,
|
|
|
+ // readonly: true
|
|
|
+ // },
|
|
|
{
|
|
|
- code: 'whName',
|
|
|
+ code: 'whId',
|
|
|
+ name: 'whName',
|
|
|
+ choosePopupType: 'inventorySku',
|
|
|
title: mixins.$t("warehouseId"),
|
|
|
- type: 'str',
|
|
|
- readonly: true,
|
|
|
- readonly: true
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'openingInventory',
|
|
|
},
|
|
|
{
|
|
|
code: 'nonStdCode',
|
|
|
@@ -1800,9 +1824,9 @@ Page({
|
|
|
this.setFormMain()
|
|
|
this.setFlagView(this)
|
|
|
this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
|
|
|
- this.setData({
|
|
|
- isDetailFlag: true,
|
|
|
- })
|
|
|
+ // this.setData({
|
|
|
+ // isDetailFlag: true,
|
|
|
+ // })
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData),
|
|
|
})
|
|
|
@@ -1826,6 +1850,48 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 打开商品事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ openChoosedItemInfo(e) {
|
|
|
+ if (e.detail.item.skuId || e.detail.item.skuId != null) {
|
|
|
+ //外协品 不显示仓库
|
|
|
+ //详情(办理)
|
|
|
+ if (this.data.formMode == Constants.formMode.detail) {
|
|
|
+ this.setData({
|
|
|
+ popContent:[{
|
|
|
+ code: 'outingQty',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("count"),
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'packageBox',
|
|
|
+ type: 'packageBox',
|
|
|
+ title: mixins.$t("packageBox"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'factPrice',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("factPrice"),
|
|
|
+ required: true,
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'nonStdCode',
|
|
|
+ title: mixins.$t("goodsBatch"),
|
|
|
+ type: 'str',
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 设置系统版本相关
|
|
|
* @date : 2024/2/1 15:49
|
|
|
@@ -2086,4 +2152,18 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : onShow
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ onShow() {
|
|
|
+ //详情页
|
|
|
+ if (this.data.formMode == Constants.formMode.detail) {
|
|
|
+ console.log('保存成功后刷新页面')
|
|
|
+ this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|