|
|
@ -185,6 +185,7 @@ |
|
|
|
<el-form-item label="日期" prop="accountDate"> |
|
|
|
<el-date-picker |
|
|
|
v-model="accountDatelist.accountDate" |
|
|
|
:picker-options="pickerOptions" |
|
|
|
type="date" |
|
|
|
clearable |
|
|
|
placeholder="选择日期" |
|
|
@ -212,6 +213,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", |
|
|
@ -228,6 +230,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: [ |
|
|
@ -467,7 +478,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
save(row) { |
|
|
|
this.formLoading=true; |
|
|
|
this.formLoading = true; |
|
|
|
if (this.formTitle == "撤销出库") { |
|
|
|
this.CancelBills(row); |
|
|
|
} else if (this.formTitle == "创建出库单") { |
|
|
@ -525,14 +536,72 @@ export default { |
|
|
|
type: "warning", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
if (this.accountDatelist != "") { |
|
|
|
this.listOutPutQuery.accountDate = this.accountDatelist.accountDate; |
|
|
|
} |
|
|
|
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/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) { |
|
|
|