|
|
@@ -15,7 +15,6 @@ Page({
|
|
|
orderService: app.globalData['orderService'],
|
|
|
saleOutBoundService: app.globalData['saleOutBoundService'],
|
|
|
commonService: app.globalData['commonService'],
|
|
|
- btnFormData: JSON.stringify({ flag: true }),
|
|
|
cardList: [
|
|
|
{ name: 'main', title: mixins.$t("customerInformation") },
|
|
|
{ name: 'relation' },
|
|
|
@@ -39,8 +38,8 @@ Page({
|
|
|
code: 'fromNo',
|
|
|
name: 'fromNo',
|
|
|
type: 'choose',
|
|
|
- titpsKey:'cusId',
|
|
|
- titpsMessage:'请选择客户',
|
|
|
+ titpsKey: 'cusId',
|
|
|
+ titpsMessage: '请选择客户',
|
|
|
controlChooseFlag: true,
|
|
|
title: mixins.$t("sourceOrder"),//'关联源单'
|
|
|
urlKey: 'selectSourceSaleOrder'
|
|
|
@@ -58,7 +57,7 @@ Page({
|
|
|
},
|
|
|
//按钮
|
|
|
buttonSaveList: [
|
|
|
- { code: 'save', title: mixins.$t("save"), width: '120rpx' }
|
|
|
+ { code: 'save', title: mixins.$t("save") }
|
|
|
],
|
|
|
contentSaveList: [
|
|
|
{ code: 'flag', title: mixins.$t("autoSaleOutBoundFlag"), type: 'checkbox' },
|
|
|
@@ -75,7 +74,7 @@ Page({
|
|
|
popupTopObj: [{ leftTitle: '库存量', leftCode: 'usableQty', rightTitle: '可售量', rightCode: 'invQty' }],
|
|
|
titpsFlag: true,
|
|
|
// 系统参数
|
|
|
- flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false
|
|
|
+ flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 编辑
|
|
|
@@ -136,20 +135,6 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 底部按钮事件
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
- saveButton(e) {
|
|
|
- console.log(e)
|
|
|
- let name = e.detail.name
|
|
|
- if (name == 'save') { //保存
|
|
|
- this.save({})
|
|
|
- } else if (name == 'collection') { //收款
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
/**
|
|
|
* @desc : 设置保存参数
|
|
|
@@ -227,13 +212,13 @@ Page({
|
|
|
// return
|
|
|
formData = res.data.data.data
|
|
|
//销售订单列表转出库
|
|
|
- formData.fromNo = formData.orderNo
|
|
|
+ formData.fromNo = formData.fromNo ? formData.fromNo : formData.orderNo
|
|
|
//处理地址
|
|
|
formData.address = this.setAddress(formData)
|
|
|
//处理明细
|
|
|
let listData = res.data.data.dataItem
|
|
|
if (listData && listData.length > 0) {
|
|
|
-
|
|
|
+
|
|
|
if (this.data.formMode == 'other') {
|
|
|
//过滤可出库量为0的
|
|
|
listData = listData.filter(item => {
|
|
|
@@ -242,28 +227,48 @@ Page({
|
|
|
}
|
|
|
let list = []
|
|
|
listData.forEach(item => {
|
|
|
+ console.log('Service',Service)
|
|
|
if (this.data.formMode == 'detail' && Service !== 'saleOutBoundService') {
|
|
|
item.outingQty = item.outQty
|
|
|
item.outingAmt = Number(item.outingQty * item.priceOut)
|
|
|
- } else if(this.data.formMode == 'other'){
|
|
|
+ } else if (this.data.formMode == 'other') {
|
|
|
item.outingQty = item.canOutingQty
|
|
|
item.outingAmt = Number(item.outingQty * item.priceOut)
|
|
|
}
|
|
|
+ // if (this.data.formMode == 'detail' && Service == 'saleOutBoundService') {
|
|
|
+ // item.outingQty = item.outQty
|
|
|
+ // item.outingAmt = Number(item.outingQty * item.priceOut)
|
|
|
+ // }
|
|
|
//出库中 办理详情页
|
|
|
- if(this.data.formMode == 'other' && Service == 'saleOutBoundService'){
|
|
|
-
|
|
|
+ if (this.data.formMode == 'other' && Service == 'saleOutBoundService') {
|
|
|
+ item.outingQty = item.outQty
|
|
|
+ item.outingAmt = Number(item.outingQty * item.priceOut)
|
|
|
+ }
|
|
|
+ //处理图片
|
|
|
+ if (item.skuImages) {
|
|
|
+ item['imagesUrl'] = item.skuImages.length > 0 ? item.skuImages[0].url : null
|
|
|
}
|
|
|
|
|
|
- item.outingQtyMax = item.canOutingQty //可出库最大值
|
|
|
- item.outingQtyMin = 1 //可出库最小值
|
|
|
+ item.outingQty_max = item.canOutingQty ? item.canOutingQty : item.invQty //可出库最大值
|
|
|
+ item.outingQty_min = 1 //可出库最小值
|
|
|
list.push({
|
|
|
skuId: item.skuId,
|
|
|
nonStdCode: item.nonStdCode,
|
|
|
whId: item.whId
|
|
|
})
|
|
|
})
|
|
|
- console.log('listData',listData)
|
|
|
- let that = this
|
|
|
+ //处理按钮
|
|
|
+ if (res.data.data.data && res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus")) {
|
|
|
+ let buttonSaveList = this.data.buttonSaveList
|
|
|
+ buttonSaveList = [
|
|
|
+ { name: 'merge', title: mixins.$t("handleWithdrawal"), }
|
|
|
+ ]
|
|
|
+ this.setData({
|
|
|
+ buttonSaveList:buttonSaveList
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log('listData', listData)
|
|
|
+ let that = this
|
|
|
//批量查库存
|
|
|
this.getInventory({ skuIdNonStdCodeWhIdList: list }).then(item => {
|
|
|
listData.forEach(res => {
|
|
|
@@ -277,13 +282,13 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
formData.goodsList = listData
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
//处理库存量
|
|
|
this.calculationSalesUsableQty()
|
|
|
})
|
|
|
@@ -303,6 +308,46 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 底部按钮事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ saveButton(e) {
|
|
|
+ let name = e.detail.name
|
|
|
+ console.log(e)
|
|
|
+ if (name == 'save') { //保存
|
|
|
+ this.save({})
|
|
|
+ } else { //撤回
|
|
|
+ this.handleWarehousing()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 撤回
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于
|
|
|
+ */
|
|
|
+ handleWarehousing(e) {
|
|
|
+ let item = {}
|
|
|
+ item.outId = this.data.id
|
|
|
+ this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.saleOrderOutboundCancel, item).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 删除明细
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ deleteItemList() {
|
|
|
+ console.log('deleteItemList')
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ this.calculateAmount(formData)
|
|
|
+ },
|
|
|
/**
|
|
|
* @desc : 给表单赋值
|
|
|
* @date : 2024/2/1 15:49
|
|
|
@@ -512,6 +557,7 @@ Page({
|
|
|
})
|
|
|
formData.goodsList = item.itemList
|
|
|
formData.fromNo = item.fromNo
|
|
|
+ formData.fromId = item.fromId
|
|
|
this.calculateAmount(formData)
|
|
|
}
|
|
|
}
|
|
|
@@ -645,14 +691,14 @@ Page({
|
|
|
if (this.data.formMode == Constants.formMode.detail) {
|
|
|
//按钮
|
|
|
buttonSaveList = [
|
|
|
- { code: 'save', title: mixins.$t("outProcessing"), width: '120rpx', color: '#1B365D' }
|
|
|
+ { code: 'save', title: mixins.$t("outProcessing") }
|
|
|
]
|
|
|
contentSaveList = [
|
|
|
// { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
|
|
|
{ code: 'receivable', content: 0, type: 'number', title: mixins.$t("saleCollection") }
|
|
|
]
|
|
|
popContent = [
|
|
|
- { code: 'outQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
|
|
|
+ { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
|
|
|
{ code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
|
|
|
|
|
|
{ code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },
|