|
|
@@ -15,7 +15,9 @@ Page({
|
|
|
orderService: app.globalData['orderService'],
|
|
|
commonService: app.globalData['commonService'],
|
|
|
saleOutBoundReturnService: app.globalData['saleOutBoundReturnService'],
|
|
|
- btnFormData: JSON.stringify({ flag: true }),
|
|
|
+ btnFormData: JSON.stringify({ flag: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false }),
|
|
|
+ // 系统参数
|
|
|
+ flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false,
|
|
|
cardList: [
|
|
|
{ name: 'main', title: mixins.$t("customerInformation") },
|
|
|
{ name: 'relation' },
|
|
|
@@ -36,8 +38,8 @@ Page({
|
|
|
code: 'fromNo',
|
|
|
name: 'fromNo',
|
|
|
type: 'choose',
|
|
|
- titpsKey:'cusId',
|
|
|
- titpsMessage:'请选择客户',
|
|
|
+ titpsKey: 'cusId',
|
|
|
+ titpsMessage: '请选择客户',
|
|
|
controlChooseFlag: true,
|
|
|
title: mixins.$t("sourceOrder"),//'关联源单'
|
|
|
urlKey: 'selectSourceSaleOrder'
|
|
|
@@ -55,8 +57,7 @@ Page({
|
|
|
},
|
|
|
//按钮
|
|
|
buttonSaveList: [
|
|
|
- { code: 'collection', title: mixins.$t("collection"),plain:true },
|
|
|
- { code: 'save', title: mixins.$t("save")}
|
|
|
+ { code: 'save', title: mixins.$t("save") }
|
|
|
],
|
|
|
contentSaveList: [
|
|
|
{ code: 'flag', title: mixins.$t("saleOutBoundFlag"), type: 'checkbox' },
|
|
|
@@ -160,7 +161,7 @@ Page({
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
- getInventory(params) {
|
|
|
+ getInventory(params) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.excute(this.data.commonService, this.data.commonService.getInventoryByList, params).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
@@ -244,12 +245,12 @@ Page({
|
|
|
}
|
|
|
//选择源单
|
|
|
if (code == 'fromNo') {
|
|
|
- console.log('item.itemList',item.itemList)
|
|
|
+ console.log('item.itemList', item.itemList)
|
|
|
if (item.itemList && item.itemList.length > 0) {
|
|
|
- item.itemList.forEach(res=>{
|
|
|
+ item.itemList.forEach(res => {
|
|
|
res.outingAmt = res.outAmt * -1
|
|
|
res.outingQty = res.outQty * -1
|
|
|
- res['outingQty_min'] = res.outQty * -1
|
|
|
+ res['outingQty_min'] = res.outQty * -1
|
|
|
res['outingQty_max'] = Number(-1)
|
|
|
})
|
|
|
|
|
|
@@ -281,11 +282,11 @@ Page({
|
|
|
this.handleWarehousing()
|
|
|
}
|
|
|
},
|
|
|
- /**
|
|
|
- * @desc : 撤回
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * @desc : 撤回
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于
|
|
|
+ */
|
|
|
handleWarehousing(e) {
|
|
|
let item = {}
|
|
|
item.outId = this.data.id
|
|
|
@@ -311,10 +312,10 @@ Page({
|
|
|
res['sOrderId'] = res.sorderId
|
|
|
res.itemIndex = itemIndex++
|
|
|
res.canNegativeFlag = true
|
|
|
- if(this.data.formMode != 'detail'){
|
|
|
+ if (this.data.formMode != 'detail') {
|
|
|
delete res['itemId']
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
|
|
|
@@ -363,13 +364,13 @@ Page({
|
|
|
return this.excute(this.data[service], this.data[service][API] + '/' + id, {}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- if (res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus")) {
|
|
|
- let buttonSaveList = this.data.buttonSaveList
|
|
|
+ if (res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus") && this.data.formMode != 'other') {
|
|
|
+ let buttonSaveList = this.data.buttonSaveList
|
|
|
buttonSaveList = [
|
|
|
{ name: 'merge', title: mixins.$t("handleWithdrawal"), }
|
|
|
]
|
|
|
this.setData({
|
|
|
- buttonSaveList:buttonSaveList
|
|
|
+ buttonSaveList: buttonSaveList
|
|
|
})
|
|
|
}
|
|
|
formData = res.data.data.data
|
|
|
@@ -377,18 +378,18 @@ Page({
|
|
|
if (!API) {
|
|
|
formData.fromNo = formData.formNo
|
|
|
} else {
|
|
|
- formData.fromNo = formData.orderNo
|
|
|
+ formData.fromNo = formData.fromNo ? formData.fromNo : formData.orderNo
|
|
|
}
|
|
|
//处理地址
|
|
|
formData.address = this.setAddress(formData)
|
|
|
|
|
|
- res.data.data.dataItem.forEach(item=>{
|
|
|
- item.outingQty_max = -1
|
|
|
- item.priceStd = item.priceOut
|
|
|
- item.outingQty_min = item.canOutingQty ? item.canOutingQty : item.invQty*-1 //可出库最大值
|
|
|
+ res.data.data.dataItem.forEach(item => {
|
|
|
+ item.outingQty_max = -1
|
|
|
+ item.priceStd = item.priceOut
|
|
|
+ item.outingQty_min = item.canOutingQty ? item.canOutingQty : item.invQty * -1 //可出库最大值
|
|
|
})
|
|
|
|
|
|
-
|
|
|
+
|
|
|
formData.goodsList = res.data.data.dataItem
|
|
|
//处理默认值 业务员业务部门
|
|
|
formData = this.setStaffOrg(formData)
|
|
|
@@ -396,8 +397,8 @@ Page({
|
|
|
let cardList = this.data.cardList
|
|
|
cardList[2].chooseGoodsFlag = false
|
|
|
this.calculateAmount(formData)
|
|
|
- console.log('结果',res)
|
|
|
-
|
|
|
+ console.log('结果', res)
|
|
|
+
|
|
|
this.setData({
|
|
|
cardList: cardList,
|
|
|
formData: JSON.stringify(formData)
|
|
|
@@ -425,7 +426,7 @@ Page({
|
|
|
cardList[1].sumStandard = data.sumStandard
|
|
|
cardList[1].sumQuantity = data.sumQuantity
|
|
|
cardList[1].saleDiscount = data.saleDiscount
|
|
|
- console.log(data,'11')
|
|
|
+ console.log(data, '11')
|
|
|
|
|
|
this.setData({
|
|
|
cardList: cardList,
|
|
|
@@ -627,6 +628,22 @@ Page({
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: '编辑销售退货'
|
|
|
})
|
|
|
+
|
|
|
+ if (this.data.formMode == Constants.formMode.other) {
|
|
|
+ this.setData({
|
|
|
+ popContent: [
|
|
|
+ { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
|
|
|
+ { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
|
|
|
+ {
|
|
|
+ code: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
|
|
|
+ },
|
|
|
+ { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
|
|
|
+ { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', readonly: true },
|
|
|
+ ]
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log('this.data.id', this.data.id)
|
|
|
//查询信息
|
|
|
this.getItemDetal(this.data.id)
|
|
|
}
|