|
|
@@ -38,12 +38,19 @@ Page({
|
|
|
contentObj: {},
|
|
|
popContent: [
|
|
|
{
|
|
|
- code: 'intoingQty',
|
|
|
+ code: 'itemQty',
|
|
|
type: 'step',
|
|
|
title: mixins.$t('count'),
|
|
|
},
|
|
|
{ code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
|
|
|
{
|
|
|
+ code: 'priceInto',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("inboundPrice"),
|
|
|
+ required: true,
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
code: 'whId',
|
|
|
name: 'whName',
|
|
|
title: mixins.$t('warehouseId'),
|
|
|
@@ -184,6 +191,7 @@ Page({
|
|
|
element.box = element.intoingBox
|
|
|
element.piece = element.intoingPiece
|
|
|
}
|
|
|
+ element.sumPrice = element.priceInto * element.itemQty
|
|
|
if (data.whId) {
|
|
|
element.whId = data.whId
|
|
|
element.whName = data.whName
|
|
|
@@ -248,10 +256,28 @@ Page({
|
|
|
let totalAmout = Number(0)
|
|
|
let totalQuantity = Number(0)
|
|
|
// 各个明细的金额数量
|
|
|
- formData.goodsList.forEach(element => { //循环出商品总共价格
|
|
|
- element.intoingAmt = element.priceInto * element.intoingQty
|
|
|
- totalAmout += Number(element.priceInto * element.intoingQty)
|
|
|
- totalQuantity += Number(element.intoingQty)
|
|
|
+ formData.goodsList.forEach(element => { //循环出商品总共价格
|
|
|
+ //"入库状态-已入库"
|
|
|
+ if (formData.intoStatus == Constants.intoStatus.inBounded) {
|
|
|
+ element.intoQty = element.itemQty
|
|
|
+ element.priceInto = element.priceInto ? element.priceInto : element.pricePurchase
|
|
|
+ element.intoAmt = element.priceInto * element.intoQty
|
|
|
+ element.intoingAmt = 0 // 入库中金额
|
|
|
+ element.intoingQty = 0 // 入库中数量
|
|
|
+ totalAmout += Number(element.priceInto * element.intoQty)
|
|
|
+ totalQuantity += Number(element.intoQty)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ element.intoingQty = element.itemQty
|
|
|
+ element.priceInto = element.priceInto ? element.priceInto : element.pricePurchase
|
|
|
+ element.intoingAmt = element.priceInto * element.intoingQty
|
|
|
+ element.intoAmt = 0 // 已入库金额
|
|
|
+ element.intoQty = 0 // 已入库数量
|
|
|
+ totalAmout += Number(element.priceInto * element.intoingQty)
|
|
|
+ totalQuantity += Number(element.intoingQty)
|
|
|
+ }
|
|
|
+ element.packageBox = element['box'] + element.subUnitName + element['piece'] + element.unitName
|
|
|
+ element.nonStdCode = element.nonStdCode != null ? element.nonStdCode : '-'
|
|
|
})
|
|
|
// 左下角的合计金额
|
|
|
contentList_.forEach(card => {
|
|
|
@@ -264,7 +290,13 @@ Page({
|
|
|
if (card.name === 'items') {
|
|
|
//合计金额
|
|
|
card.itemAmt = totalAmout
|
|
|
- card.intoingQty = totalQuantity
|
|
|
+ card.content = totalQuantity
|
|
|
+ // 入库状态-已入库
|
|
|
+ if (formData.intoStatus == Constants.intoStatus.inBounded) {
|
|
|
+ card.intoQty = totalQuantity
|
|
|
+ } else {
|
|
|
+ card.intoingQty = totalQuantity
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
this.setData({
|
|
|
@@ -355,10 +387,10 @@ Page({
|
|
|
params.intoingQty = formData.goodsList.sum("intoingQty") //一共的商品数量
|
|
|
params.intoAmt = 0 // 已入库金额
|
|
|
params.intoQty = 0 // 已入库数量
|
|
|
- formData.goodsList.forEach(item => {
|
|
|
+ formData.goodsList.forEach(item => {
|
|
|
item.intoingBox = item.box
|
|
|
item.intoingPiece = item.piece
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
params.itemList = formData.goodsList //商品明细
|
|
|
params.annexPaths = formData.annexPaths || [] //附件
|
|
|
@@ -468,8 +500,7 @@ Page({
|
|
|
cardList,
|
|
|
})
|
|
|
|
|
|
- } else if (this.data.item.intoType == Constants.intoType.other ||
|
|
|
- this.data.item.intoType == Constants.intoType.first) {
|
|
|
+ } else if (this.data.item.intoType == Constants.intoType.other) {
|
|
|
if (this.data.item.intoType == Constants.intoType.first) {
|
|
|
// 其他入库
|
|
|
wx.setNavigationBarTitle({
|
|
|
@@ -563,6 +594,54 @@ Page({
|
|
|
contentObj,
|
|
|
cardList,
|
|
|
})
|
|
|
+ } else if (this.data.item.intoType == Constants.intoType.first) {
|
|
|
+ // 期初入库
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: mixins.$t('firstInWh'),
|
|
|
+ })
|
|
|
+
|
|
|
+ cardList = [
|
|
|
+ {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t('goodsDetail'),
|
|
|
+ info: '(' + mixins.$t('warehousingProcessing') + ')',
|
|
|
+ chooseGoodsFlag: false,
|
|
|
+ color: '#E4002B',
|
|
|
+ displayNum: 2
|
|
|
+ }, {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t('otherInfo')
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ contentObj = {
|
|
|
+
|
|
|
+
|
|
|
+ items: [{
|
|
|
+ code: 'collectType',
|
|
|
+ name: 'collectName',
|
|
|
+ type: 'drop',
|
|
|
+ dropType: 'collect'
|
|
|
+ }, {
|
|
|
+ code: 'collectAmount',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t('totalAmount'),
|
|
|
+ }],
|
|
|
+
|
|
|
+ other: [{
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t('remarks'),
|
|
|
+ readonly: false
|
|
|
+ }, {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: mixins.$t('uploader')
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ contentObj,
|
|
|
+ cardList,
|
|
|
+ })
|
|
|
} else {
|
|
|
// 销售退货
|
|
|
cardList = [{
|