Prechádzať zdrojové kódy

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

Tiroble 3 rokov pred
rodič
commit
7d0a9ee5ec

+ 218 - 0
src/views/WMS/components/steel/addSteelInbound.vue

@@ -0,0 +1,218 @@
+<template>
+  <!-- 新增入库转预留作业页面 -->
+  <div class="addCheckWarehouse">
+    <page-title>入库转预留作业</page-title>
+    <div class="material from">
+      <span class="text">物资规格型号:</span>
+      <el-input class="input" v-model="materialName" disabled> </el-input>
+      <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">最大预留件数:</span>
+      <el-input class="input" v-model="max" disabled> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">件数:</span>
+      <el-input class="input" v-model="materialNumber"> </el-input>
+    </div>
+    <!-- 模态窗口 -->
+    <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
+      <div style="margin-bottom: 10px">
+        <el-input
+          placeholder="请输入内容"
+          v-model="input"
+          style="margin-top: 10px; margin-right: 10px; width: 250px"
+          clearable
+        ></el-input>
+        <el-button type="primary" class="btn" @click="onclick(a)">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+      </div>
+      <div v-show="a == 1">
+        <dilTable
+          v-bind.sync="first"
+          @radio-change="currentRadioChange1"
+        ></dilTable>
+      </div>
+      <div v-show="a == 2">
+        <dilTable
+          v-bind.sync="second"
+          @radio-change="currentRadioChange2"
+        ></dilTable>
+      </div>          
+    </el-drawer>
+    <div class="button_box">
+      <el-button @click="onClickCancel">返回</el-button>
+      <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      max:null,
+      disabled:false,
+      //仓库名称
+      warehouseName:null,
+      //物资名称
+      materialName: null,
+      //物资编码
+      materialCode:null,
+      //盘点数量
+      materialNumber:null,
+      //物资id
+      materialId: null,
+      //是否需要打开模态窗口
+      drawer: false,
+      a: 1,
+      direction: "rtl",
+      input: "",
+      first: {
+        requestUrl: "",
+        selectionType: "radio",
+        mapList1: [],
+      },
+      second: {
+          requestUrl: "",
+          selectionType:"radio"
+      }
+    };
+  },
+  watch: {
+    drawer(val) {
+      if (!val) {
+        this.input = null;
+      }
+    },
+  },
+  created() {
+      
+  },
+  methods: {
+    onclick(a) {
+      if (a == 1) {
+        this.first.requestUrl =
+          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
+          this.input;
+      }
+    },
+    ondrawer(num) {
+      this.drawer = true;
+      this.a = num;
+      if(num==1){
+          this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=443&warehouseId="+3+"&status="+1
+      }
+    },
+    // 返回
+    onClickCancel() {
+      this.$router.push("/steel_checkWarehouse");
+    },
+    currentRadioChange1(selection) {
+      console.log(selection);
+      this.materialName = selection.materialName + selection.materialSpecification + '(' + selection.materialModel + ')' ;
+      this.materialId = selection.materialId;
+      this.materialCode = selection.materialCode;
+      this.materialSpecification = selection.materialSpecification;
+      this.materialModel = selection.materialModel;
+      this.max = selection.max;
+    },
+    currentRadioChange2(selection) {
+      this.warehouseId = selection.warehouseId
+      this.warehouseName = selection.warehouseName
+    },
+    // 确认
+    onClickConfirm() {
+      // console.log(this.warehouseId,this.materialCode,this.materialNumber);
+      this.disabled = true
+      this.axios.post("/api/v1/wms/insertReserved?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
+        console.log(res.data)
+          if (res.data.code == "200") {
+            this.$message({
+              message: "预留成功!",
+              type: "success",
+            });
+            this.disabled = false
+            this.onClickCancel()
+            this.$router.go(-1)
+          }else if(res.data.code=="201"){
+            this.$message({
+              message:"预留的数量不正确",
+              type:"faile",
+            })
+          }
+          this.$router.go(-1)
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scope>
+.addCheckWarehouse{
+.contractDetails {
+  width: 100%;
+}
+.from {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 5px;
+  margin-bottom: 20px;
+}
+.warehouse {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  margin-right: 70px;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.material {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.materialNumber {
+    display: flex;
+    justify-content: center;
+    margin-top: 20px;
+    margin-right: 70px;
+    .text {
+        display:inline-block;
+        width: 170px;
+        text-align: right;
+    }
+    .input {
+        width: 250px;
+        margin-right: 20px;
+    }
+}
+.button_box {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100px;
+}
+}
+</style>

+ 218 - 0
src/views/WMS/components/steel/addSteelReserved.vue

@@ -0,0 +1,218 @@
+<template>
+  <!-- 新增预留转入库作业页面 -->
+  <div class="addCheckWarehouse">
+    <page-title>入库转预留作业</page-title>
+    <div class="material from">
+      <span class="text">物资规格型号:</span>
+      <el-input class="input" v-model="materialName" disabled> </el-input>
+      <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">最大预留件数:</span>
+      <el-input class="input" v-model="max" disabled> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">件数:</span>
+      <el-input class="input" v-model="materialNumber"> </el-input>
+    </div>
+    <!-- 模态窗口 -->
+    <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
+      <div style="margin-bottom: 10px">
+        <el-input
+          placeholder="请输入内容"
+          v-model="input"
+          style="margin-top: 10px; margin-right: 10px; width: 250px"
+          clearable
+        ></el-input>
+        <el-button type="primary" class="btn" @click="onclick(a)">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+      </div>
+      <div v-show="a == 1">
+        <dilTable
+          v-bind.sync="first"
+          @radio-change="currentRadioChange1"
+        ></dilTable>
+      </div>
+      <div v-show="a == 2">
+        <dilTable
+          v-bind.sync="second"
+          @radio-change="currentRadioChange2"
+        ></dilTable>
+      </div>          
+    </el-drawer>
+    <div class="button_box">
+      <el-button @click="onClickCancel">返回</el-button>
+      <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      max:null,
+      disabled:false,
+      //仓库名称
+      warehouseName:null,
+      //物资名称
+      materialName: null,
+      //物资编码
+      materialCode:null,
+      //盘点数量
+      materialNumber:null,
+      //物资id
+      materialId: null,
+      //是否需要打开模态窗口
+      drawer: false,
+      a: 1,
+      direction: "rtl",
+      input: "",
+      first: {
+        requestUrl: "",
+        selectionType: "radio",
+        mapList1: [],
+      },
+      second: {
+          requestUrl: "",
+          selectionType:"radio"
+      }
+    };
+  },
+  watch: {
+    drawer(val) {
+      if (!val) {
+        this.input = null;
+      }
+    },
+  },
+  created() {
+      
+  },
+  methods: {
+    onclick(a) {
+      if (a == 1) {
+        this.first.requestUrl =
+          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
+          this.input;
+      }
+    },
+    ondrawer(num) {
+      this.drawer = true;
+      this.a = num;
+      if(num==1){
+          this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=443&warehouseId="+3+"&status="+2
+      }
+    },
+    // 返回
+    onClickCancel() {
+      this.$router.push("/steel_checkWarehouse");
+    },
+    currentRadioChange1(selection) {
+      console.log(selection);
+      this.materialName = selection.materialName + selection.materialSpecification + '(' + selection.materialModel + ')' ;
+      this.materialId = selection.materialId;
+      this.materialCode = selection.materialCode;
+      this.materialSpecification = selection.materialSpecification;
+      this.materialModel = selection.materialModel;
+      this.max = selection.max;
+    },
+    currentRadioChange2(selection) {
+      this.warehouseId = selection.warehouseId
+      this.warehouseName = selection.warehouseName
+    },
+    // 确认
+    onClickConfirm() {
+      // console.log(this.warehouseId,this.materialCode,this.materialNumber);
+      this.disabled = true
+      this.axios.post("/api/v1/wms/insertInbounds?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
+        console.log(res.data)
+          if (res.data.code == "200") {
+            this.$message({
+              message: "入库成功!",
+              type: "success",
+            });
+            this.disabled = false
+            this.onClickCancel()
+            this.$router.go(-1)
+          }else if(res.data.code=="201"){
+            this.$message({
+              message:"入库的数量不正确",
+              type:"faile",
+            })
+          }
+          this.$router.go(-1)
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scope>
+.addCheckWarehouse{
+.contractDetails {
+  width: 100%;
+}
+.from {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 5px;
+  margin-bottom: 20px;
+}
+.warehouse {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  margin-right: 70px;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.material {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.materialNumber {
+    display: flex;
+    justify-content: center;
+    margin-top: 20px;
+    margin-right: 70px;
+    .text {
+        display:inline-block;
+        width: 170px;
+        text-align: right;
+    }
+    .input {
+        width: 250px;
+        margin-right: 20px;
+    }
+}
+.button_box {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100px;
+}
+}
+</style>

+ 49 - 62
src/views/WMS/components/steel/steel_inbound.vue

@@ -2,11 +2,18 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input
+      <!-- <el-input
         placeholder="请输入内容"
         v-model="inputText"
         clearable>
       </el-input>
+       -->
+      <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-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -15,95 +22,75 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options" @selection-change="selectionChange" ref="table">
-        <el-table-column fixed="right" label="操作" width="150">
+      <dilTable v-bind.sync="options" >
+        <!-- <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>
+				</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,
       options:{
         // first请求数据的地址
         requestUrl: "/api/v1/wms/getWmsInboundResult?apiId=371",
-        selectionType: "select",
-        mapList: [],
+        // selectionType: "select",
+        // mapList: [],
       },
     }
   },
   methods:{
-    inboundDetails(scope){
-      	this.$router.push("/inboundDetails/" + scope.row.inboundId)
-      	
-    },
+    // inboundDetails(scope){
+    //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
+    // },
     onclick(){
-      console.log("点击事件");
+
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+      }
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+          }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
+          }else{
+          this.options.requestUrl = '/api/v1/wms/getWmsInboundResult?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: "取消上传!",
-            });
-          });
-      }
+      this.$router.push({
+        path: "/addSteelInbound",
+      });
     }
   }
 }

+ 186 - 0
src/views/WMS/components/steel/steel_inboundReal.vue

@@ -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>

+ 100 - 0
src/views/WMS/components/steel/steel_inboundStatistics.vue

@@ -0,0 +1,100 @@
+//入库
+<template>
+  <div class="steel_inbound">
+    <div class="sache">
+      <!-- <el-input
+        placeholder="请输入内容"
+        v-model="inputText"
+        clearable>
+      </el-input>
+       -->
+      <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-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+    </div>
+    <div class="table">
+      <dilTable v-bind.sync="options" >
+        <!-- <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,
+      options:{
+        // first请求数据的地址
+        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3,
+        // selectionType: "select",
+        // mapList: [],
+      },
+    }
+  },
+  methods:{
+    // inboundDetails(scope){
+    //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
+    // },
+    onclick(){
+
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+      }
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+          }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
+          }else{
+          this.options.requestUrl = '/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&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;
+    },
+  }
+}
+</script>
+
+<style lang="scss" scode>
+.steel_inbound{
+  .sache{
+    height: 5rem;
+    display: flex;
+    align-items: center;
+    padding-left: 1.875rem;
+  }
+}
+</style>

+ 24 - 62
src/views/WMS/components/steel/steel_reserved.vue

@@ -1,4 +1,4 @@
-//查询预留
+//预留转入库
 <template>
   <div class="steel_inbound">
     <div class="sache">
@@ -7,6 +7,13 @@
         v-model="inputText"
         clearable>
       </el-input>
+      
+      <!-- <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-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -15,95 +22,50 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options" @selection-change="selectionChange" ref="table">
-        <el-table-column fixed="right" label="操作" width="150">
+      <dilTable v-bind.sync="options" >
+        <!-- <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>
+				</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,
       options:{
         // first请求数据的地址
         requestUrl: "/api/v1/wms/getWmsReservedResult?apiId=371",
-        selectionType: "select",
-        mapList: [],
+        // selectionType: "select",
+        // mapList: [],
       },
     }
   },
   methods:{
-    inboundDetails(scope){
-      	this.$router.push("/inboundDetails/" + scope.row.inboundId)
-      	
-    },
+    // inboundDetails(scope){
+    //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
+    // },
     onclick(){
-      console.log("点击事件");
+      this.options.requestUrl= "/api/v1/wms/getWmsReservedResult?apiId=371&con="+this.inputText;
     },
     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: 1,
-              };
-              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: "取消上传!",
-            });
-          });
-      }
+      this.$router.push({
+        path: "/addSteelReserved",
+      });
     }
   }
 }

+ 1 - 1
src/views/WMS/components/steel/steel_restackAdd.vue

@@ -196,7 +196,7 @@ export default {
     mounted(){
         this.initialization();
         //新增下拉框方法
-        this.initialization1();
+        // this.initialization1();
     },
      methods: {
         //  创建选择物资型号的方法

+ 6 - 0
src/views/WMS/router/index.js

@@ -27,6 +27,7 @@ import insertTransfer from '../components/steel/insertTransfer.vue'
 import steel_check from '../components/steel/steel_check.vue'
 import steel_close from '../components/steel/steel_close.vue'
 import steel_inbound from '../components/steel/steel_inbound.vue'
+import steel_inboundReal from '../components/steel/steel_inboundReal.vue'
 import steel_reserved from '../components/steel/steel_reserved.vue'
 import steel_outbound from '../components/steel/steel_outbound.vue'
 import steel_real from '../components/steel/steel_real.vue'
@@ -38,6 +39,8 @@ import steel_sendreceive from '../components/steel/steel_sendreceive.vue'
 import steel_transfer from '../components/steel/steel_transfer.vue'
 import steel_checkWarehouse from '../components/steel/checkWarehouse.vue'
 import steel_addCheckWarehouse from '../components/steel/addCheckWarehouse.vue'
+import addSteelInbound from '../components/steel/addSteelInbound.vue'
+import addSteelReserved from '../components/steel/addSteelReserved.vue'
 Vue.use(Router)
 const constantRouterMap = [
 	{
@@ -69,6 +72,7 @@ const constantRouterMap = [
 		{path: 'steel_check', name: 'steel_check', meta: {code: 'xtpzgl-yhgl'}, component: steel_check},
 		{path: 'steel_close', name: 'steel_close', meta: {code: 'xtpzgl-yhgl'}, component: steel_close},
 		{path: 'steel_inbound', name: 'steel_inbound', meta: {code: 'xtpzgl-yhgl'}, component: steel_inbound},
+		{path: 'steel_inboundReal', name: 'steel_inboundReal', meta: {code: 'xtpzgl-yhgl'}, component: steel_inboundReal},
 		{path: 'steel_reserved', name: 'steel_reserved', meta: {code: 'xtpzgl-yhgl'}, component: steel_reserved},
 		{path: 'steel_outbound', name: 'steel_outbound', meta: {code: 'xtpzgl-yhgl'}, component: steel_outbound},
 		{path: 'steel_real', name: 'steel_real', meta: {code: 'xtpzgl-yhgl'}, component: steel_real},
@@ -80,6 +84,8 @@ const constantRouterMap = [
 		{path: 'steel_transfer', name: 'steel_transfer', meta: {code: 'xtpzgl-yhgl'}, component: steel_transfer},
 		{path: 'steel_checkWarehouse', name: 'steel_checkWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: steel_checkWarehouse},
 		{path: 'steel_addCheckWarehouse', name: 'steel_addCheckWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: steel_addCheckWarehouse},
+		{path: 'addSteelInbound', name: 'addSteelInbound', meta: {code: 'xtpzgl-yhgl'}, component: addSteelInbound},
+		{path: 'addSteelReserved', name: 'addSteelReserved', meta: {code: 'xtpzgl-yhgl'}, component: addSteelReserved},
 	  ]
 	}
   ];

+ 43 - 38
src/views/inward/components/inwardFactory/enFactoryResult.vue

@@ -1,47 +1,52 @@
-// 进厂作业
+//进厂
 <template>
-    <div class="sale">
-        <div class="top">
-            <!-- 框计算 -->
-            <el-input
-                placeholder="请输入内容"
-                v-model="inputText"
-                clearable>
-            </el-input>
-            <el-button type="primary" class="btn" @click="onclick">
-                <i class="el-icon-search"></i>查询
-            </el-button>
-        </div>
-        <div class="tab">
-            <dilTable v-bind.sync="option"></dilTable>
-        </div>
+  <!-- 内转运输实绩 -->
+  <div class="homeworkPath">
+    <div class="top">
+      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
+
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
-    data(){
-        return{
-            inputText:'',
-            option: {       
-                // 表格请求数据的地址
-                requestUrl: "/api/v1/tms/getAllEnFactoryResult?apiId=357&orderType=11",
-            },
-        }
+  name: "homeworkPath",
+  data() {
+    return {
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "",
+      },
+    };
+  },
+  created(){
+      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.option.requestUrl = "/api/v1/tms/getAllEnFactoryResult?apiId=357&orderType=11"
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getAllEnFactoryResult?apiId=357&orderType=11&userId=" + getCookie("orgCode")
+      }
+  },
+  methods: {
+    onclick() {
+      this.$message.info("功能暂时关闭")
     },
-    methods:{
-        onclick(){
-            this.option.requestUrl = "/api/v1/tms/getAllEnFactoryResult?apiId=357&orderType=11&con="+this.inputText;
-        }
-    }
-}
+  },
+};
 </script>
-<style lang="scss">
-    .sale{
-        .top{
-            width: 100%;height: 5rem;
-            display: flex;
-            align-items: center;
-            padding-left: 2.5rem;
-        }
+<style lang='scss' scoped>
+.homeworkPath {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input{
+      width: 20%;
     }
+  }
+}
 </style>

+ 43 - 38
src/views/inward/components/inwardFactory/outFactory.vue

@@ -1,47 +1,52 @@
-// 出厂作业
+//出厂
 <template>
-    <div class="sale">
-        <div class="top">
-            <!-- 框计算 -->
-            <el-input
-                placeholder="请输入内容"
-                v-model="inputText"
-                clearable>
-            </el-input>
-            <el-button type="primary" class="btn" @click="onclick">
-                <i class="el-icon-search"></i>查询
-            </el-button>
-        </div>
-        <div class="tab">
-            <dilTable v-bind.sync="option"></dilTable>
-        </div>
+  <!-- 零星物资出厂作业页面 -->
+  <div class="homeworkPath">
+    <div class="top">
+      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
+
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
-    data(){
-        return{
-            inputText:'',
-            option: {       
-                // 表格请求数据的地址
-                requestUrl: "/api/v1/tms/getLeaveFactoryResult?apiId=361&orderType=11",
-            },
-        }
+  name: "homeworkPath",
+  data() {
+    return {
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "",
+      },
+    };
+  },
+  created(){
+      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=361&orderType=11"
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=361&orderType=11&userId=" + getCookie("orgCode")
+      }
+  },
+  methods: {
+    onclick() {
+      this.$message.info("功能暂时关闭")
     },
-    methods:{
-        onclick(){
-            this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=361&orderType=11&con="+this.inputText;
-        }
-    }
-}
+  },
+};
 </script>
-<style lang="scss">
-    .sale{
-        .top{
-            width: 100%;height: 5rem;
-            display: flex;
-            align-items: center;
-            padding-left: 2.5rem;
-        }
+<style lang='scss' scoped>
+.homeworkPath {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input{
+      width: 20%;
     }
+  }
+}
 </style>

+ 43 - 38
src/views/inward/components/inwardFactory/tareWeightResult.vue

@@ -1,47 +1,52 @@
-// 计量作业
+//计皮
 <template>
-    <div class="sale">
-        <div class="top">
-            <!-- 框计算 -->
-            <el-input
-                placeholder="请输入内容"
-                v-model="inputText"
-                clearable>
-            </el-input>
-            <el-button type="primary" class="btn" @click="onclick">
-                <i class="el-icon-search"></i>查询
-            </el-button>
-        </div>
-        <div class="tab">
-            <dilTable v-bind.sync="option"></dilTable>
-        </div>
+  <!-- 零星物资计皮作业页面 -->
+  <div class="homeworkPath">
+    <div class="top">
+      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
+
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
-    data(){
-        return{
-            inputText:'',
-            option: {       
-                // 表格请求数据的地址
-                requestUrl: "/api/v1/tms/getAllJiMaoResult?apiId=358&orderType=11",
-            },
-        }
+  name: "homeworkPath",
+  data() {
+    return {
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "",
+      },
+    };
+  },
+  created(){
+      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.option.requestUrl = "/api/v1/tms/getAllJiMaoResult?apiId=358&orderType=11"
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getAllJiMaoResult?apiId=358&orderType=11&userId=" + getCookie("orgCode")
+      }
+  },
+  methods: {
+    onclick() {
+      this.$message.info("功能暂时关闭")
     },
-    methods:{
-        onclick(){
-            this.option.requestUrl = "/api/v1/tms/getAllJiMaoResult?apiId=358&orderType=11&con="+this.inputText;
-        }
-    }
-}
+  },
+};
 </script>
-<style lang="scss">
-    .sale{
-        .top{
-            width: 100%;height: 5rem;
-            display: flex;
-            align-items: center;
-            padding-left: 2.5rem;
-        }
+<style lang='scss' scoped>
+.homeworkPath {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input{
+      width: 20%;
     }
+  }
+}
 </style>

+ 29 - 84
src/views/inward/components/inwardFactory/truckLoad.vue

@@ -1,107 +1,52 @@
-// 汽车装货
+//装货
 <template>
-  <div class="steel_inbound">
-    <div class="sache">
-      <el-input placeholder="请输入内容" v-model="inputText" clearable>
-      </el-input>
+  <!-- 装货实绩页面 -->
+  <div class="homeworkPath">
+   <div class="top">
+      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" class="btn" @click="toInsert">
-        <i class="el-icon-plus"></i>新增
-      </el-button>
-    </div>
-    <div class="table">
-      <dilTable v-bind.sync="options">
-        <el-table-column fixed="right" label="操作" width="100">
-          <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="updateBmsTrainFreight(scope)"
-            >
-              修改
-            </el-button>
-            <el-button
-              type="text"
-              size="mini"
-              @click="deleteBmsTrainFreight(scope)"
-            >
-              删除
-            </el-button>
-          </template>
-        </el-table-column>
-      </dilTable>
     </div>
+    <dilTable v-bind.sync="option"></dilTable>
   </div>
 </template>
 
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
+  name: "homeworkPath",
   data() {
     return {
-      inputText: "",
-      options: {
-        // first请求数据的地址
-        requestUrl: "/api/v1/tms/getAllLoadResult?apiId=359&orderType=11",
+      restaurants: [],
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "",
       },
     };
   },
+  created(){
+      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=359&orderType=11&status=0"
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getAllLoadResult?apiId=359&orderType=11&status=0&userId=" + getCookie("orgCode")
+      }
+  },
   methods: {
     onclick() {
-      this.option.requestUrl =
-        "/api/v1/tms/getAllLoadResult?apiId=359&orderType=11&con=" +
-        this.inputText;
-    },
-    toInsert() {
-      this.$router.push("/inwardFactoryAddTruckLoad");
+          this.$message.info("功能暂时关闭")
     },
-    updateBmsTrainFreight(scope) {
-      this.$router.push("/updateTruckLoad/" + scope.row.settlementId);
-    },
-    deleteBmsTrainFreight(scope) {
-      this.$confirm("是否删除", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
-        .then(() => {
-          this.$axios
-            .post("/api/v1/bms/deleteTrainSettlement/" + scope.row.settlementId)
-            .then((res) => {
-              if (res.data.code == 200) {
-                this.$message({
-                  type: "success",
-                  message: "删除成功!",
-                });
-                this.$router.go(0);
-              } else {
-                this.$message({
-                  message: "删除失败",
-                  type: "warning",
-                });
-              }
-            });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "删除操作已取消!",
-          });
-        });
-    },
-  },
+   }
 };
 </script>
-
-<style lang="scss">
-.steel_inbound {
-  .sache {
-    height: 5rem;
-    display: flex;
-    align-items: center;
-    padding-left: 1.875rem;
+<style lang='scss' scoped>
+.homeworkPath {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input{
+      width: 20%;
+    }
   }
 }
 </style>

+ 43 - 38
src/views/inward/components/inwardFactory/unload.vue

@@ -1,47 +1,52 @@
-// 卸货作业
+//卸货
 <template>
-    <div class="sale">
-        <div class="top">
-            <!-- 框计算 -->
-            <el-input
-                placeholder="请输入内容"
-                v-model="inputText"
-                clearable>
-            </el-input>
-            <el-button type="primary" class="btn" @click="onclick">
-                <i class="el-icon-search"></i>查询
-            </el-button>
-        </div>
-        <div class="tab">
-            <dilTable v-bind.sync="option"></dilTable>
-        </div>
+  <!-- 卸货卸货实绩页面 -->
+  <div class="homeworkPath">
+   <div class="top">
+      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
     </div>
+    <dilTable v-bind.sync="option"></dilTable>
+  </div>
 </template>
+
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
-    data(){
-        return{
-            inputText:'',
-            option: {       
-                // 表格请求数据的地址
-                requestUrl: "/api/v1/tms/getUnloadResult?apiId=360&orderType=11",
-            },
-        }
+  name: "homeworkPath",
+  data() {
+    return {
+      restaurants: [],
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "",
+      },
+    };
+  },
+  created(){
+      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
+          this.option.requestUrl = "/api/v1/tms/getUnloadResult?apiId=360&orderType=11"
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getUnloadResult?apiId=360&orderType=11&userId=" + getCookie("orgCode")
+      }
+  },
+  methods: {
+    onclick() {
+          this.$message.info("功能暂时关闭")
     },
-    methods:{
-        onclick(){
-            this.option.requestUrl = "/api/v1/tms/getUnloadResult?apiId=360&orderType=11&con="+this.inputText;
-        }
-    }
-}
+   }
+};
 </script>
-<style lang="scss">
-    .sale{
-        .top{
-            width: 100%;height: 5rem;
-            display: flex;
-            align-items: center;
-            padding-left: 2.5rem;
-        }
+<style lang='scss' scoped>
+.homeworkPath {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input{
+      width: 20%;
     }
+  }
+}
 </style>

+ 101 - 2
src/views/inward/components/truckAppoint/addPlan.vue

@@ -30,7 +30,33 @@
 </div>
     <template>
 			<div>		
-			<dilTable v-bind.sync="first" @radio-change="currentRadioChange">
+			<dilTable v-bind.sync="first" @radio-change="currentRadioChange" ref="table">
+            <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial(scope.row)">
+                    物资详情
+                  </el-button>
+                </template>
+              </el-table-column>
+              <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column>
 			</dilTable>
       </div>
 		</template>
@@ -60,10 +86,83 @@ export default {
       },
       numberValidateForm: {
           planTruckNumber: null,
-        }
+      },
+      //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      //记录旧的row对象(已下发)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已下发)
+      oldRowCount1: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop:"loadSequence",
+          label:"装卸货次序",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
+      tableData1: [],
     };
   },
   methods: {
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+    getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        this.tableData = res.data.data
+        console.log(res.data.data)
+      })
+    },
     handleSelect(item){
       this.carrierId = item.carrierId
       item.carrierName = this.state2

+ 356 - 66
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -3,30 +3,6 @@
   <div class="inwardRequirement">
     <page-title>新增需求</page-title>
     <div>
-      <div class="material form">
-        <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label="物资">
-            <el-input v-model="materialName" disabled> </el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-      <div class="materialWeight form">
-        <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label="物资重量">
-            <el-input v-model="materialWeight"> </el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <div class="materialNum form">
-        <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label="物资数量">
-            <el-input v-model="materialNum"></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
       <!-- 用车单位 -->
       <div class="requireUnit form">
        <el-form
@@ -50,29 +26,153 @@
         </el-form-item>
     </el-form>
     </div>
-      <div class="unloadPoint form">
-        <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label="卸车点">
-            <el-input v-model="truckPoint1" disabled> </el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
-          </el-form-item>
-        </el-form>
+      <div class="form-box">
+        <dil-form :formId="300" v-model="form"></dil-form>
       </div>
-      <div class="loadPoint form">
-        <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label="装车点">
-            <el-input v-model="requirementPlatformName" disabled> </el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
-          </el-form-item>
+      <div class="materialDrawer">
+         <el-form
+        :inline="true"
+        class="demo-form-inline"
+        label-width="80px"
+      >
+        <el-form-item label="选择物资">      
+        </el-form-item>
+        <el-form-item > 
+          <el-button type="primary" @click="ondrawer(1)" class="truckBtn"
+          >浏览</el-button>
+        </el-form-item>
         </el-form>
       </div>
-      <div class="form-box">
-        <dil-form :formId="300" v-model="form"></dil-form>
+      
+      <!-- 物资和装卸点以及装卸货次序 -->
+          <div class="swtichTop">
+    <span class="titile">点击浏览选择物资之前请选择物资单位!</span>
+    <div class="switch" v-if="tableData.length > 0">
+      <el-tooltip placement="top">
+        <div slot="content">下面表格已有数据,不能进行更改!!!</div>
+        <el-switch
+          v-model="value"
+          active-text="件数"
+          inactive-text="重量"
+          disabled
+        >
+        </el-switch>
+      </el-tooltip>
+    </div>
+    <div class="switch" v-else>
+      <el-tooltip placement="top">
+        <div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
+        <el-switch v-model="value" active-text="件数" inactive-text="重量">
+        </el-switch>
+      </el-tooltip>
+    </div>
+    </div>
+    <!-- 物资表格 -->
+    <div class="truckListTable">
+    <div class="selectionTable">
+      <el-table
+        :data="tableData"
+        border
+        style="width: 100%"
+        highlight-current-row
+      >
+        <el-table-column
+          v-for="(item, i) in tableTop"
+          :key="i"
+          :prop="item.prop"
+          :label="item.label"
+          align="center"
+          show-overflow-tooltip
+        >
+          <template slot="scope" v-if="item.label !== '件数'">
+            <span>{{ item.label }}</span>
+          </template>
+          <!-- 插入输入框 -->
+          <template slot-scope="scope">
+            <template v-if="item.slot">
+                <!-- 装货点 -->
+               <template v-if="item.prop == 'requirementPlatformName'">
+                <el-input
+                  class="textinput"
+                  v-model="scope.row.requirementPlatformName"
+                  disabled
+                ></el-input>
+              </template>
+                <!-- 卸货点 -->
+               <template v-if="item.prop == 'truckPoint1'">
+                <el-input
+                  class="textinput"
+                  v-model="scope.row.truckPoint1"
+                  disabled
+                ></el-input>
+              </template>
+                <!-- 装卸货优先级 -->
+               <template v-if="item.prop == 'materialPriority'">
+                <el-input
+                  class="textinput"
+                  v-model.number="scope.row.materialPriority"
+                  @input="onInputPriority(scope.row.materialPriority)"
+                ></el-input>
+              </template>
+              <!-- 物资件数 -->
+              <template v-if="item.prop == 'orderMaterialNumber'">
+                <el-input
+                  class="textinput"
+                  v-model.number="scope.row.orderMaterialNumber"
+                  @input="onInputNumber(scope.row.orderMaterialNumber)"
+                ></el-input>
+              </template>
+              <!-- 物资重量 -->
+               <template v-if="item.prop == 'orderMaterialWeight'">
+                <el-input
+                  v-model.number="scope.row.orderMaterialWeight"
+                  @input="onInputWeight(scope.row.orderMaterialWeight)"
+                ></el-input>
+              </template>           
+            </template>
+            <template v-else>
+              <span>{{ scope.row[item.prop] }}</span>
+            </template>
+          </template>
+        </el-table-column>
+        <!-- 操作列 -->
+        <el-table-column fixed="right" label="操作" width="250">
+          <template slot-scope="scope">
+            <el-button type="primary" @click="loadPoint(scope.$index)">装货点</el-button>
+            <el-button type="primary" @click="unloadPoint(scope.$index)">卸货点</el-button>
+            <el-button
+              @click.native.prevent="deleteRow(scope.$index, tableData)"
+              type="text"
+              icon="el-icon-close"
+              size="big"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    </div>
+     <!-- 物资模态框 -->
+    <div class="drawSty">
+      <el-drawer
+      title="选择物资信息"
+      :visible.sync="table"
+      direction="rtl"
+      size="40%"
+      :show-close="false"
+    >
+      <el-input placeholder="请输入内容" v-model="inputMaterial" clearable > </el-input
+      ><el-button type="primary" class="btn" @click="onclickMaterial">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button @click="open">取消</el-button> -->
+      <el-button type="primary" @click="makeSure1">确定</el-button>
+      <div class="tablecls">
+        <!-- 查询所有的物资 -->
+        <dilTable ref="materialTable" v-bind.sync="materialTable" @selection-change="selectionChange" :drawer="aaadrawer">
+        </dilTable>
       </div>
+    </el-drawer>
+    </div>  
       <el-drawer
         :visible.sync="drawer"
         :direction="direction"
@@ -94,12 +194,6 @@
         >
           <i class="el-icon-search"></i>查询
         </el-button>
-        <div v-show="a == 1">
-          <dilTable
-            v-bind.sync="materialTable"
-            @radio-change="currentRadioChange1"
-          ></dilTable>
-        </div>
         <div v-show="a == 2">
           <dilTable
             v-bind.sync="second1"
@@ -135,11 +229,48 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      aaadrawer:false,
+      disabled:false,
+      options: [],
+      value: '',
+      // 件数与重量的开关
+      value: false,
+      //物资模态框开关
+      table: false,
+      //物资表格表头
+      tableTop: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: "140",
+        },
+        {
+          prop: "requirementPlatformName",
+          label: "装货点",
+          slot:true,
+          width: "140",
+        },
+        {
+          prop: "truckPoint1",
+          label: "卸货点",
+          slot:true,
+          width: "140",
+        },
+        {
+          prop: "orderMaterialWeight",
+          label: "重量",
+          slot: true,
+        },
+      ],
+      row: {},
+      //物资表格数据
+      tableData: [],
       materialName: null,
       requirementPlatformName: null,
       materialNum:null,
       materialWeight:null,
       a: 1,
+      index:null,
       direction: "rtl",
       input:null,
       requiremntUnitId: null,
@@ -148,13 +279,15 @@ export default {
       truckPoint: "",
       materialId: null,
       requireUnitName:null,
+      inputMaterial:null,
       shipperId:null,
       truckPoint1: "",
       drawer: false,
+      selectionList1: [],
       form: {},
       materialTable: {
         requestUrl: "",
-        selectionType: "radio",
+        selectionType: "select",
         mapList1: []
       },
       second1: {
@@ -164,6 +297,34 @@ export default {
       }
     };
   },
+  watch: {
+    value() {
+      if (this.value) {
+        console.log(this.value)
+        console.log(this.tableTop.length)
+        this.tableTop.splice(this.tableTop.length - 1, 1);
+        this.tableTop.push({
+          prop: "orderMaterialNumber",
+          label: "件数",
+          slot: true,
+        });
+      } else {
+        this.tableTop.splice(this.tableTop.length - 1, 1);
+        this.tableTop.push({
+          prop: "orderMaterialWeight",
+          label: "重量",
+          slot: true,
+        });
+      }
+    },
+    table(val){
+      if(val){
+        this.aaadrawer = false;
+      }else{
+        this.aaadrawer = true;
+      }
+    }
+  },
   methods: {
      //用车单位弹出层
     handleSelectCarrier(item){    
@@ -187,17 +348,78 @@ export default {
           return (restaurantsCarrier.shipperName.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
         };
       },
+      // 返回选中的物资信息
+    selectionChange(selection) {
+      this.selectionList1 = [];
+      this.selectionList1 = selection;
+    },
+    unloadPoint(index) {
+      console.log(index)
+      this.index= index
+      this.a = 3
+      this.drawer = true;
+    },
+    loadPoint(index) {
+      console.log(index)
+      this.index = index
+      this.a = 4
+      this.drawer = true;
+    },
     //以上是用车单位边输边查搜索
-    ondrawer(num) {
+    ondrawer(num) {   
       if(num==1){
+        this.table = true
         this.materialTable.requestUrl = "/api/v1/uc/queryMaterialByLike?apiId=244&i=" + new Date()
-      }
-      this.drawer = true;
+      }else{
+        this.drawer = true;
+      }  
       this.a = num;
     },
     handleClose(done) {
       done();
     },
+    //删除行
+    deleteRow(index, rows) {
+      console.log(index)
+      console.log("这里")
+      rows.splice(index, 1);
+    },
+     // 返回主界面
+    makeSure1() {
+        this.selectionList1.forEach((e) => {
+          console.log(e.materialModel,e.materialSpecification)
+        if(e.materialSpecification == null){
+          e.materialSpecification = ''
+        }
+        if(e.materialModel == null){
+          e.materialModel = ''
+        }
+        var addmap = {
+          materialName: e.materialName + e.materialSpecification+e.materialModel,
+          materialId: e.materialId,
+        };
+        this.tableData.push(addmap);
+      });
+      this.selectionList1 = [];
+      this.table = false;
+    },
+    refreshTable(){
+      var arr = this.tableData
+      this.tableData = []
+      arr.forEach((e) => {
+        var addmap = {
+          materialName : e.materialName,
+          materialId: e.materialId,
+          requirementPlatformName:e.requirementPlatformName,
+          truckPoint1:e.truckPoint1,
+          requirementPlatformId:e.requirementPlatformId,
+          requirementUnloadUnitId:e.requirementUnloadUnitId,
+          orderMaterialNumber:e.orderMaterialNumber,
+          orderMaterialWeight:e.orderMaterialWeight
+        };
+        this.tableData.push(addmap)        
+      })
+    },
     onclick(a) {
       if(this.input != null){
         if (a == 1) {
@@ -221,28 +443,60 @@ export default {
       }else{
         this.materialName = this.mapList1.materialName + selection.materialSpecification + '(' + selection.materialModel + ')';
       }
-      
       this.materialId = selection.materialId;
     },
     currentRadioChange2(selection) {
-      this.mapList2 = selection;
       if (this.a == 2) {
         this.truckPoint = selection.wareHouseName;
         this.requiremntUnitId = selection.wareHouseId;
       } else if (this.a == 3) {
-        this.requirementUnloadUnitId = selection.wareHouseId;
-        this.truckPoint1 = selection.wareHouseName;
+        console.log(this.tableData[this.index])
+        this.tableData[this.index].requirementUnloadUnitId = selection.wareHouseId;
+        this.tableData[this.index].truckPoint1 = selection.wareHouseName
+        this.refreshTable()
       } else if (this.a == 4) {
-        this.requirementPlatformId = selection.wareHouseId;
-        this.requirementPlatformName = selection.wareHouseName;
+        console.log(this.tableData[this.index])
+        this.tableData[this.index].requirementPlatformId = selection.wareHouseId;
+        this.tableData[this.index].requirementPlatformName = selection.wareHouseName;
+        this.refreshTable()
       }
     },
     // 新增
     makeSure() {
+      console.log(this.tableData)
+      console.log(typeof(this.form.requirementEstimatedDuration))
+      if(this.shipperId == null){
+        this.$message.error("请选择用车单位")
+        return
+      }if(typeof(this.form.requirementEstimatedDuration) == 'undefined'){
+        this.$message.error("请输入预计用车时长")
+        return
+      }if(typeof(this.form.requirementTruckTime) == 'undefined'){
+        this.$message.error("请输入用车时间")
+        return
+      }if(typeof(this.form.requirementType) == 'undefined'){
+        this.$message.error("请选择需求类型")
+        return
+      }if(typeof(this.form.requirementWorkType) == 'undefined'){
+        this.$message.error("请输入费用类别")
+        return
+      }if(this.tableData.length == 0){
+        this.$message.error("请点击浏览选择物资")
+        return
+      }
+      var i=0
+      this.tableData.forEach((e) =>{
+        if(e.requirementPlatformId&&e.requirementUnloadUnitId){
+          i++
+        }  
+      })
+      if(i==0){
+         this.$message.error("请选择装卸点")
+         return
+      }
+      console.log(this.tableData)
+      debugger
       let requiremnet = {
-        materialId: this.materialId,
-        materialWeight: Number(this.materialWeight),
-        materialNumber: Number(this.materialNum),
         requirementEstimatedDuration: this.form.requirementEstimatedDuration,
         requirementOverlimit: this.form.requirementOverlimit,
         requirementTruckTime: sjTime(this.form.requirementTruckTime),
@@ -250,13 +504,10 @@ export default {
         requirementWorkContent: this.form.requirementWorkContent,
         requirementWorkEnvironment: this.form.requirementWorkEnvironment,
         requirementWorkType: this.form.requirementWorkType,
-        requirementUnloadUnitId: this.requirementUnloadUnitId,
-        requirementPlatformId: this.requirementPlatformId,
         requirementShipperId: this.shipperId,
+        mapList:this.tableData,
         orgCode:getCookie("orgCode")
       };
-      console.log(requiremnet);
-      debugger
       this.axios
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
         .then(res => {
@@ -287,6 +538,45 @@ export default {
     margin-top: 5px;
     margin-bottom: 20px;
     }
+  .drawSty{
+  .el-input{
+    width: 240px;
+  }
+}
+.materialDrawer {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  .el-input {
+    width: 320px;
+  }
+  .el-select{
+    width: 320px;
+  }
+  .el-autocomplete{
+    width: 320px;
+  }
+  .el-form {
+    padding: 10px;
+  }
+  .truckBtn{
+    width: 320px;
+  }
+}
+.swtichTop{
+  display: flex;
+  height: 40px;
+  align-content: center;
+  justify-content: center;
+  padding-right:20px ;
+  .titile{
+    color: red;
+    font-size: 14px;
+  }
+  .switch{
+    margin-right: -60px
+  }
+}
   .material {
     display: flex;
     justify-content: center;

+ 256 - 67
src/views/inward/components/truckAppoint/plan.vue

@@ -26,22 +26,14 @@
     </div>
     <template>
       <div>
-        <el-tabs v-model="activeName">
-          <el-tab-pane label="未接收" name="first">
-            <dilTable v-bind.sync="first">
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button type="text" size="mini" @click="receiver(scope)">
-                    接收
-                  </el-button>
-                </template>
-              </el-table-column>
-            </dilTable>
-          </el-tab-pane>
+        <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="未下发" name="second">
-            <dilTable v-bind.sync="second" @selection-change="selectionChange">
+            <dilTable v-bind.sync="second" @selection-change="selectionChange" ref="table1">
               <el-table-column fixed="right" label="操作" width="180">
                 <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial1(scope.row)">
+                    物资详情
+                  </el-button>
                   <el-button type="text" size="mini" @click="updatePlan(scope)">
                     修改
                   </el-button>
@@ -50,26 +42,98 @@
                   </el-button>
                 </template>
               </el-table-column>
+                 <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column>
             </dilTable>
           </el-tab-pane>
           <el-tab-pane label="已下发" name="third">
-            <dilTable v-bind.sync="third">
+            <dilTable v-bind.sync="third" ref="table2">
               <el-table-column
                 fixed="right"
                 align="center"
                 label="操作"
-                width="80"
+                width="180"
               >
                 <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial2(scope.row)">
+                    物资详情
+                  </el-button>
                   <el-button type="text" size="mini" @click="finishPlan(scope)">
                     确认完成
                   </el-button>
                 </template>
               </el-table-column>
+        <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column>
             </dilTable>
           </el-tab-pane>
           <el-tab-pane label="已完成" name="fourth">
-            <dilTable v-bind.sync="fourth" @selection-change="selectionChange">
+            <dilTable v-bind.sync="fourth" @selection-change="selectionChange" ref="table3">
+              <el-table-column
+                fixed="right"
+                align="center"
+                label="操作"
+                width="100"
+              >
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial3(scope.row)">
+                    物资详情
+                  </el-button>
+                </template>
+              </el-table-column>
+        <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column> 
             </dilTable>
           </el-tab-pane>
         </el-tabs>
@@ -84,60 +148,190 @@ export default {
       inputText: "",
       first: {
         // first请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1",
+        requestUrl:"",
       },
       second: {
         // second请求数据的地址
-        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0",
+        requestUrl: "",
         selectionType: "select",
         mapList: [],
       },
       third: {
         // second请求数据的地址
-        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1",
+        requestUrl: "",
       },
       fourth: {
-        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4",
+        requestUrl: "",
       },
-      activeName: "first",
+      activeName: "second",
+      //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      //记录旧的row对象(已下发)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已下发)
+      oldRowCount1: 1,
+      oldRow2: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount2: 1,
+       oldRow3: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount3: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop:"loadSequence",
+          label:"装卸货次序",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
     };
   },
+  created(){
+      this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1",
+      this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0",
+      this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1",
+      this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4"
+  },
   methods: {
-    receiver(scope) {
-      this.$confirm("是否接收", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial2(row) {
+      // 记录重复点击次数
+      if (this.oldRow2 === row) {
+        this.oldRowCount2 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table2.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow2 != "") {
+        if (this.oldRow2 != row) {
+          if (this.oldRowCount2 % 2 === 1) {
+            this.$refs.table2.toggleRowExpansion(this.oldRow2);
+          } else {
+            this.oldRowCount2 = 1;
+          }
+        } else {
+          this.oldRow2 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow2 = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial3(row) {
+      // 记录重复点击次数
+      if (this.oldRow3 === row) {
+        this.oldRowCount3 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table3.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow3 != "") {
+        if (this.oldRow3 != row) {
+          if (this.oldRowCount3 % 2 === 1) {
+            this.$refs.table3.toggleRowExpansion(this.oldRow2);
+          } else {
+            this.oldRowCount3 = 1;
+          }
+        } else {
+          this.oldRow3 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow3 = row;
+      this.getMaterial(row.requirementId);
+    },
+    getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        this.tableData = res.data.data
+        console.log(res.data.data)
       })
-        .then(() => {
-          this.axios
-            .post("/api/v1/ams/receiveRequirement/" + scope.row.requirementId)
-            .then((res) => {
-              if (res.data.code == 200) {
-                this.$message({
-                  type: "success",
-                  message: "接收成功!",
-                });
-                this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&test=1"
-                this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0&test=1"
-                this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&test=1"
-                this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&test=1"
-              } else {
-                this.$message({
-                  message: "接收失败",
-                  type: "warning",
-                });
-              }
-            });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "接收操作已取消!",
-          });
-        });
+    },
+    handleClick(tab, event) {
+      this.getRequestUrl()
+      this.getRequirementMaterial()
+    },
+    getRequestUrl(){
+      this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&i=" + new Date(),
+      this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0" + "&i=" + new Date(),
+      this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1" +  "&i=" + new Date(),
+      this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4" +  "&i=" + new Date()
     },
     selectionChange(selection) {
       this.second.mapList = selection;
@@ -165,10 +359,7 @@ export default {
                   type: "success",
                   message: "已完成该计划!",
                 });
-                this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&test=1"
-                this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0&test=1"
-                this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&test=1"
-                this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&test=1"
+                this.getRequestUrl()
               } else {
                 this.$message({
                   message: "操作失败",
@@ -200,10 +391,7 @@ export default {
                   type: "success",
                   message: "删除成功!",
                 });
-                this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&test=1"
-                this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0&test=1"
-                this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&test=1"
-                this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&test=1"
+                this.getRequestUrl()
               } else {
                 this.$message({
                   message: "删除失败",
@@ -220,6 +408,10 @@ export default {
         });
     },
     Issue() {
+      if(this.second.mapList.length == 0){
+        this.$message.error("选择计划后才能下发")
+        return
+      }
       console.log(this.second.mapList);
       this.$confirm("是否下发", "提示", {
         confirmButtonText: "确定",
@@ -236,10 +428,7 @@ export default {
                   type: "success",
                   message: "下发成功!",
                 });
-                this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&test=1"
-                this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0&test=1"
-                this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&test=1"
-                this.fourth.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&test=1"
+                this.getRequestUrl()
                 this.activeName = 'third'
               } else {
                 this.$message({

+ 162 - 9
src/views/inward/components/truckAppoint/requirement.vue

@@ -26,17 +26,17 @@
     </div>
     <template>
       <div>
-        <el-tabs v-model="activeName">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="未下发" name="first">
-            <dilTable v-bind.sync="first" @selection-change="selectionChange">
-              <el-table-column fixed="right" label="操作" width="100">
+            <dilTable v-bind.sync="first" @selection-change="selectionChange" ref="table1">
+              <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
                   <el-button
                     type="text"
                     size="mini"
-                    @click="updateRequirement(scope)"
+                    @click="getRequirementMaterial1(scope.row)"
                   >
-                    修改
+                    物资详情
                   </el-button>
                   <el-button
                     type="text"
@@ -47,10 +47,60 @@
                   </el-button>
                 </template>
               </el-table-column>
+                      <!-- 物资详情抽屉 -->
+        <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData1" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+        </el-table-column>
             </dilTable>
           </el-tab-pane>
           <el-tab-pane label="已下发" name="second">
-            <dilTable v-bind.sync="second"> </dilTable>
+            <dilTable v-bind.sync="second" ref="table">
+            <el-table-column fixed="right" label="操作" width="80">
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="getRequirementMaterial(scope.row)"
+                  >
+                    物资详情
+                  </el-button>
+                </template>
+              </el-table-column>
+        <!-- 物资详情抽屉 -->
+        <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+        </el-table-column>
+            </dilTable>
           </el-tab-pane>
         </el-tabs>
       </div>
@@ -75,6 +125,47 @@ export default {
         requestUrl:
           "",
       },
+      //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      //记录旧的row对象(已下发)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已下发)
+      oldRowCount1: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
+      tableData1: [
+        {
+          materialCount : 100
+        }
+      ],
       activeName: "first",
     };
   },
@@ -87,7 +178,68 @@ export default {
       this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" + getCookie("orgCode")
     }
   },
+  
   methods: {
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      this.getMaterial(row.requirementId);
+    },
+    handleClick(tab, event) {
+      this.getRequestUrl()
+      this.getRequirementMaterial()      
+    },
+    getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        this.tableData = res.data.data
+        this.tableData1 = res.data.data
+        console.log(res.data.data)
+      })
+    },
     getRequestUrl(){
       if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"){
       this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" + new Date()
@@ -100,9 +252,6 @@ export default {
     selectionChange(selection) {
       this.first.mapList = selection;
     },
-    toInsert() {
-      this.$router.push("/addRequirement");
-    },
     toInsert2() {
       this.$router.push("/addRequirement2");
     },
@@ -147,6 +296,10 @@ export default {
     },
     Issue() {
       console.log(this.first.mapList);
+      if(this.first.mapList.length == 0){
+        this.$message.warning("请选择需求")
+        return
+      }
       this.$confirm("是否下发", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 150 - 45
src/views/inward/components/truckOrder/decomposePlan.vue

@@ -2,8 +2,34 @@
 <template>
 	<div class="desomposePlan">
 		<page-title>分解计划</page-title>
-        <dilTable v-bind.sync="first" >
-		</dilTable>
+        <dilTable v-bind.sync="first" ref="table">
+          <el-table-column fixed="right" label="操作" width="100">
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial(scope.row)">
+                    物资详情
+                  </el-button>
+                </template>
+              </el-table-column>
+              <!-- 物资详情抽屉 -->
+            <el-table-column type="expand" width="1">
+            <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData1" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column> 
+		    </dilTable>
     <div class="form-box">
         <el-form :inline="true" class="demo-form-inline" :label-position="left"  label-width="80px">
           <el-form-item label="选择路线">
@@ -16,6 +42,9 @@
     </div>
      <div class="box-form">
         <dil-form :formId="318" v-model="form"></dil-form>
+    </div>
+    <div class="capacityButton">
+      <el-button type="primary" class="truckBtn" @click="drawerCapacity()">浏览车牌号</el-button>
     </div>
      <el-drawer
       :visible.sync="linedrawer"
@@ -35,19 +64,15 @@
       :before-close="handleClose"
       size="30%"
     >
-      <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-right: 10px;width:250px;" clearable> </el-input>
+      <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-right: 10px;width:150px;" clearable> </el-input>
       <el-button type="primary" class="btn" @click="onclick()"  style="margin-bottom:15px">
         <i class="el-icon-search"></i>查询
       </el-button>
-   <dilTable v-bind.sync="second" @radio-change="currentRadioChange" ></dilTable>    
+      <el-button type="primary" class="btn" @click="onConfirm()"  style="margin-bottom:15px">
+        <i class="el-icon-search"></i>确认
+      </el-button>
+   <dilTable v-bind.sync="second" @selection-change="currentRadioChange" ></dilTable>    
     </el-drawer>
-		<div style="margin-left:0.625rem">
-			<vxe-toolbar>
-				<template #buttons>
-					<vxe-button icon="fa fa-plus" @click="insertEvent()">新增</vxe-button>
-				</template>
-			</vxe-toolbar>
-		</div>
 		<vxe-table v-model="tableData" keep-source border resizable show-overflow show-footer ref="xTable"
 			max-height="400" :footer-method="footerMethod" :data="tableData"
 			:edit-config="{trigger: 'click', mode: 'cell', showStatus: true}"
@@ -65,7 +90,7 @@
       <vxe-input v-model="row.requirementNo" type="text" disabled></vxe-input>
       </template>
 			</vxe-table-column>
-			<vxe-table-column field="materialName" title="物资名称"
+			<!-- <vxe-table-column field="materialName" title="物资名称"
 			
 			>
       <template #edit="{ row }">
@@ -85,7 +110,7 @@
        <template #edit="{ row }">
       <vxe-input v-model="row.materialNumber" type="text" ></vxe-input>
       </template>       
-			</vxe-table-column>
+			</vxe-table-column> -->
        <vxe-table-column field="capacityNumber" title="车牌号"
 				:edit-render="{}"
 				>
@@ -95,7 +120,6 @@
 			</vxe-table-column>
 		    <vxe-column title="操作" width="200">
             <template #default="{ row }">
-              <vxe-button status="primary" @click="drawerCapacity(row)">选择车牌</vxe-button>
               <vxe-button status="danger" @click="removeRow(row)">删除</vxe-button>
             </template>
           </vxe-column>
@@ -116,35 +140,70 @@ export default {
   },
   data() {
     return {
+      lineId:null,
+      requirementId:null,
+      capacityNumber:null,
       userCarrierId:null,
       lineName:null,
       linedrawer:false,
       tableData:[],
       direction: "rtl",
       input:'',
-      selectRow:null,
+      selectRow:null, 
       drawer:false,
-      purchaseOrderNo:"",
       planNo:"",
       requirementNo:"",
-      materialName:"",
-      materialWeight:null,
-      materialNumber:null,
       carrierId:null,
       form: {},
       first:{
        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId="+this.$route.params.planId,
       },
       second:{
-        requestUrl:"/api/v1/oms/getCapacityAndDriverList?apiId=246&carrierId=" + '',
-        selectionType: "radio",
+        requestUrl:"/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" + null,
+        selectionType: "select",
         mapList1:[]
       },
       zero:{
         requestUrl:"/api/v1/rms/getAllLineDesk?apiId=249",
         selectionType: "radio",
         mapList0:[]
-      }
+      },
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop:"loadSequence",
+          label:"装卸货次序",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData1: [],
     };
   },
   created(){
@@ -155,11 +214,48 @@ export default {
       this.information()
   },
   methods: {
-    drawerCapacity(row){ 
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+     getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        console.log(res.data.data);
+        this.tableData1 = res.data.data
+      })
+    },
+    drawerCapacity(){ 
       this.drawer = true;
-      this.selectRow = row
-      console.log(row.purchaseOrderNo)
-      console.log(this.second.requestUrl)
+    },
+    onConfirm(){
+      console.log(this.mapList1)
+      this.drawer = false
+      this.mapList1.forEach((e) => {
+          console.log((e.capacityNumber))
+          this.capacityNumber = e.capacityNumber
+          this.insertEvent()
+      })
     },
     drawerLine(){
       this.linedrawer = true
@@ -173,11 +269,12 @@ export default {
     },
     currentRadioChange(selection){
       this.mapList1=selection,
-      this.selectRow.capacityNumber = this.mapList1.capacityNumber
+      console.log(this.mapList1)
     },
     currentRadioChange1(selection){
       this.mapList0=selection
       this.lineName = this.mapList0.lineName
+      this.lineId = this.mapList0.lineId
       console.log(this.mapList0.lineId)
     },
    handleClose(done){
@@ -197,26 +294,26 @@ export default {
           "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId=" + this.$route.params.planId
         )
         .then((res) => {
-            console.log(res)
-            const planRow = res.data.data.list
-            this.purchaseOrderNo = planRow[0].purchaseOrderNo,
+            console.log(res.data.data)
+            var planRow = res.data.data.list
             this.requirementNo = planRow[0].requirementNumber,
             this.planNo = planRow[0].planNumber,
-            this.materialName = planRow[0].materialName,
-            this.materialWeight = planRow[0].materialWeight,
-            this.materialNumber = planRow[0].materialNumber,
-            this.carrierId = planRow[0].carrierId
+            this.carrierId = planRow[0].carrierId,
+            this.requirementId = planRow[0].requirementId
+            console.log(this.requirementId)
+            this.axios.post("/api/v1/ams/getRequirementMaterial/" + this.requirementId).then((res) => {
+                console.log(res.data.data);
+                this.tableData1 = res.data.data
+      })    
         });
     },
-    async insertEvent (row) {
+    async insertEvent (row,) {
               const $table = this.$refs.xTable
               const record = {
-                purchaseOrderNo: this.purchaseOrderNo,
                 requirementNo:this.requirementNo,
                 planNo:this.planNo,
-                materialName:this.materialName,
-                materialWeight:this.materialWeight - (this.sumNum(this.$refs.xTable.getInsertRecords(), 'materialWeight')),
-                materialNumber:this.materialNumber - (this.sumNum(this.$refs.xTable.getInsertRecords(), 'materialNumber'))          
+                capacityNumber:this.capacityNumber,
+                orderMaterialList:this.tableData1,   
               }
               const { row: newRow } = await $table.insertAt(record, row)
               await $table.setActiveCell(newRow, 'name')
@@ -228,11 +325,7 @@ export default {
             },
     // 修改
     makeSure() {
-      if(this.mapList0.lineId == null){
-        this.$alert('没有选择运输路线,请选择!')
-        console.log(this.lineId)
-        return
-      }else if(typeof(this.form.orderType) == 'undefined'){
+      if(typeof(this.form.orderType) == 'undefined'){
         this.$alert('没有选择订单类型,请选择')
         return
       }
@@ -244,12 +337,13 @@ export default {
       }
       let BmsTrainFreight = {
           planId:this.$route.params.planId,
-          lineId:this.mapList0.lineId,
+          lineId:this.lineId,
           orderType:this.form.orderType,
           carrierId:this.carrierId,
           mapList:this.$refs.xTable.getInsertRecords()
       };
       console.log(BmsTrainFreight)
+      debugger
       this.axios
         .post("/api/v1/oms/addInwardOrder", BmsTrainFreight)
         .then((res) => {
@@ -294,6 +388,17 @@ export default {
     display: flex;
   }
 }
+.capacityButton {
+  // width: 800px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-left: 150px;
+  .truckBtn {
+    width: 300px;
+  }
+  
+}
 .button-box{
   display: flex;
   justify-content: center;

+ 120 - 56
src/views/inward/components/truckOrder/dispatchPlan.vue

@@ -7,23 +7,44 @@
       <el-button type="primary" class="btn">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="dispatch"
-        v-if="activeName == 'first'"
-      >
-        <i class="el-icon-download"></i>分派</el-button
-      >
     </div>
     <template>
       <div>
         <el-tabs v-model="activeName" @tab-click="handleClick">
-          <el-tab-pane label="未分派" name="first">
-            <dilTable v-bind.sync="first" @selection-change="selectionChange">
+          <el-tab-pane label="待接收" name="first">
+            <dilTable v-bind.sync="first" ref="table">
+              <el-table-column fixed="right" label="操作" width="180">
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial(scope.row)">
+                    物资详情
+                  </el-button>
+                  <el-button type="text" size="mini" @click="updatePlan(scope)">
+                    修改
+                  </el-button>
+                </template>
+              </el-table-column>
+                 <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column>
             </dilTable>
           </el-tab-pane>
-          <el-tab-pane label="已分派" name="second">
+          <el-tab-pane label="已接收" name="second">
             <dilTable v-bind.sync="second"> </dilTable>
           </el-tab-pane>
         </el-tabs>
@@ -39,63 +60,106 @@ export default {
       inputText: "",
       userCarrierId:'',
       first: {
-        // first请求数据的地址
-        requestUrl:
-        "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=" + '',
-        selectionType: "select",
-        mapList: [],
-      },
-      second: {
-        // second请求数据的地址
+        // 
         requestUrl:
           "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + '',
       },
       activeName: "first",
+      second: {
+        requestUrl:""
+      },
+       tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop:"loadSequence",
+          label:"装卸货次序",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
+       //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
     };
   },
   created(){
-      this.userCarrierId = getCookie('userId'),
-      this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3"
-      this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4"
+      if(getCookie("orgCode") == "chengyunshang"){
+          this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + getCookie("userId") 
+          this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=5&carrierId=" + getCookie("userId")
+      }else{
+          this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4"
+          this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=5"
+      }
   },
   methods: {
-    selectionChange(selection) { 
-      this.first.mapList = selection
+    getRequest(){
+      if(getCookie("orgCode") == "chengyunshang"){
+          this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + getCookie("userId") + new Date()
+          this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=5&carrierId=" + getCookie("userId") + new Date()
+      }else{
+          this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4"
+          this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=5"
+      }
+      
     },
-    dispatch() {
-      if(this.first.mapList.length == 0){
-          this.$alert('请选择订单')
-          return
+    handleClick(){
+      this.getRequirementMaterial()
+    },
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
       }
-      this.$confirm("是否分派", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+     getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        this.tableData = res.data.data
+        console.log(res.data.data)
       })
-        .then(() => {
-          this.axios
-            .post("/api/v1/oms/apportionInwardOrder", this.first.mapList)
-            .then((res) => {
-              if (res.data.code == 200) {
-                this.$message({
-                  type: "success",
-                  message: "分派成功!",
-                });
-              } else {
-                this.$message({
-                  message: "分派失败",
-                  type: "warning",
-                });
-              }
-            });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "分派操作已取消!",
-          });
-        });
     },
     deletePlan(scope) {
       this.$confirm("是否删除", "提示", {

+ 182 - 27
src/views/inward/components/truckOrder/plan.vue

@@ -11,21 +11,14 @@
     <template>
       <div>
         <el-tabs v-model="activeName" @tab-click="handleClick">
-          <el-tab-pane label="未接收" name="first">
-            <dilTable v-bind.sync="first">
-              <el-table-column fixed="right" label="操作" width="50">
+          
+          <el-tab-pane label="待分解" name="second">
+            <dilTable v-bind.sync="second" ref="table1">
+              <el-table-column fixed="right" label="操作" width="100">
                 <template slot-scope="scope">
-                  <el-button type="text" size="mini" @click="receiver(scope)">
-                    接收
+                  <el-button type="text" size="mini" @click="getRequirementMaterial1(scope.row)">
+                    物资详情
                   </el-button>
-                </template>
-              </el-table-column>
-            </dilTable>
-          </el-tab-pane>
-          <el-tab-pane label="已接收" name="second">
-            <dilTable v-bind.sync="second">
-              <el-table-column fixed="right" label="操作" width="50">
-                <template slot-scope="scope">
                   <el-button
                     type="text"
                     size="mini"
@@ -35,17 +28,55 @@
                   </el-button>
                 </template>
               </el-table-column>
+          <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column> 
             </dilTable>
           </el-tab-pane>
           <el-tab-pane label="已分解" name="third">
-            <dilTable v-bind.sync="third">
-              <el-button
-                type="text"
-                size="mini"
-                @click="getdesponsePlan(scope)"
-              >
-                查看
-              </el-button>
+            <dilTable v-bind.sync="third" ref="table2">
+             <el-table-column fixed="right" label="操作" width="100">
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getRequirementMaterial2(scope.row)">
+                    物资详情
+                  </el-button>
+                </template>
+              </el-table-column>
+          <!-- 物资详情抽屉 -->
+          <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+          </el-table-column> 
             </dilTable>
           </el-tab-pane>
         </el-tabs>
@@ -60,22 +91,63 @@ export default {
     return {
       inputText: "",
       carrierId:40,
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount1: 1,
+       oldRow2: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount2: 1,
       first: {
         // first请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" + ''
+        requestUrl:"",
       },
       second: {
         // second请求数据的地址
         requestUrl:
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" + ''
+          "" 
       },
       third: {
         // second请求数据的地址
         requestUrl:
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" + '' 
+          "" 
       },
-      activeName: "first",
+      activeName: "second",
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop:"loadName",
+          label:"装货点",
+          width:150
+        },
+        {
+          prop:"unloadName",
+          label:"卸货点",
+          width:150
+        },
+        {
+          prop:"loadSequence",
+          label:"装卸货次序",
+          width:150
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
     };
   },
   created(){
@@ -83,9 +155,92 @@ export default {
       this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1"
       this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2"
       this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3"
-      console.log(this.carrierId)
   },
   methods: {
+    getRequirementMaterial(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      this.getMaterial(row.requirementId);
+    },
+    getRequirementMaterial2(row) {
+      // 记录重复点击次数
+      if (this.oldRow2 === row) {
+        this.oldRowCount2 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table2.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow2 != "") {
+        if (this.oldRow2 != row) {
+          if (this.oldRowCount2 % 2 === 1) {
+            this.$refs.table2.toggleRowExpansion(this.oldRow2);
+          } else {
+            this.oldRowCount2 = 1;
+          }
+        } else {
+          this.oldRow2 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow2 = row;
+      this.getMaterial(row.requirementId);
+    },
+    getMaterial(requirementId){
+      console.log(requirementId)
+      this.axios.post("/api/v1/ams/getRequirementMaterial/" + requirementId).then((res) => {
+        this.tableData = res.data.data
+        console.log(res.data.data)
+      })
+    },
+     handleClick(tab, event) {
+      console.log("zhix")
+      this.getRequestUrl()
+      this.getRequirementMaterial()
+    },
     getRequestUrl(){
       this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&i=" + new Date()
       this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&i="  + new Date()

+ 0 - 7
src/views/sale/components/transport_appointment/directionalDispatch.vue

@@ -145,7 +145,6 @@ export default {
         selectionType: "radio",
         mapList: [],
       },
-
       //记录旧的row对象(未下发)
       oldRow: "",
       //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
@@ -170,11 +169,6 @@ export default {
           label: "物资数量(件数/重量)",
           width: 150,
         },
-        // {
-        //   prop: "materialWeight",
-        //   label: "物资重量",
-        //   width: 100,
-        // },
       ],
       tableData: [],
       tableData1: [],
@@ -273,7 +267,6 @@ export default {
       }
       
     },
-
     // -------查看物资详情(未下发)
     detailclick(row) {
       // 记录重复点击次数