diff --git a/vue/src/router/modules/vw_menu.js b/vue/src/router/modules/vw_menu.js index 6a14b0c1..58157598 100644 --- a/vue/src/router/modules/vw_menu.js +++ b/vue/src/router/modules/vw_menu.js @@ -217,16 +217,16 @@ const vwMenudataRouter = { icon: '供货' } }, - { - path: '/vwsparepart90', - component: () => import('@/views/ux/billManage/sparePart90'), - name: 'SparePart90Report',//命名路由 - meta: { - title: '大众备件调整输出', - roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色) - icon: '工厂' - } - } + // { + // path: '/vwsparepart90', + // component: () => import('@/views/ux/billManage/sparePart90'), + // name: 'SparePart90Report',//命名路由 + // meta: { + // title: '大众备件调整输出', + // roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色) + // icon: '工厂' + // } + // } // { // path: '/bom-diffPrice', // component: () => import('@/views/ux/billManage/BomDiffPrice'), diff --git a/vue/src/views/ux/billManage/kanbanOutOrder/detail.vue b/vue/src/views/ux/billManage/kanbanOutOrder/detail.vue index d9781d47..5c192ca2 100644 --- a/vue/src/views/ux/billManage/kanbanOutOrder/detail.vue +++ b/vue/src/views/ux/billManage/kanbanOutOrder/detail.vue @@ -131,6 +131,7 @@ @@ -157,6 +158,7 @@ import permission from "@/directive/permission/index.js"; import CRMTableHead from "../../components/CRMTableHead"; import { downloadFile } from "@/utils/crmindex.js"; import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; +import moment from "moment"; export default { name: "sendUnsettledDiffReport", @@ -173,6 +175,15 @@ export default { data() { return { crmType: "kanbanOutOrder", + pickerOptions: { + //控制当前月之后不能选择 + disabledDate(time) { + let date = new Date(); + let currentdate = moment(date).format("YYYY-MM"); + var timedate = moment(time).format("YYYY-MM"); + return currentdate < timedate; + }, + }, rules: { //前端定义的规则,后端也有验证 erpMaterialCode: [ @@ -422,13 +433,61 @@ export default { type: "warning", }); return; - } else { - if (this.accountDatelist != "") { - this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; - } - //this.listOutPutQuery.accountDate = this.accountDatelist; - console.log("确认出库条件:" + JSON.stringify(this.listOutPutQuery)); + } + this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + + console.log("确认出库条件:" + JSON.stringify(this.listOutPutQuery)); + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); + // console.log( + // "过账日期:" + + // JSON.stringify(getAccountMonth) + + // "当前日期:" + + // JSON.stringify(currentMonth) + // ); + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Pass", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "生成成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { this.$axios .posts( "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Pass", @@ -450,8 +509,55 @@ export default { .catch(() => { this.formLoading = false; }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", + }); + this.formLoading = false; + return; } }, + // saveBills(row) { + // this.listOutPutQuery.guids = []; + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } else { + // if (this.accountDatelist != "") { + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // } + // //this.listOutPutQuery.accountDate = this.accountDatelist; + // console.log("确认出库条件:" + JSON.stringify(this.listOutPutQuery)); + + // this.$axios + // .posts( + // "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Pass", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "生成成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // }); + // } + // }, //取消出库单 CancelBills(row) { if (this.accountDatelist.accountDate == "") { @@ -477,33 +583,146 @@ export default { this.listOutPutQuery.billNum = this.customerInfo.parentId; this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); //选择的日期 + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); //当前月 + console.log( + "过账日期:" + + JSON.stringify(getAccountMonth) + + "当前日期:" + + JSON.stringify(currentMonth) + ); + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; - this.$axios - .posts( - "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Cancel", - this.listOutPutQuery - ) - .then((response) => { - const index = this.list.indexOf(row); - this.$notify({ - title: "成功", - message: "操作成功", - type: "success", - duration: 2000, - }); - this.accountDatelist.accountDate = ""; - this.dialogFormVisible = false; - this.getList(); - this.formLoading = false; + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - .catch(() => { - this.formLoading = false; - this.$message({ - type: "info", - message: "调用服务出错!", + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", }); + this.formLoading = false; + return; + } }, + // CancelBills(row) { + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } + // var params = []; + // if (row) { + // //单行 + // params.push(row.id); + // } else { + // //多选 + // this.multipleSelection.forEach((element) => { + // let id = element.id; + // params.push(id); + // }); + // } + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.guids = params; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); + + // this.$axios + // .posts( + // "/api/settleaccount/wmskanbanoutput/WmsKanbanOutPut-Cancel", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "操作成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // this.$message({ + // type: "info", + // message: "调用服务出错!", + // }); + // }); + // }, //删除出库单 handleDelete(row) { diff --git a/vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue b/vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue index 84f7755f..d51d5fbe 100644 --- a/vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue +++ b/vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue @@ -185,6 +185,7 @@ { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Pass", + this.listOutPutQuery + ) + .then((res) => { + const index = this.list.indexOf(row); + if (res === "Success") { + this.$notify({ + title: "成功", + message: "确认成功!", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.resultData.errSize = 0; + this.dialogFormVisible = false; + this.resultData.successMessage = "出库成功!"; + this.getList(); + } else { + this.dialogFormVisible = false; + this.resultData.errTemplate = res; //指定错误模板名称,作为参数,用于错误模板下载 + this.resultData.errSize = 1; //保持大于0,用于控制错误数据下载按钮的可不可见 + this.resultData.successMessage = "有错误检验信息!"; + //alert(JSON.stringify(this.resultData)); + } + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { this.$axios .posts( "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Pass", @@ -564,8 +633,69 @@ export default { .catch(() => { this.formLoading = false; }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", + }); + this.formLoading = false; + return; } }, + + // saveBills(row) { + // this.resultData.errSize == 0; //重新弹窗 + // this.listOutPutQuery.guids = []; + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } else { + // if (this.accountDatelist != "") { + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // } + // console.log( + // "无条码看板-全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) + // ); + + // this.$axios + // .posts( + // "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Pass", + // this.listOutPutQuery + // ) + // .then((res) => { + // const index = this.list.indexOf(row); + // if (res === "Success") { + // this.$notify({ + // title: "成功", + // message: "确认成功!", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.resultData.errSize = 0; + // this.dialogFormVisible = false; + // this.resultData.successMessage = "出库成功!"; + // this.getList(); + // } else { + // this.dialogFormVisible = false; + // this.resultData.errTemplate = res; //指定错误模板名称,作为参数,用于错误模板下载 + // this.resultData.errSize = 1; //保持大于0,用于控制错误数据下载按钮的可不可见 + // this.resultData.successMessage = "有错误检验信息!"; + // //alert(JSON.stringify(this.resultData)); + // } + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // }); + // } + // }, + //取消出库单 CancelBills(row) { if (this.accountDatelist.accountDate == "") { @@ -592,32 +722,140 @@ export default { this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); - this.$axios - .posts( - "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Cancel", - this.listOutPutQuery - ) - .then((response) => { - const index = this.list.indexOf(row); - this.$notify({ - title: "成功", - message: "操作成功", - type: "success", - duration: 2000, - }); - this.accountDatelist.accountDate = ""; - this.dialogFormVisible = false; - this.getList(); - this.formLoading = false; + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); //选择的日期 + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); //当前月 + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - .catch(() => { - this.formLoading = false; - this.$message({ - type: "info", - message: "调用服务出错!", + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", }); + this.formLoading = false; + return; + } }, + // CancelBills(row) { + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } + // var params = []; + // if (row) { + // //单行 + // params.push(row.id); + // } else { + // //多选 + // this.multipleSelection.forEach((element) => { + // let id = element.id; + // params.push(id); + // }); + // } + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.guids = params; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); + + // this.$axios + // .posts( + // "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Cancel", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "操作成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // this.$message({ + // type: "info", + // message: "调用服务出错!", + // }); + // }); + // }, //删除出库单 handleDelete(row) { diff --git a/vue/src/views/ux/billManage/sparepartOutOrder/detail.vue b/vue/src/views/ux/billManage/sparepartOutOrder/detail.vue index 26c58410..89d9a069 100644 --- a/vue/src/views/ux/billManage/sparepartOutOrder/detail.vue +++ b/vue/src/views/ux/billManage/sparepartOutOrder/detail.vue @@ -163,6 +163,7 @@ { - this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; - console.log( - "全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) - ); + //this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; this.$axios .posts( @@ -557,8 +562,37 @@ export default { type: "info", message: "已取消操作", }); - this.formLoading = false; + this.formLoading = false; }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPut-Pass", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "生成成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", + }); + this.formLoading = false; + return; } }, //撤销出库 @@ -597,6 +631,7 @@ export default { message: "请选择日期!", type: "warning", }); + this.formLoading = false; return; } var params = []; @@ -616,31 +651,99 @@ export default { this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); - this.$axios - .posts( - "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPut-Cancel", - this.listOutPutQuery - ) - .then((response) => { - const index = this.list.indexOf(row); - this.$notify({ - title: "成功", - message: "操作成功", - type: "success", - duration: 2000, - }); - this.accountDatelist.accountDate = ""; - this.dialogFormVisible = false; - this.getList(); - this.formLoading = false; + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); //选择的日期 + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); //当前月 + console.log( + "过账日期:" + + JSON.stringify(getAccountMonth) + + "当前日期:" + + JSON.stringify(currentMonth) + ); + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - .catch(() => { - this.formLoading = false; - this.$message({ - type: "info", - message: "调用服务出错!", + .then(() => { + //this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + console.log( + "取消出库条件:" + JSON.stringify(this.listOutPutQuery) + ); + + this.$axios + .posts( + "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", }); + this.formLoading = false; + return; + } }, //删除出库单 diff --git a/vue/src/views/ux/billManage/sparepartOutOrder90/detail.vue b/vue/src/views/ux/billManage/sparepartOutOrder90/detail.vue index 3059f1ae..b5472b44 100644 --- a/vue/src/views/ux/billManage/sparepartOutOrder90/detail.vue +++ b/vue/src/views/ux/billManage/sparepartOutOrder90/detail.vue @@ -139,6 +139,7 @@ @@ -165,6 +166,7 @@ import permission from "@/directive/permission/index.js"; import CRMTableHead from "../../components/CRMTableHead"; import { downloadFile } from "@/utils/crmindex.js"; import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; +import moment from "moment"; export default { name: "sendUnsettledDiffReport", @@ -181,6 +183,15 @@ export default { data() { return { crmType: "sparepartOutOrder", + pickerOptions: { + //控制当前月之后不能选择 + disabledDate(time) { + let date = new Date(); + let currentdate = moment(date).format("YYYY-MM"); + var timedate = moment(time).format("YYYY-MM"); + return currentdate < timedate; + }, + }, rules: { //前端定义的规则,后端也有验证 erpMaterialCode: [ @@ -400,16 +411,57 @@ export default { type: "warning", }); return; - //this.getList(); - } else { - if (this.accountDatelist != "") { - this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; - } - //this.listOutPutQuery.accountDate = this.accountDatelist; - console.log( - "全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) - ); + } + this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + + console.log("全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)); + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); + + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Pass", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "生成成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { + this.$axios; this.$axios .posts( "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Pass", @@ -431,8 +483,58 @@ export default { .catch(() => { this.formLoading = false; }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", + }); + this.formLoading = false; + return; } }, + // saveBills(row) { + // this.listOutPutQuery.guids = []; + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // //this.getList(); + // } else { + // if (this.accountDatelist != "") { + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // } + // //this.listOutPutQuery.accountDate = this.accountDatelist; + // console.log( + // "全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) + // ); + + // this.$axios + // .posts( + // "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Pass", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "生成成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // }); + // } + // }, //撤销出库 HandleOutPutCancel() { @@ -490,32 +592,146 @@ export default { this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); - this.$axios - .posts( - "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Cancel", - this.listOutPutQuery - ) - .then((response) => { - const index = this.list.indexOf(row); - this.$notify({ - title: "成功", - message: "操作成功", - type: "success", - duration: 2000, - }); - this.accountDatelist.accountDate = ""; - this.dialogFormVisible = false; - this.getList(); - this.formLoading = false; + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); //选择的日期 + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); //当前月 + + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - .catch(() => { - this.formLoading = false; - this.$message({ - type: "info", - message: "调用服务出错!", + .then(() => { + //this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + console.log( + "取消出库条件:" + JSON.stringify(this.listOutPutQuery) + ); + + this.$axios + .posts( + "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", }); + this.formLoading = false; + return; + } }, + // CancelBills(row) { + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } + // var params = []; + // if (row) { + // //单行 + // params.push(row.id); + // } else { + // //多选 + // this.multipleSelection.forEach((element) => { + // let id = element.id; + // params.push(id); + // }); + // } + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.guids = params; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); + + // this.$axios + // .posts( + // "/api/settleaccount/wmsSharePart90output/WmsSharePartOutPut-Cancel", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "操作成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // this.$message({ + // type: "info", + // message: "调用服务出错!", + // }); + // }); + // }, //删除出库单 handleDelete(row) { diff --git a/vue/src/views/ux/billManage/vwOutOrder/detail.vue b/vue/src/views/ux/billManage/vwOutOrder/detail.vue index faee6aaf..7be8b27b 100644 --- a/vue/src/views/ux/billManage/vwOutOrder/detail.vue +++ b/vue/src/views/ux/billManage/vwOutOrder/detail.vue @@ -131,6 +131,7 @@ @@ -157,6 +158,7 @@ import permission from "@/directive/permission/index.js"; import CRMTableHead from "../../components/CRMTableHead"; import { downloadFile } from "@/utils/crmindex.js"; import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; +import moment from "moment"; export default { name: "sendUnsettledDiffReport", @@ -173,6 +175,15 @@ export default { data() { return { crmType: "vwOutOrder", + pickerOptions: { + //控制当前月之后不能选择 + disabledDate(time) { + let date = new Date(); + let currentdate = moment(date).format("YYYY-MM"); + var timedate = moment(time).format("YYYY-MM"); + return currentdate < timedate; + }, + }, rules: { //前端定义的规则,后端也有验证 erpMaterialCode: [ @@ -389,32 +400,146 @@ export default { this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); - this.$axios - .posts( - "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", - this.listOutPutQuery - ) - .then((response) => { - const index = this.list.indexOf(row); - this.$notify({ - title: "成功", - message: "操作成功", - type: "success", - duration: 2000, - }); - this.accountDatelist.accountDate = ""; - this.dialogFormVisible = false; - this.getList(); - this.formLoading = false; + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); //选择的日期 + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); //当前月 + console.log( + "过账日期:" + + JSON.stringify(getAccountMonth) + + "当前日期:" + + JSON.stringify(currentMonth) + ); + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - .catch(() => { - this.formLoading = false; - this.$message({ - type: "info", - message: "调用服务出错!", + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { + this.$axios + .posts( + "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "操作成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + this.$message({ + type: "info", + message: "调用服务出错!", + }); }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", }); + this.formLoading = false; + return; + } }, + // CancelBills(row) { + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // return; + // } + // var params = []; + // if (row) { + // //单行 + // params.push(row.id); + // } else { + // //多选 + // this.multipleSelection.forEach((element) => { + // let id = element.id; + // params.push(id); + // }); + // } + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.guids = params; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); + + // this.$axios + // .posts( + // "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "操作成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // this.$message({ + // type: "info", + // message: "调用服务出错!", + // }); + // }); + // }, //确认出库单 handleCreateBills() { @@ -436,15 +561,55 @@ export default { }); //this.getList(); return; - } else { - if (this.accountDatelist != "") { - this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; - } - //this.listOutPutQuery.accountDate = this.accountDatelist; - console.log( - "全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) - ); + } + this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + console.log("全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)); + + let myalert = ""; + var getAccountMonth = moment(this.accountDatelist.accountDate).format( + "YYYY-MM" + ); + let date = new Date(); + let currentMonth = moment(date).format("YYYY-MM"); + if (getAccountMonth < currentMonth) { + myalert = "过账日期小于当前月份"; + this.$confirm("是否确认" + myalert + "?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$axios + .posts( + "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", + this.listOutPutQuery + ) + .then((response) => { + const index = this.list.indexOf(row); + this.$notify({ + title: "成功", + message: "生成成功", + type: "success", + duration: 2000, + }); + this.accountDatelist.accountDate = ""; + this.dialogFormVisible = false; + this.getList(); + this.formLoading = false; + }) + .catch(() => { + this.formLoading = false; + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消操作", + }); + this.formLoading = false; + }); + } else if (getAccountMonth === currentMonth) { this.$axios .posts( "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", @@ -466,8 +631,58 @@ export default { .catch(() => { this.formLoading = false; }); + } else { + this.$message({ + type: "warning", + message: "选择的过账日期不能大于当前月份!", + }); + this.formLoading = false; + return; } }, + // saveBills(row) { + // this.listOutPutQuery.guids = []; + // this.listOutPutQuery.version = this.customerInfo.version; + // this.listOutPutQuery.billNum = this.customerInfo.parentId; + // if (this.accountDatelist.accountDate == "") { + // this.$message({ + // message: "请选择日期!", + // type: "warning", + // }); + // //this.getList(); + // return; + // } else { + // if (this.accountDatelist != "") { + // this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; + // } + // //this.listOutPutQuery.accountDate = this.accountDatelist; + // console.log( + // "全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) + // ); + + // this.$axios + // .posts( + // "/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", + // this.listOutPutQuery + // ) + // .then((response) => { + // const index = this.list.indexOf(row); + // this.$notify({ + // title: "成功", + // message: "生成成功", + // type: "success", + // duration: 2000, + // }); + // this.accountDatelist.accountDate = ""; + // this.dialogFormVisible = false; + // this.getList(); + // this.formLoading = false; + // }) + // .catch(() => { + // this.formLoading = false; + // }); + // } + // }, //出库单 handleCreateBills_old(row) { if (this.multipleSelection.length == 0) { diff --git a/vue/src/views/ux/billManage/wmsCusomerKanban/detail.vue b/vue/src/views/ux/billManage/wmsCusomerKanban/detail.vue index 9e77cca6..18c6c58e 100644 --- a/vue/src/views/ux/billManage/wmsCusomerKanban/detail.vue +++ b/vue/src/views/ux/billManage/wmsCusomerKanban/detail.vue @@ -1,4 +1,4 @@ - +