|
|
@@ -7,7 +7,9 @@
|
|
|
* jyh 2024-03-12 1.00
|
|
|
*******************************************************************************/
|
|
|
const Constants = require('@/utils/Constants.js');
|
|
|
-const mixins = require('@/mixins/index.js')
|
|
|
+const mixins = require('@/mixins/index.js');
|
|
|
+const { outType } = require('@/utils/Constants.js');
|
|
|
+const app = getApp()
|
|
|
Page({
|
|
|
mixins: [mixins],
|
|
|
/**
|
|
|
@@ -51,10 +53,6 @@ Page({
|
|
|
{
|
|
|
code: 'addressFull',
|
|
|
},
|
|
|
- {
|
|
|
- code: 'outDate',
|
|
|
- dataType: 'date'
|
|
|
- },
|
|
|
|
|
|
{
|
|
|
code: 'staffName',
|
|
|
@@ -63,7 +61,7 @@ Page({
|
|
|
code: 'orgName',
|
|
|
},
|
|
|
{
|
|
|
- code: 'supplierName',
|
|
|
+ code: 'supName',
|
|
|
},
|
|
|
],
|
|
|
|
|
|
@@ -149,12 +147,17 @@ Page({
|
|
|
// 弹出按钮
|
|
|
buttonList: [
|
|
|
{
|
|
|
- name: 'customerRefundList',
|
|
|
+ name: 'invaidOrder',
|
|
|
title: mixins.$t('invaidOrder'),
|
|
|
+
|
|
|
}, {
|
|
|
- name: 'customerRefundList',
|
|
|
+ name: 'ticketPirnt',
|
|
|
title: mixins.$t('ticketPirnt'),
|
|
|
}
|
|
|
+ , {
|
|
|
+ name: 'editOrder',
|
|
|
+ title: mixins.$t('edit'),
|
|
|
+ }
|
|
|
],
|
|
|
|
|
|
// 底部保存按钮
|
|
|
@@ -179,6 +182,9 @@ Page({
|
|
|
|
|
|
// 路由
|
|
|
routeObjName: 'outbound',
|
|
|
+ outboundOtherService: app.globalData['outboundOtherService'],
|
|
|
+ outboundProcessingService: app.globalData['outboundProcessingService'],
|
|
|
+ outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
|
|
|
active: 0,
|
|
|
// 主键Id
|
|
|
primaryKey: 'outId',
|
|
|
@@ -212,12 +218,19 @@ Page({
|
|
|
* @author : 姜永辉
|
|
|
*/
|
|
|
setSearchParams(params) {
|
|
|
+ console.log(params);
|
|
|
if (this.data.active == 0) {
|
|
|
//待出库的查询参数
|
|
|
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.outStatus = Constants.outStatus.outBounded
|
|
|
}
|
|
|
return params;
|
|
|
@@ -291,4 +304,101 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : (编辑)
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ editOrder(e) {
|
|
|
+ let item = e
|
|
|
+ let id = item.outId
|
|
|
+ // 销售出库
|
|
|
+ if (item.outType == Constants.outType.sale) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: this.data.route.add.url,
|
|
|
+ events: {
|
|
|
+ // 回调后,在这里给页面赋值
|
|
|
+ bandData: function (e) { }
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ res.eventChannel.emit('params', {
|
|
|
+ id: id,
|
|
|
+ formMode: Constants.formMode.edit
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 其他出库
|
|
|
+ else if (item.outType == Constants.outType.other) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: this.data.route.addOther.url,
|
|
|
+ events: {
|
|
|
+ // 回调后,在这里给页面赋值
|
|
|
+ bandData: function (e) { }
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ res.eventChannel.emit('params', {
|
|
|
+ id: id,
|
|
|
+ formMode: Constants.formMode.edit
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 销售退货
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: this.data.route.addReturn.url,
|
|
|
+ events: {
|
|
|
+ // 回调后,在这里给页面赋值
|
|
|
+ bandData: function (e) { }
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ res.eventChannel.emit('params', {
|
|
|
+ id: id,
|
|
|
+ formMode: Constants.formMode.edit
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 作废
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ invaidOrder(e) {
|
|
|
+ let item = e
|
|
|
+ console.log("invaidOrder", e);
|
|
|
+ let id = item.outId
|
|
|
+ // 销售出库
|
|
|
+ if (item.outType == Constants.outType.sale) {
|
|
|
+ this.excute(this.data.outboundProcessingService, this.data.outboundProcessingService.outboundRepeal + id, null).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.outboundRepeal + id, null).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 销售退货
|
|
|
+ } else {
|
|
|
+ this.excute(this.data.outboundSaleReturnService, this.data.outboundSaleReturnService.outboundRepeal + id, null).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ // 重新查询
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
})
|