|
|
@@ -15,24 +15,79 @@ Page({
|
|
|
orderService: app.globalData['orderService'],
|
|
|
commonService: app.globalData['commonService'],
|
|
|
saleOutBoundReturnService: app.globalData['saleOutBoundReturnService'],
|
|
|
- btnFormData: JSON.stringify({ flag: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false }),
|
|
|
+ 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' },
|
|
|
- { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: true, itemAmt: '', displayNum: 2 },
|
|
|
- { name: 'other', title: mixins.$t("otherInfo") }
|
|
|
+ cardList: [{
|
|
|
+ name: 'main',
|
|
|
+ title: mixins.$t("customerInformation")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'relation'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t("goodsDetail"),
|
|
|
+ chooseGoodsFlag: true,
|
|
|
+ itemAmt: '',
|
|
|
+ displayNum: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t("otherInfo")
|
|
|
+ }
|
|
|
],
|
|
|
- popupTopObj: [{ leftTitle: '库存量', leftCode: 'usableQty', rightTitle: '可售量', rightCode: 'invQty' }],
|
|
|
+ popupTopObj: [{
|
|
|
+ leftTitle: '库存量',
|
|
|
+ leftCode: 'usableQty',
|
|
|
+ rightTitle: '可售量',
|
|
|
+ rightCode: 'invQty'
|
|
|
+ }],
|
|
|
contentObj: {
|
|
|
- main: [
|
|
|
- { code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
|
|
|
- { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
|
|
|
- { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
|
|
|
- { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
|
|
|
- { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel', title: mixins.$t('saleChannel') },
|
|
|
- { code: 'cusFrom', name: 'cusFromName', type: 'drop', required: false, dropType: 'customerFrom', title: mixins.$t('customerSource') },
|
|
|
+ main: [{
|
|
|
+ code: 'cusName',
|
|
|
+ type: 'selectIcon',
|
|
|
+ urlKey: 'selectCustomers',
|
|
|
+ required: true,
|
|
|
+ readonly: false,
|
|
|
+ title: mixins.$t('customerName')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'cusPhone',
|
|
|
+ type: 'phone',
|
|
|
+ title: mixins.$t('cusPhone'),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'addressFull',
|
|
|
+ type: 'address',
|
|
|
+ title: mixins.$t('addressFull'),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'addressNo',
|
|
|
+ type: 'str',
|
|
|
+ required: true,
|
|
|
+ title: mixins.$t('addressNo')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'channelId',
|
|
|
+ name: 'channelName',
|
|
|
+ type: 'drop',
|
|
|
+ required: true,
|
|
|
+ dropType: 'saleChannel',
|
|
|
+ title: mixins.$t('saleChannel')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'cusFrom',
|
|
|
+ name: 'cusFromName',
|
|
|
+ type: 'drop',
|
|
|
+ required: false,
|
|
|
+ dropType: 'customerFrom',
|
|
|
+ title: mixins.$t('customerSource')
|
|
|
+ },
|
|
|
],
|
|
|
relation: [{
|
|
|
code: 'fromNo',
|
|
|
@@ -41,43 +96,102 @@ Page({
|
|
|
titpsKey: 'cusId',
|
|
|
titpsMessage: '请选择客户',
|
|
|
controlChooseFlag: true,
|
|
|
- title: mixins.$t("sourceOrder"),//'关联源单'
|
|
|
+ title: mixins.$t("sourceOrder"), //'关联源单'
|
|
|
urlKey: 'selectSourceSaleOrder'
|
|
|
}],
|
|
|
- items: [
|
|
|
- { code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },
|
|
|
- { code: 'collectAmount', type: 'number', title: mixins.$t("amountCollected"), required: true }
|
|
|
+ items: [{
|
|
|
+ code: 'collectType',
|
|
|
+ name: 'collectName',
|
|
|
+ type: 'drop',
|
|
|
+ dropType: 'collect'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'collectAmount',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("amountCollected"),
|
|
|
+ }
|
|
|
],
|
|
|
- other: [
|
|
|
- { code: 'contractNo', type: 'textarea', title: mixins.$t("contractNumber"), readonly: false },
|
|
|
-
|
|
|
- { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
|
|
|
- { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
|
|
|
+ other: [{
|
|
|
+ code: 'contractNo',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("contractNumber"),
|
|
|
+ readonly: false
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("remarks"),
|
|
|
+ readonly: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: mixins.$t("uploader")
|
|
|
+ }
|
|
|
]
|
|
|
},
|
|
|
//按钮
|
|
|
- buttonSaveList: [
|
|
|
- { code: 'save', title: mixins.$t("save") }
|
|
|
+ buttonSaveList: [{
|
|
|
+ code: 'refund',
|
|
|
+ title: mixins.$t("refund")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'save',
|
|
|
+ title: mixins.$t("save")
|
|
|
+ }
|
|
|
],
|
|
|
- contentSaveList: [
|
|
|
- { code: 'flag', title: mixins.$t("autoSaleOutBoundFlag"), type: 'checkbox' },
|
|
|
- { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
|
|
|
- { code: 'receivable', content: 0, type: 'number' }
|
|
|
+ contentSaveList: [{
|
|
|
+ code: 'flag',
|
|
|
+ title: mixins.$t("autoSaleOutBoundFlag"),
|
|
|
+ type: 'checkbox'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'need',
|
|
|
+ title: mixins.$t("saleCollection"),
|
|
|
+ type: 'str'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'receivable',
|
|
|
+ content: 0,
|
|
|
+ type: 'number'
|
|
|
+ }
|
|
|
],
|
|
|
- popContent: [
|
|
|
- { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
|
|
|
- { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
|
|
|
- { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
|
|
|
+ popContent: [{
|
|
|
+ code: 'outingQty',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("count"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'packageBox',
|
|
|
+ type: 'packageBox',
|
|
|
+ title: mixins.$t("packageBox"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
|
|
|
+ code: 'nonStdCode',
|
|
|
+ title: mixins.$t("goodsBatch"),
|
|
|
+ type: 'str',
|
|
|
},
|
|
|
- { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
|
|
|
],
|
|
|
// 新手引导
|
|
|
step: {
|
|
|
name: 'order-return',
|
|
|
- guideList: [
|
|
|
- {
|
|
|
+ guideList: [{
|
|
|
el: "#dkForm>>>#cusName",
|
|
|
tips: mixins.$t('chooseCustomer'),
|
|
|
},
|
|
|
@@ -103,7 +217,7 @@ Page({
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
- setGoods(e) {
|
|
|
+ setGoods(e) {
|
|
|
//设置需收款
|
|
|
let contentSaveList = this.data.contentSaveList
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
@@ -116,10 +230,12 @@ Page({
|
|
|
nonStdCode: res.nonStdCode,
|
|
|
whId: res.whId
|
|
|
})
|
|
|
- res.sunPrice = res.priceOut * res.itemQty
|
|
|
+ res.sunPrice = res.priceOut * res.itemQty
|
|
|
})
|
|
|
//批量查库存
|
|
|
- this.getInventory({ skuIdNonStdCodeWhIdList: list }).then(item => {
|
|
|
+ this.getInventory({
|
|
|
+ skuIdNonStdCodeWhIdList: list
|
|
|
+ }).then(item => {
|
|
|
formData.goodsList.forEach(res => {
|
|
|
if (item.length > 0) {
|
|
|
item.forEach(it => {
|
|
|
@@ -135,7 +251,7 @@ Page({
|
|
|
} else {
|
|
|
res.invQty = 0
|
|
|
res.usableQty = 0
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
//组件显示 需收款
|
|
|
contentSaveList[2]['content'] = Number(formData.sumAmount)
|
|
|
@@ -154,13 +270,13 @@ Page({
|
|
|
if (res.invId) {
|
|
|
//选择的数量大于可售量
|
|
|
if (Math.abs(res.outQty) > res.usableQty) {
|
|
|
- res['usableQtyInsufficientFlag'] = true //可售量不足
|
|
|
- res['usableQty'] = res.usableQty //可售量
|
|
|
+ res['usableQtyInsufficientFlag'] = true //可售量不足
|
|
|
+ res['usableQty'] = res.usableQty //可售量
|
|
|
res['titpsItemColorFlagKey'] = true
|
|
|
res['titpsLabel'] = '缺货'
|
|
|
} else {
|
|
|
- res['usableQtyInsufficientFlag'] = false //可售量不足
|
|
|
- res['usableQty'] = res.usableQty //可售量
|
|
|
+ res['usableQtyInsufficientFlag'] = false //可售量不足
|
|
|
+ res['usableQty'] = res.usableQty //可售量
|
|
|
res['titpsItemColorFlagKey'] = false
|
|
|
res['titpsLabel'] = '有货'
|
|
|
}
|
|
|
@@ -175,15 +291,15 @@ Page({
|
|
|
})
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData),
|
|
|
- goodsTagColor: usableQtyInsufficientFlagList.length > 0 ? '#E4002B' : null //设置颜色
|
|
|
+ goodsTagColor: usableQtyInsufficientFlagList.length > 0 ? '#E4002B' : null //设置颜色
|
|
|
})
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 查询库存
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 查询库存
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
getInventory(params) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.excute(this.data.commonService, this.data.commonService.getInventoryByList, params).then(res => {
|
|
|
@@ -197,10 +313,10 @@ Page({
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 自动办理事件
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 自动办理事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
saveChange(e) {
|
|
|
let btnFormData = JSON.parse(this.data.btnFormData)
|
|
|
let that = this
|
|
|
@@ -208,7 +324,7 @@ Page({
|
|
|
//提示
|
|
|
Dialog.confirm({
|
|
|
message: mixins.$t("saleOutBoundInfo"),
|
|
|
- }).then(() => { }).catch(() => {
|
|
|
+ }).then(() => {}).catch(() => {
|
|
|
btnFormData.flag = true
|
|
|
that.setData({
|
|
|
btnFormData: JSON.stringify(btnFormData)
|
|
|
@@ -292,24 +408,73 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 底部按钮事件
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 底部按钮事件
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
saveButton(e) {
|
|
|
- console.log('wojinlaile',e)
|
|
|
+ console.log(e)
|
|
|
let name = e.detail.name
|
|
|
if (name == 'save') { //保存
|
|
|
this.save({})
|
|
|
- } else {
|
|
|
+ } else if (name == 'merge') { //撤回
|
|
|
this.handleWarehousing()
|
|
|
+ } else if (name == 'refund') { //退款
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ formData.btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
|
|
|
+ if( formData.goodsList){ //算出 要退款 的钱
|
|
|
+ let nmb = 0
|
|
|
+ formData.goodsList.forEach(element => {
|
|
|
+ nmb = element.priceOut + nmb
|
|
|
+ });
|
|
|
+ formData.sumAmtRec = nmb
|
|
|
+ }
|
|
|
+ formData.objInfo = {} //退款页面的 客户信息
|
|
|
+ formData.objInfo['cusPhone'] = formData.cusPhone
|
|
|
+ formData.objInfo['cusName'] = formData.cusName
|
|
|
+ formData.objInfo['objectId'] = formData.cusId
|
|
|
+ formData.objInfo['addressFull'] = formData.addressFull
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ formData:JSON.stringify(formData),
|
|
|
+ refundFlag:true,
|
|
|
+ })
|
|
|
+ this.save({})
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 撤回
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于
|
|
|
- */
|
|
|
+ * @desc : 退款
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于
|
|
|
+ */
|
|
|
+ handRefunding(e) {
|
|
|
+ let _this = this
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/package-base-select/pages/select-collection_confirm/select-collection_confirm',
|
|
|
+ events: {
|
|
|
+ // 回调后
|
|
|
+ refresh: function (data) {
|
|
|
+ // 保存成功后 回调
|
|
|
+ wx.navigateBack({
|
|
|
+ data: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit('params', {
|
|
|
+ item: _this.data.formData,
|
|
|
+ formType: 10
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 撤回
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于
|
|
|
+ */
|
|
|
handleWarehousing(e) {
|
|
|
let item = {}
|
|
|
item.outId = this.data.id
|
|
|
@@ -321,12 +486,13 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 设置保存参数
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 设置保存参数
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
setParams(params) {
|
|
|
let itemIndex = 0
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
console.log('params1', params)
|
|
|
params.fromId = params.orderId
|
|
|
params.goodsList.forEach(res => {
|
|
|
@@ -341,16 +507,16 @@ Page({
|
|
|
}
|
|
|
|
|
|
})
|
|
|
-
|
|
|
+ let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
|
|
|
params.flgAutoHandle = btnFormData ? btnFormData.flag : false //自动出库标识
|
|
|
params.itemList = params.goodsList //明细
|
|
|
- if(element.outStatus == Constants.outStatus.outBounded)//""出库状态-已出库"
|
|
|
+ if (formData.outStatus == Constants.outStatus.outBounded) //""出库状态-已出库"
|
|
|
{
|
|
|
params.itemList.forEach(element => {
|
|
|
element.outBox = element.box
|
|
|
element.outPiece = element.piece
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
params.itemList.forEach(element => {
|
|
|
if (params.flgAutoHandle) {
|
|
|
element.outBox = element.box
|
|
|
@@ -358,15 +524,15 @@ Page({
|
|
|
} else {
|
|
|
element.outingBox = element.box
|
|
|
element.outingPiece = element.piece
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
params.makeStaff = app.globalData.user.staffId
|
|
|
// params.deleteItemList = params.deleteList ? params.deleteList : []
|
|
|
- let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
params.addressName = params.address.addressName
|
|
|
params.objectId = params.cusId
|
|
|
params.canNegativeFlag = true
|
|
|
@@ -382,7 +548,14 @@ Page({
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
- saveData() {
|
|
|
+ saveData() {
|
|
|
+ if(this.data.refundFlag){
|
|
|
+ this.setData({
|
|
|
+ refundFlag:false
|
|
|
+ })
|
|
|
+ this.handRefunding()
|
|
|
+ return
|
|
|
+ }
|
|
|
if (this.data.formMode == Constants.formMode.other || this.data.formMode == Constants.formMode.add) { //关联源单新建退货
|
|
|
return this.excute(this.data.service, this.data.service.outboundInsert, this.data.params);
|
|
|
}
|
|
|
@@ -395,10 +568,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 查询商品明细
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 查询商品明细
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
getItemDetal(id, service, API) {
|
|
|
if (!API) {
|
|
|
API = 'getOutReturnForUpdate'
|
|
|
@@ -409,9 +582,10 @@ Page({
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
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"), }
|
|
|
- ]
|
|
|
+ buttonSaveList = [{
|
|
|
+ name: 'merge',
|
|
|
+ title: mixins.$t("handleWithdrawal"),
|
|
|
+ }]
|
|
|
this.setData({
|
|
|
buttonSaveList: buttonSaveList
|
|
|
})
|
|
|
@@ -440,20 +614,19 @@ Page({
|
|
|
formData.goodsList = res.data.data.dataItem
|
|
|
|
|
|
formData.goodsList.forEach(element => {
|
|
|
- if(element.outStatus == Constants.outStatus.outBounded)//""出库状态-已出库"
|
|
|
- {
|
|
|
- element.box = element.outBox
|
|
|
- element.piece = element.outPiece
|
|
|
- }else
|
|
|
- {
|
|
|
- element.box = element.outingBox
|
|
|
- element.piece = element.outingPiece
|
|
|
- }
|
|
|
+ if (element.outStatus == Constants.outStatus.outBounded) //""出库状态-已出库"
|
|
|
+ {
|
|
|
+ element.box = element.outBox
|
|
|
+ element.piece = element.outPiece
|
|
|
+ } else {
|
|
|
+ element.box = element.outingBox
|
|
|
+ element.piece = element.outingPiece
|
|
|
+ }
|
|
|
if (element.flgSubUnit) {
|
|
|
element.calculationFormula = element.packBox + element.unitName + '= 1' + element.subUnitName
|
|
|
element.packageBox = element['outingBox'] + element.subUnitName + element['outingPiece'] + element.unitName
|
|
|
}
|
|
|
- element.sunPrice = element.priceOut * element.itemQty
|
|
|
+ element.sunPrice = element.priceOut * element.itemQty
|
|
|
|
|
|
});
|
|
|
//处理默认值 业务员业务部门
|
|
|
@@ -473,10 +646,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 给表单赋值
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 给表单赋值
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
setValuesByEdit(data) {
|
|
|
let cardList = this.data.cardList
|
|
|
//处理地址
|
|
|
@@ -502,58 +675,155 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 设置表单 为只读状态
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 设置表单 为只读状态
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
setFormMain() {
|
|
|
let contentObj = this.data.contentObj
|
|
|
let cardList = this.data.cardList
|
|
|
let buttonSaveList = this.data.buttonSaveList
|
|
|
let contentSaveList = this.data.contentSaveList
|
|
|
let popContent = this.data.popContent
|
|
|
- contentObj.main = [
|
|
|
- { code: 'cusName', type: 'str', readonly: true, required: false, title: mixins.$t('customerName') },
|
|
|
- { code: 'cusPhone', type: 'str', readonly: true, required: false, title: mixins.$t('cusPhone') },
|
|
|
- { code: 'addressFull', type: 'str', readonly: true, required: false, title: mixins.$t('addressFull') },
|
|
|
- { code: 'addressNo', type: 'str', readonly: true, required: false, title: mixins.$t('addressNo') },
|
|
|
- { code: 'channelName', type: 'str', readonly: true, required: false, title: mixins.$t('saleChannel') },
|
|
|
- { code: 'cusFromName', type: 'str', readonly: true, required: false, title: mixins.$t('customerSource') },
|
|
|
+ contentObj.main = [{
|
|
|
+ code: 'cusName',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('customerName')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'cusPhone',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('cusPhone')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'addressFull',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('addressFull')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'addressNo',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('addressNo')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'channelName',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('saleChannel')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'cusFromName',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('customerSource')
|
|
|
+ },
|
|
|
]
|
|
|
contentObj.relation = [{
|
|
|
- code: 'fromNo',
|
|
|
- type: 'str',
|
|
|
- title: mixins.$t("sourceOrder"),//'关联源单'
|
|
|
- readonly: true,
|
|
|
- }],
|
|
|
- contentObj.other = [
|
|
|
- { code: 'contractNo', type: 'str', readonly: true, required: false, title: mixins.$t('contractNumber') },
|
|
|
-
|
|
|
- { code: 'remarks', type: 'str', readonly: true, required: false, title: mixins.$t('remarks') },
|
|
|
- { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
|
|
|
+ code: 'fromNo',
|
|
|
+ type: 'str',
|
|
|
+ title: mixins.$t("sourceOrder"), //'关联源单'
|
|
|
+ readonly: true,
|
|
|
+ }],
|
|
|
+ contentObj.other = [{
|
|
|
+ code: 'contractNo',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('contractNumber')
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ required: false,
|
|
|
+ title: mixins.$t('remarks')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'file',
|
|
|
+ type: 'uploader',
|
|
|
+ title: mixins.$t("uploader")
|
|
|
+ }
|
|
|
]
|
|
|
- cardList = [
|
|
|
- { name: 'main', title: mixins.$t("customerInformation") },
|
|
|
- { name: 'relation' },
|
|
|
- { name: 'items', title: mixins.$t("goodsDetail"), chooseGoodsFlag: false, itemAmt: '', displayNum: 2 },
|
|
|
- { name: 'other', title: mixins.$t("otherInfo") }
|
|
|
+ cardList = [{
|
|
|
+ name: 'main',
|
|
|
+ title: mixins.$t("customerInformation")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'relation'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'items',
|
|
|
+ title: mixins.$t("goodsDetail"),
|
|
|
+ chooseGoodsFlag: false,
|
|
|
+ itemAmt: '',
|
|
|
+ displayNum: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'other',
|
|
|
+ title: mixins.$t("otherInfo")
|
|
|
+ }
|
|
|
]
|
|
|
//详情(办理)
|
|
|
if (this.data.formMode == Constants.formMode.detail) {
|
|
|
//按钮
|
|
|
- buttonSaveList = [
|
|
|
- { code: 'save', title: mixins.$t("outProcessing") }
|
|
|
- ]
|
|
|
- contentSaveList = [
|
|
|
- { code: 'need', title: mixins.$t("saleCollection"), type: 'str' },
|
|
|
- { code: 'receivable', content: 0, type: 'number' }
|
|
|
+ buttonSaveList = [{
|
|
|
+ code: 'save',
|
|
|
+ title: mixins.$t("outProcessing")
|
|
|
+ }]
|
|
|
+ contentSaveList = [{
|
|
|
+ code: 'need',
|
|
|
+ title: mixins.$t("saleCollection"),
|
|
|
+ type: 'str'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'receivable',
|
|
|
+ content: 0,
|
|
|
+ type: 'number'
|
|
|
+ }
|
|
|
]
|
|
|
- popContent = [
|
|
|
- { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
|
|
|
- { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
|
|
|
- { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
|
|
|
- { code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },
|
|
|
- { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', readonly: true },
|
|
|
+ popContent = [{
|
|
|
+ code: 'outingQty',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("count"),
|
|
|
+ required: true,
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'packageBox',
|
|
|
+ type: 'packageBox',
|
|
|
+ title: mixins.$t("packageBox"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'priceOut',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("priceSale"),
|
|
|
+ required: true,
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'whName',
|
|
|
+ title: mixins.$t("warehouseId"),
|
|
|
+ type: 'str',
|
|
|
+ readonly: true,
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'nonStdCode',
|
|
|
+ title: mixins.$t("goodsBatch"),
|
|
|
+ type: 'str',
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
]
|
|
|
}
|
|
|
this.setData({
|
|
|
@@ -565,10 +835,10 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 处理地址
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 处理地址
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
setAddress(item) {
|
|
|
let address = {
|
|
|
address: item.addressFull,
|
|
|
@@ -581,10 +851,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 计算金额
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2024/1/26 11:46
|
|
|
- */
|
|
|
+ * @desc : 计算金额
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
calculateAmount(formData) {
|
|
|
///设置总单信息
|
|
|
let sumStandard = Number(0)
|
|
|
@@ -624,10 +894,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @desc : 设置顶部默认值
|
|
|
- * @date : 2024/3/28 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 设置顶部默认值
|
|
|
+ * @date : 2024/3/28 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
setStaffOrg(formData) {
|
|
|
formData['staff'] = {
|
|
|
text: formData.staffName ? formData.staffName : app.globalData.user.staffName,
|
|
|
@@ -644,22 +914,23 @@ Page({
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 编辑
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ * @desc : 编辑
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
toEdit() {
|
|
|
let this_ = this
|
|
|
wx.navigateTo({
|
|
|
url: this_.data.route.add.url,
|
|
|
events: {
|
|
|
// 保存成功后刷新页面
|
|
|
- refresh: function (data) {
|
|
|
- }
|
|
|
+ refresh: function (data) {}
|
|
|
},
|
|
|
success: function (res) {
|
|
|
res.eventChannel.emit('params', {
|
|
|
- formMode: Constants.formMode.other, id: this_.data.id, formType: Constants.formMode.edit
|
|
|
+ formMode: Constants.formMode.other,
|
|
|
+ id: this_.data.id,
|
|
|
+ formType: Constants.formMode.edit
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
@@ -681,8 +952,22 @@ Page({
|
|
|
this.setFormMain()
|
|
|
//查询信息
|
|
|
this.getItemDetal(this.data.id)
|
|
|
- } else if (this.data.formMode == Constants.formMode.add) { //新建
|
|
|
+ } else if (this.data.formMode == Constants.formMode.add) { //新建
|
|
|
//处理默认值 业务员业务部门
|
|
|
+ let buttonSaveList = this.data.buttonSaveList
|
|
|
+ //按钮
|
|
|
+ buttonSaveList = [{
|
|
|
+ code: 'refund',
|
|
|
+ title: mixins.$t("refund")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'save',
|
|
|
+ title: mixins.$t("save")
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ this.setData({
|
|
|
+ buttonSaveList: buttonSaveList
|
|
|
+ })
|
|
|
formData = this.setStaffOrg(formData)
|
|
|
const eventChannel = this.getOpenerEventChannel()
|
|
|
eventChannel.on('params', function (data) {
|
|
|
@@ -699,15 +984,42 @@ Page({
|
|
|
|
|
|
if (this.data.formMode == Constants.formMode.other) {
|
|
|
this.setData({
|
|
|
- popContent: [
|
|
|
- { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
|
|
|
- { code: 'packageBox', type: 'packageBox', title: mixins.$t("packageBox"), },
|
|
|
- { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
|
|
|
+ popContent: [{
|
|
|
+ code: 'outingQty',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("count"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'packageBox',
|
|
|
+ type: 'packageBox',
|
|
|
+ title: mixins.$t("packageBox"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
|
|
|
+ code: 'flgGift',
|
|
|
+ title: mixins.$t("flgGift"),
|
|
|
+ type: 'checkbox',
|
|
|
+ readonly: true
|
|
|
},
|
|
|
- { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
|
|
|
- { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', readonly: true },
|
|
|
]
|
|
|
})
|
|
|
|