|
|
@@ -8,7 +8,6 @@
|
|
|
*******************************************************************************/
|
|
|
const Constants = require('@/utils/Constants.js');
|
|
|
const mixins = require('@/mixins/index.js');
|
|
|
-const { outType } = require('@/utils/Constants.js');
|
|
|
const app = getApp()
|
|
|
Page({
|
|
|
mixins: [mixins],
|
|
|
@@ -18,8 +17,7 @@ Page({
|
|
|
data: {
|
|
|
tagList: [
|
|
|
{ title: mixins.$t('outboundProcessing') },
|
|
|
- { title: mixins.$t('checkouted') }
|
|
|
- ],
|
|
|
+ { title: mixins.$t('checkouted') }],
|
|
|
// 查询条件
|
|
|
searchContent: [{
|
|
|
code: 'makeTime',
|
|
|
@@ -63,6 +61,11 @@ Page({
|
|
|
{
|
|
|
code: 'supName',
|
|
|
},
|
|
|
+ {
|
|
|
+ code: 'flgValid',
|
|
|
+ title: mixins.$t('flgValid'),
|
|
|
+ dataType: 'checkbox'
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
// 列表区(脚部金额)
|
|
|
@@ -73,18 +76,22 @@ Page({
|
|
|
// 列表区(脚部信息)
|
|
|
footerInfo: [{
|
|
|
prefix: mixins.$t('together'),
|
|
|
- name: 'outingQty', title: mixins.$t('piece')
|
|
|
+ name: 'outQty', title: mixins.$t('piece')
|
|
|
}],
|
|
|
// 列表区(内容)
|
|
|
contentList: [],
|
|
|
-
|
|
|
+ // 列表的显示字段
|
|
|
contentObj: {
|
|
|
- '销退出库': [{
|
|
|
- name: 'orderNo',
|
|
|
- title: mixins.$t('orderNo')
|
|
|
+
|
|
|
+ '销售出库': [{
|
|
|
+ name: 'outNo',
|
|
|
+ title: mixins.$t('outOrderNo')
|
|
|
+ }, {
|
|
|
+ name: 'cusPhone',
|
|
|
+ title: mixins.$t('cusPhone')
|
|
|
}, {
|
|
|
name: 'addressFull',
|
|
|
- title: mixins.$t('returnAddress')
|
|
|
+ title: mixins.$t('addressFull')
|
|
|
}, {
|
|
|
name: [{
|
|
|
name: 'orgName',
|
|
|
@@ -93,20 +100,17 @@ Page({
|
|
|
name: 'staffName',
|
|
|
title: mixins.$t('staffId')
|
|
|
}],
|
|
|
- title: mixins.$t('returnInfo')
|
|
|
+ title: mixins.$t('storeInformation')
|
|
|
}, {
|
|
|
name: 'outDate',
|
|
|
title: mixins.$t('outDate')
|
|
|
}],
|
|
|
- '销售出库': [{
|
|
|
+ '采退入库': [{
|
|
|
name: 'outNo',
|
|
|
title: mixins.$t('outOrderNo')
|
|
|
}, {
|
|
|
- name: 'cusPhone',
|
|
|
- title: mixins.$t('cusPhone')
|
|
|
- }, {
|
|
|
name: 'addressFull',
|
|
|
- title: mixins.$t('addressFull')
|
|
|
+ title: mixins.$t('returnAddress')
|
|
|
}, {
|
|
|
name: [{
|
|
|
name: 'orgName',
|
|
|
@@ -115,7 +119,7 @@ Page({
|
|
|
name: 'staffName',
|
|
|
title: mixins.$t('staffId')
|
|
|
}],
|
|
|
- title: mixins.$t('storeInformation')
|
|
|
+ title: mixins.$t('returnInfo')
|
|
|
}, {
|
|
|
name: 'outDate',
|
|
|
title: mixins.$t('outDate')
|
|
|
@@ -185,18 +189,35 @@ Page({
|
|
|
outboundOtherService: app.globalData['outboundOtherService'],
|
|
|
outboundProcessingService: app.globalData['outboundProcessingService'],
|
|
|
outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
|
|
|
+ inboundReturnService: app.globalData['inboundReturnService'],
|
|
|
active: 0,
|
|
|
// 主键Id
|
|
|
primaryKey: 'outId',
|
|
|
},
|
|
|
/**
|
|
|
- * 切换 已出库 未出库
|
|
|
+ * @desc :切换 已出库 未出库
|
|
|
+ * @date : 2024年3月8日
|
|
|
+ * @author : 姜永辉
|
|
|
*/
|
|
|
onChangeTabs(e) {
|
|
|
let index = e.detail.detail.index
|
|
|
this.setData({
|
|
|
active: index,
|
|
|
})
|
|
|
+ let buttonList = this.data.buttonList
|
|
|
+ buttonList = buttonList.filter(item => item.name !== 'returnCancel')
|
|
|
+ console.log();
|
|
|
+ if (index == 1 && buttonList.length == 3) {
|
|
|
+ buttonList.push(
|
|
|
+ {
|
|
|
+ name: 'returnCancel',
|
|
|
+ title: mixins.$t('returnCancel'),
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ buttonList,
|
|
|
+ })
|
|
|
this.searchData()
|
|
|
},
|
|
|
/**
|
|
|
@@ -212,7 +233,31 @@ Page({
|
|
|
res.eventChannel.emit('params', {})
|
|
|
}
|
|
|
})
|
|
|
- },/**
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 跳转明细
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/1/22
|
|
|
+ */
|
|
|
+ toDetail(e) {
|
|
|
+ if (e) {
|
|
|
+ let item = e.detail.item;
|
|
|
+ if (e.detail.item) {
|
|
|
+ let button = {
|
|
|
+ formMode: Constants.formMode.edit
|
|
|
+ }
|
|
|
+ e.detail.item.button = button
|
|
|
+ }
|
|
|
+ // 如果name不传递,默认为edit
|
|
|
+ if (item.outType == Constants.outType.sale || item.outType == Constants.outType.other) {
|
|
|
+ e.detail.name = 'edit'
|
|
|
+ } else {
|
|
|
+ e.detail.name = 'editReturn'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.open(e);
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 设置查询参数
|
|
|
* @date : 2024年3月8日
|
|
|
* @author : 姜永辉
|
|
|
@@ -221,18 +266,15 @@ Page({
|
|
|
console.log(params);
|
|
|
if (this.data.active == 0) {
|
|
|
//待出库的查询参数
|
|
|
+ params.intoStatus = Constants.intoStatus.inBounding
|
|
|
params.outStatus = Constants.outStatus.outBounding
|
|
|
}
|
|
|
if (this.data.active == 1) {
|
|
|
//已出库的查询参数
|
|
|
- if (params.outTypeList == null || params.outTypeList.length == 0) {
|
|
|
- params.outTypeList = [
|
|
|
- Constants.outType.sale,
|
|
|
- Constants.outType.other,
|
|
|
- Constants.outType.purReturn]
|
|
|
- }
|
|
|
+ params.intoStatus = Constants.intoStatus.inBounded
|
|
|
params.outStatus = Constants.outStatus.outBounded
|
|
|
}
|
|
|
+ params.outTypes = params.outTypeList
|
|
|
return params;
|
|
|
},
|
|
|
/**
|
|
|
@@ -241,7 +283,7 @@ Page({
|
|
|
* @author : 姜永辉
|
|
|
*/
|
|
|
getData(params) {
|
|
|
- return this.excute(this.data.service, this.data.service.selectByCond, params);
|
|
|
+ return this.excute(this.data.outboundOtherService, this.data.outboundOtherService.selectOutbound, params);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -304,6 +346,42 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : (撤销)
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ returnCancel(e) {
|
|
|
+ let item = e
|
|
|
+ let id = item.outId
|
|
|
+ // 销售出库
|
|
|
+ if (item.outType == Constants.outType.sale) {
|
|
|
+ this.excute(this.data.outboundProcessingService, this.data.outboundProcessingService.outBoundCancel, item).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 其他出库
|
|
|
+ else if (item.outType == Constants.outType.other) {
|
|
|
+ this.excute(this.data.outboundOtherService, this.data.outboundOtherService.outBoundCancel, item).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 采购退货
|
|
|
+ } else {
|
|
|
+ this.excute(this.data.inboundReturnService, this.data.inboundReturnService.inboundReturnCancel, { intoId: id }).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @desc : (编辑)
|
|
|
@@ -370,7 +448,6 @@ Page({
|
|
|
*/
|
|
|
invaidOrder(e) {
|
|
|
let item = e
|
|
|
- console.log("invaidOrder", e);
|
|
|
let id = item.outId
|
|
|
// 销售出库
|
|
|
if (item.outType == Constants.outType.sale) {
|
|
|
@@ -389,9 +466,9 @@ Page({
|
|
|
this.searchData()
|
|
|
}
|
|
|
})
|
|
|
- // 销售退货
|
|
|
+ // 采购退货
|
|
|
} else {
|
|
|
- this.excute(this.data.outboundSaleReturnService, this.data.outboundSaleReturnService.outboundRepeal + id, null).then(res => {
|
|
|
+ this.excute(this.data.inboundReturnService, this.data.inboundReturnService.cancel, { intoId: id }).then(res => {
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
// 重新查询
|
|
|
this.searchData()
|