|
@@ -3,7 +3,11 @@
|
|
|
<div class="steel_inbound">
|
|
|
<div class="sache">
|
|
|
<span>入库时间:</span>
|
|
|
- <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="startTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
<span>至</span>
|
|
|
<el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
|
|
@@ -22,272 +26,294 @@
|
|
|
</el-button> -->
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
- <dilTable v-bind.sync="options" @selection-change="selectionChange" ref="table">
|
|
|
+ <dilTable
|
|
|
+ v-bind.sync="options"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ ref="table"
|
|
|
+ >
|
|
|
<el-table-column fixed="right" label="操作" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="mini" @click="deleteInbound(scope)">
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="mini" @click="deleteInbound(scope)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</dilTable>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { sjTime } from "@/utils/sharedJsFile";
|
|
|
-import { getCookie } from '@/utils/util.js';
|
|
|
+import { sjTime } from '@/utils/sharedJsFile'
|
|
|
+import { getCookie } from '@/utils/util.js'
|
|
|
export default {
|
|
|
- data(){
|
|
|
- return{
|
|
|
- inputText:"",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ inputText: '',
|
|
|
startTime: null,
|
|
|
endTime: null,
|
|
|
- region: "0",
|
|
|
- options:{
|
|
|
+ region: '0',
|
|
|
+ options: {
|
|
|
// first请求数据的地址
|
|
|
- requestUrl: "/api/v1/wms/getWmsInboundResults?apiId=450&warehouseId="+2,
|
|
|
+ requestUrl:
|
|
|
+ '/api/v1/wms/getWmsInboundResults?apiId=450&warehouseId=' + 2
|
|
|
// selectionType: "select",
|
|
|
// mapList: [],
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- methods:{
|
|
|
- deleteInbound(scope){
|
|
|
- this.$confirm("是否删除", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- center: true,
|
|
|
+ methods: {
|
|
|
+ deleteInbound(scope) {
|
|
|
+ this.$confirm('是否删除', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.axios
|
|
|
- .post("/api/v1/wms/undoInbound?inboundId=" + scope.row.inboundId)
|
|
|
- .then((res) => {
|
|
|
- console.log("res.data.code",res.data.code)
|
|
|
+ .post('/api/v1/wms/undoInbound?inboundId=' + scope.row.inboundId)
|
|
|
+ .then(res => {
|
|
|
+ console.log('res.data.code', res.data.code)
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!",
|
|
|
- });
|
|
|
- this.$router.go(0);
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.$router.go(0)
|
|
|
} else {
|
|
|
this.$message({
|
|
|
- message: "删除失败",
|
|
|
- type: "warning",
|
|
|
- });
|
|
|
+ message: '删除失败',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
- type: "info",
|
|
|
- message: "删除操作已取消!",
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
+ type: 'info',
|
|
|
+ message: '删除操作已取消!'
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
+
|
|
|
// 获取当前月份的最后一天
|
|
|
- getdaysinmonth(year,month){
|
|
|
- month = parseInt(month,10)+1;
|
|
|
- let days = 0;
|
|
|
- month = month -1;
|
|
|
- console.log("othermonth"+month)
|
|
|
- console.log("otheryear"+year);
|
|
|
+ getdaysinmonth(year, month) {
|
|
|
+ month = parseInt(month, 10) + 1
|
|
|
+ let days = 0
|
|
|
+ month = month - 1
|
|
|
+ console.log('othermonth' + month)
|
|
|
+ console.log('otheryear' + year)
|
|
|
// 根据月份获取对应的天数
|
|
|
- if(month == 2){
|
|
|
- days = year % 4 == 0?29:28;
|
|
|
- }else if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
|
|
|
- days = 31;
|
|
|
- }else{
|
|
|
- days = 30;
|
|
|
+ if (month == 2) {
|
|
|
+ days = year % 4 == 0 ? 29 : 28
|
|
|
+ } else if (
|
|
|
+ month == 1 ||
|
|
|
+ month == 3 ||
|
|
|
+ month == 5 ||
|
|
|
+ month == 7 ||
|
|
|
+ month == 8 ||
|
|
|
+ month == 10 ||
|
|
|
+ month == 12
|
|
|
+ ) {
|
|
|
+ days = 31
|
|
|
+ } else {
|
|
|
+ days = 30
|
|
|
}
|
|
|
- console.log("otherdays"+days)
|
|
|
- return days;
|
|
|
+ console.log('otherdays' + days)
|
|
|
+ return days
|
|
|
},
|
|
|
- onclick(){
|
|
|
- let startTime = null;
|
|
|
- let endTime = null;
|
|
|
-
|
|
|
+ onclick() {
|
|
|
+ debugger
|
|
|
+ let startTime = null
|
|
|
+ let endTime = null
|
|
|
// 判断用户有没有班次,有班次则提供默认时间
|
|
|
- if(this.region!=null){
|
|
|
- let date =null;
|
|
|
- let date2 =null;
|
|
|
- let year = null;
|
|
|
- let month =null;
|
|
|
- let day = null;
|
|
|
- let year2 = null;
|
|
|
- let month2 =null;
|
|
|
- let day2 = null;
|
|
|
+ if (this.region != null) {
|
|
|
+ let date = null
|
|
|
+ let date2 = null
|
|
|
+ let year = null
|
|
|
+ let month = null
|
|
|
+ let day = null
|
|
|
+ let year2 = null
|
|
|
+ let month2 = null
|
|
|
+ let day2 = null
|
|
|
// 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
|
|
|
- if(this.startTime!=null){
|
|
|
- date = this.startTime;
|
|
|
- // 判断当前开始时间是标准时间还是字符串时间
|
|
|
-
|
|
|
- year = date.getFullYear(); // 年
|
|
|
- month = date.getMonth() + 1; // 月
|
|
|
- day = date.getDate(); // 日
|
|
|
+ if (this.startTime != null) {
|
|
|
+ date = this.startTime
|
|
|
+ // 判断当前开始时间是标准时间还是字符串时间
|
|
|
+
|
|
|
+ year = date.getFullYear() // 年
|
|
|
+ month = date.getMonth() + 1 // 月
|
|
|
+ day = date.getDate() // 日
|
|
|
}
|
|
|
- if(this.endTime!=null){
|
|
|
- date2 = this.endTime;
|
|
|
- year2 = date2.getFullYear(); // 年
|
|
|
- month2 = date2.getMonth() + 1; // 月
|
|
|
- day2 = date2.getDate(); // 日 // 日
|
|
|
+ if (this.endTime != null) {
|
|
|
+ date2 = this.endTime
|
|
|
+ year2 = date2.getFullYear() // 年
|
|
|
+ month2 = date2.getMonth() + 1 // 月
|
|
|
+ day2 = date2.getDate() // 日 // 日
|
|
|
}
|
|
|
- if(this.startTime==null&&this.endTime==null){
|
|
|
+ if (this.startTime == null && this.endTime == null) {
|
|
|
// 获取当前的日期时间
|
|
|
- date = new Date();
|
|
|
- year = date.getFullYear(); // 年
|
|
|
- month = date.getMonth() + 1; // 月
|
|
|
- day = date.getDate(); // 日
|
|
|
+ date = new Date()
|
|
|
+ year = date.getFullYear() // 年
|
|
|
+ month = date.getMonth() + 1 // 月
|
|
|
+ day = date.getDate() // 日
|
|
|
}
|
|
|
// 判断开始日期和结束日期是否是同一天
|
|
|
- if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
|
|
|
+ if (
|
|
|
+ !(year == year2 && month == month2 && day == day2) &&
|
|
|
+ (this.startTime != null || this.endTime != null) &&
|
|
|
+ this.region == null
|
|
|
+ ) {
|
|
|
// 当不是同一天的时候,直接弹窗警告
|
|
|
- this.startTime = null;
|
|
|
- this.endTime = null;
|
|
|
- this.$message.warning("开始日期和结束日期不是同一天");
|
|
|
+ this.startTime = null
|
|
|
+ this.endTime = null
|
|
|
+ this.$message.warning('开始日期和结束日期不是同一天')
|
|
|
}
|
|
|
// 判断当前用户选择的具体班次
|
|
|
- if(this.region == 0){
|
|
|
- this.startTime = year+"-"+month+"-"+day+" "+"00:00:00";
|
|
|
+ if (this.region == 0) {
|
|
|
+ this.startTime = year + '-' + month + '-' + day + ' ' + '00:00:00'
|
|
|
// 将结束时间加一
|
|
|
- day =parseInt(day) + 1;
|
|
|
- this.endTime = year+"-"+month+"-"+day+" "+"00:00:00";
|
|
|
-
|
|
|
- }else if(this.region == 1){
|
|
|
- this.startTime = year+"-"+month+"-"+day+" "+"07:30:00";
|
|
|
- this.endTime = year+"-"+month+"-"+day+" "+"15:30:00";
|
|
|
- }else if(this.region == 2){
|
|
|
- this.startTime = year+"-"+month+"-"+day+" "+"15:30:00";
|
|
|
- this.endTime = year+"-"+month+"-"+day+" "+"23:30:00";
|
|
|
- }else if(this.region == 3){
|
|
|
- this.endTime = year+"-"+month+"-"+day+" "+"07:30:00";
|
|
|
+ day = parseInt(day) + 1
|
|
|
+ this.endTime = year + '-' + month + '-' + day + ' ' + '00:00:00'
|
|
|
+ } else if (this.region == 1) {
|
|
|
+ this.startTime = year + '-' + month + '-' + day + ' ' + '07:30:00'
|
|
|
+ this.endTime = year + '-' + month + '-' + day + ' ' + '15:30:00'
|
|
|
+ } else if (this.region == 2) {
|
|
|
+ this.startTime = year + '-' + month + '-' + day + ' ' + '15:30:00'
|
|
|
+ this.endTime = year + '-' + month + '-' + day + ' ' + '23:30:00'
|
|
|
+ } else if (this.region == 3) {
|
|
|
+ this.endTime = year + '-' + month + '-' + day + ' ' + '07:30:00'
|
|
|
// 判断开始日期和结束日期是否跨月份了
|
|
|
- if(month!=month2){
|
|
|
- month = parseInt(month)-1
|
|
|
+ if (month != month2) {
|
|
|
+ month = parseInt(month) - 1
|
|
|
// 获取前一个月份的最后一天
|
|
|
- day = this.$options.methods.getdaysinmonth(year,month)
|
|
|
- }else{
|
|
|
+ day = this.$options.methods.getdaysinmonth(year, month)
|
|
|
+ } else {
|
|
|
// 将开始时间减一
|
|
|
- day =parseInt(day)-1;
|
|
|
+ day = parseInt(day) - 1
|
|
|
}
|
|
|
- this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
|
|
|
+ this.startTime = year + '-' + month + '-' + day + ' ' + '23:30:00'
|
|
|
}
|
|
|
this.startTime = new Date(this.startTime)
|
|
|
this.endTime = new Date(this.endTime)
|
|
|
- console.log(this.startTime+"开始时间")
|
|
|
- console.log(this.endTime+"结束时间")
|
|
|
+ console.log(this.startTime + '开始时间')
|
|
|
+ console.log(this.endTime + '结束时间')
|
|
|
// 将拼接好的日期转换为时间戳
|
|
|
startTime = Date.parse(this.startTime)
|
|
|
endTime = Date.parse(this.endTime)
|
|
|
- console.log(startTime+"开始时间2")
|
|
|
- console.log(endTime+"结束时间2")
|
|
|
- }else{
|
|
|
+ console.log(startTime + '开始时间2')
|
|
|
+ console.log(endTime + '结束时间2')
|
|
|
+ } else {
|
|
|
if (this.startTime) {
|
|
|
- startTime = sjTime(this.startTime);
|
|
|
+ startTime = sjTime(this.startTime)
|
|
|
}
|
|
|
if (this.endTime) {
|
|
|
- endTime = sjTime(this.endTime);
|
|
|
+ endTime = sjTime(this.endTime)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// console.log(startTime)
|
|
|
// console.log(endTime)
|
|
|
if (startTime && endTime) {
|
|
|
if (startTime < endTime) {
|
|
|
// if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
|
|
|
- this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=350&warehouseId="+2+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
|
|
|
+ this.options.requestUrl =
|
|
|
+ '/api/v1/wms/getWmsInboundResults?apiId=450&warehouseId=' +
|
|
|
+ 2 +
|
|
|
+ '&startTime=' +
|
|
|
+ startTime +
|
|
|
+ '&endTime=' +
|
|
|
+ endTime +
|
|
|
+ '&i=' +
|
|
|
+ new Date()
|
|
|
// }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
|
|
|
- // this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
|
|
|
+ // this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
|
|
|
// }else{
|
|
|
- // this.options.requestUrl = '/api/v1/wms/getWmsInboundResults?apiId=371&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
|
|
|
+ // this.options.requestUrl = '/api/v1/wms/getWmsInboundResults?apiId=371&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
|
|
|
// }
|
|
|
} else {
|
|
|
- this.startTime = null;
|
|
|
- this.endTime = null;
|
|
|
- this.$message.warning("开始时间要比结束时间早");
|
|
|
+ this.startTime = null
|
|
|
+ this.endTime = null
|
|
|
+ this.$message.warning('开始时间要比结束时间早')
|
|
|
}
|
|
|
} else {
|
|
|
// this.getRequestUrl()
|
|
|
}
|
|
|
},
|
|
|
selectionChange(selection) {
|
|
|
- this.options.mapList = selection;
|
|
|
+ this.options.mapList = selection
|
|
|
},
|
|
|
- onreserved(){
|
|
|
- console.log("fahaahahahaha")
|
|
|
+ onreserved() {
|
|
|
+ console.log('fahaahahahaha')
|
|
|
if (this.options.mapList.length == 0) {
|
|
|
this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "请先选择入库单!",
|
|
|
- });
|
|
|
+ type: 'warning',
|
|
|
+ message: '请先选择入库单!'
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$confirm("是否预留", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- center: true,
|
|
|
+ this.$confirm('是否预留', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
})
|
|
|
.then(() => {
|
|
|
//初始化maplist
|
|
|
- var mapList = [];
|
|
|
+ var mapList = []
|
|
|
this.options.mapList.forEach((item, i) => {
|
|
|
//初始化mapItem
|
|
|
var mapItem = {
|
|
|
//入库实绩表id
|
|
|
inboundId: 0,
|
|
|
// 给一个标记定义其为入库变为预留
|
|
|
- status: 0,
|
|
|
- };
|
|
|
- mapItem.inboundId = item.inboundId;
|
|
|
- mapList.push(mapItem);
|
|
|
- });
|
|
|
+ status: 0
|
|
|
+ }
|
|
|
+ mapItem.inboundId = item.inboundId
|
|
|
+ mapList.push(mapItem)
|
|
|
+ })
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: "预留成功!",
|
|
|
- });
|
|
|
+ type: 'success',
|
|
|
+ message: '预留成功!'
|
|
|
+ })
|
|
|
console.log(mapList)
|
|
|
- this.axios.post("/api/v1/wms/changeReserved", mapList).then((res) => {
|
|
|
- console.log("res.data"+res.data)
|
|
|
+ this.axios.post('/api/v1/wms/changeReserved', mapList).then(res => {
|
|
|
+ console.log('res.data' + res.data)
|
|
|
if (res.data >= 1) {
|
|
|
//改变查询条件
|
|
|
- this.$refs.table.setDataRequestQuery({
|
|
|
-
|
|
|
- });
|
|
|
- this.$router.go(0);
|
|
|
+ this.$refs.table.setDataRequestQuery({})
|
|
|
+ this.$router.go(0)
|
|
|
}
|
|
|
- });
|
|
|
- console.log("fdagfaahh")
|
|
|
+ })
|
|
|
+ console.log('fdagfaahh')
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
- type: "info",
|
|
|
- message: "取消上传!",
|
|
|
- });
|
|
|
- });
|
|
|
+ type: 'info',
|
|
|
+ message: '取消上传!'
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.steel_inbound_real{
|
|
|
- .sache{
|
|
|
- display: flex;
|
|
|
- justify-content: start;
|
|
|
- align-items: center;
|
|
|
- line-height: 40px;
|
|
|
- height: 40px;
|
|
|
- padding-left: 1.875rem;
|
|
|
- .el-select {
|
|
|
+.steel_inbound_real {
|
|
|
+ .sache {
|
|
|
+ display: flex;
|
|
|
+ justify-content: start;
|
|
|
+ align-items: center;
|
|
|
+ line-height: 40px;
|
|
|
+ height: 40px;
|
|
|
+ padding-left: 1.875rem;
|
|
|
+ .el-select {
|
|
|
width: 100%;
|
|
|
.el-input__inner {
|
|
|
width: 150px;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
-</style>
|
|
|
+}
|
|
|
+</style>
|