Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

hejiahui 2 anni fa
parent
commit
1d6c2644cf

+ 3 - 0
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.vue

@@ -23,6 +23,7 @@
       element-loading-spinner="el-icon-loading"
       :isHeigth="isHeigth"
       :shiyHeigth="shiyHeigth"
+      :expand-row-keys="expandRowKeys"
     >
       <!-- 多选列 -->
       <el-table-column
@@ -188,6 +189,8 @@ export default {
     maxHeight: {
       default: '500px'
     },
+    //行展开的key数组,用于控制行是否展开
+    expandRowKeys:[],
     // 是否启用排序
     sortable: {
       default: 'custom'

+ 120 - 2
src/views/WMS/components/port_deposit/loadPortStock.vue

@@ -19,7 +19,7 @@
           font-size: 15px;
           font-weight: bold;
         "
-        >万州港合计吨位</span
+        >万州港合计吨位(截止至:{{now}})</span
       >
       <el-input
         v-model="totalNumber"
@@ -53,7 +53,45 @@
       :shiyHeigth="shiyHeigth"
       @func="func"
       :pageSize="pageSize"
+      :expandRowKeys="expandRowKeys"
     >
+    <el-table-column fixed="right" label="点后出入库详情" width="120">
+          <template slot-scope="scope">
+              <el-button @click="detailclick1(scope.row)" type="text" size="small">
+                入库详情
+              </el-button>
+              <el-button @click="detailclick2(scope.row)" type="text" size="small">
+                出库详情
+              </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" style="margin-left:30%">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="inbounds" border v-show="tableStatus==1">
+                  <el-table-column
+                    v-for="(item, i) in tableHead1"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+                 <el-table :data="outbounds" border v-show="tableStatus==2">
+                 <el-table-column
+                    v-for="(item, i) in tableHead2"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+    </el-table-column>
     </mergeRowTable>
   </div>
 </template>
@@ -76,18 +114,98 @@ export default {
         // 表格请求数据的地址
         requestUrl: "/api/v1/wmsh/getLoadPortStockList?apiId=158",
         comparison:"materialName",
-        columnIndexs:[0,1,2,3]
+        columnIndexs:[0,1,2]
       },
       option2: {
         requestUrl: "/api/v1/wmsh/getLoadPortStockByMaterialName?apiId=493",
       },
+      tableStatus:0,
+      focusRow:null,
+      inbounds:[],
+      outbounds:[],
+      expandRowKeys:[],
+      now:null,
+      tableHead1:[
+        {
+          prop: "resultMaterialNumber",
+          label: "入库吨位",
+          width: 150
+        },
+        {
+          prop: "insertTime",
+          label: "入库时间",
+          width: 150
+        }
+      ],
+      tableHead2:[
+         {
+          prop: "resultMaterialNumber",
+          label: "出库吨位",
+          width: 150
+        },
+        {
+          prop: "wagonNumber",
+          label: "出库车皮数",
+          width: 150
+        },
+        {
+          prop: "insertTime",
+          label: "出库时间",
+          width: 150
+        }
+      ]
     };
   },
   created() {
     this.option.requestUrl =
       "/api/v1/wmsh/getLoadPortStockList?apiId=158&i=" + new Date();
+    let now=new Date();
+    let hour=now.getHours()
+    if(hour>=8 && hour < 18){
+      now.setHours(8);
+    }else{
+      now.setHours(18);
+    }
+    now.setMinutes(0);
+    now.setSeconds(0);
+    this.now=now.toLocaleString();
   },
   methods: {
+    detailclick1(row){
+      console.log("row",row);
+      let flag=this.focusRow==row && this.tableStatus==1;//是否关闭
+       this.axios.post("/api/v1/wmsh/findInboundDetail", row).then(res => {
+        console.log("res", res);
+        this.inbounds = res.data.data;
+        this.expandRowKeys=[];//清空
+      }).then(()=>{
+        this.tableStatus=1;
+        if(!flag){
+          this.$refs.excelDom.toggleRowExpansion(row);
+          this.focusRow=row;
+        }else{
+          this.focusRow=null;
+        }
+      });
+    },
+    detailclick2(row){
+      console.log("row",row);
+      let flag=this.focusRow==row && this.tableStatus==2;
+      console.log(flag);
+      this.axios.post("/api/v1/wmsh/findOutboundDetail", row).then(res => {
+        console.log("res", res);
+        this.outbounds = res.data.data;
+        this.expandRowKeys=[]
+      }).then(()=>{
+        this.tableStatus=2;
+        if(!flag){
+          this.$refs.excelDom.toggleRowExpansion(row);
+          this.focusRow=row;
+        }else{
+          this.focusRow=null;
+        }
+      });
+    },
     func(res) {
       console.log("aaa" + res);
       var resultActualInstallations = 0;