|
@@ -0,0 +1,186 @@
|
|
|
+//真实入库作业
|
|
|
+<template>
|
|
|
+ <div class="steel_inbound">
|
|
|
+ <div class="sache">
|
|
|
+ <span>入库时间:</span>
|
|
|
+ <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <span>至</span>
|
|
|
+ <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-select v-model="region" placeholder="请选择班次">
|
|
|
+ <el-option label="早班" value="1"></el-option>
|
|
|
+ <el-option label="中班" value="2"></el-option>
|
|
|
+ <el-option label="晚班" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" class="btn" @click="onclick">
|
|
|
+ <i class="el-icon-search"></i>查询
|
|
|
+ </el-button>
|
|
|
+ <!-- <el-button type="primary" class="btn" @click="onreserved">
|
|
|
+ 预留
|
|
|
+ </el-button> -->
|
|
|
+ </div>
|
|
|
+ <div class="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="inboundDetails(scope)">
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </dilTable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { sjTime } from "@/utils/sharedJsFile";
|
|
|
+import { getCookie } from '@/utils/util.js';
|
|
|
+export default {
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ inputText:"",
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ region: '',
|
|
|
+ options:{
|
|
|
+ // first请求数据的地址
|
|
|
+ requestUrl: "/api/v1/wms/getWmsInboundResults?apiId=371",
|
|
|
+ // selectionType: "select",
|
|
|
+ // mapList: [],
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ // inboundDetails(scope){
|
|
|
+ // this.$router.push("/inboundDetails/" + scope.row.inboundId)
|
|
|
+ // },
|
|
|
+ onclick(){
|
|
|
+ let startTime = null;
|
|
|
+ let endTime = null;
|
|
|
+
|
|
|
+ // 判断用户有没有班次,有班次则提供默认时间
|
|
|
+ if(this.region!=null){
|
|
|
+ // 获取当前的日期时间
|
|
|
+ let date = new Date();
|
|
|
+ let year = date.getFullYear(); // 年
|
|
|
+ let month = date.getMonth() + 1; // 月
|
|
|
+ let day = date.getDate(); // 日
|
|
|
+ // 判断当前用户选择的具体班次
|
|
|
+ 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 =day-1;
|
|
|
+ this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
|
|
|
+ }
|
|
|
+ // 将拼接好的日期转换为时间戳
|
|
|
+ startTime = Date.parse(new Date(this.startTime))
|
|
|
+ endTime = Date.parse(new Date(this.endTime))
|
|
|
+ console.log(startTime)
|
|
|
+ console.log(endTime)
|
|
|
+ }else{
|
|
|
+ if (this.startTime) {
|
|
|
+ startTime = sjTime(this.startTime);
|
|
|
+ }
|
|
|
+ if (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=371&&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();
|
|
|
+ }else{
|
|
|
+ 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("开始时间要比结束时间早");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // this.getRequestUrl()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectionChange(selection) {
|
|
|
+ this.options.mapList = selection;
|
|
|
+ },
|
|
|
+ onreserved(){
|
|
|
+ console.log("fahaahahahaha")
|
|
|
+ if (this.options.mapList.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请先选择入库单!",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$confirm("是否预留", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ //初始化maplist
|
|
|
+ var mapList = [];
|
|
|
+ this.options.mapList.forEach((item, i) => {
|
|
|
+ //初始化mapItem
|
|
|
+ var mapItem = {
|
|
|
+ //入库实绩表id
|
|
|
+ inboundId: 0,
|
|
|
+ // 给一个标记定义其为入库变为预留
|
|
|
+ status: 0,
|
|
|
+ };
|
|
|
+ mapItem.inboundId = item.inboundId;
|
|
|
+ mapList.push(mapItem);
|
|
|
+ });
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "预留成功!",
|
|
|
+ });
|
|
|
+ console.log(mapList)
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log("fdagfaahh")
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "取消上传!",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scode>
|
|
|
+.steel_inbound{
|
|
|
+ .sache{
|
|
|
+ height: 5rem;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-left: 1.875rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|