Your Name 3 years ago
parent
commit
1d44b2a701

+ 2 - 2
build/utils.js

@@ -15,9 +15,9 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-let devModules = ['all']
+// let devModules = ['all']
 // let devModules = ['index','inward','SporadicManage','RMS','statisticalReport','TMS'];
 // let devModules = ['index','inward','SporadicManage','RMS','statisticalReport','TMS'];
-// let devModules = ['index','inward','TMS']
+let devModules = ['index','inward']
 // let devModules = ['index','SporadicManage','TMS','statisticalReport','RMS'];
 // let devModules = ['index','SporadicManage','TMS','statisticalReport','RMS'];
 // let devModules = ['index','appoint','TMS'];
 // let devModules = ['index','appoint','TMS'];
 if (pathSrc.indexOf('node_modules') > -1) {
 if (pathSrc.indexOf('node_modules') > -1) {

+ 2 - 2
config/index.js

@@ -64,8 +64,8 @@ let proxyTable = {
   },
   },
   // 所有数据的请求域名地址
   // 所有数据的请求域名地址
   "/api/v1": {
   "/api/v1": {
-     target: "http://172.16.33.166:8080",
-  //  target: "http://192.168.1.119:8019",
+    //  target: "http://172.16.33.166:8080",
+   target: "http://192.168.1.104:8019",
     // target: "http://192.168.1.114:8019",
     // target: "http://192.168.1.114:8019",
     ws: true,
     ws: true,
     pathRewrite: {
     pathRewrite: {

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

@@ -1,47 +1,52 @@
-// 进厂作业
+//进厂
 <template>
 <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>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
 </template>
+
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 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>
 </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>
 </style>

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

@@ -1,47 +1,52 @@
-// 出厂作业
+//出厂
 <template>
 <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>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
 </template>
+
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 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>
 </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>
 </style>

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

@@ -1,47 +1,52 @@
-// 计量作业
+//计皮
 <template>
 <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>
     </div>
+    <dilTable v-bind.sync="option">      
+    </dilTable>
+  </div>
 </template>
 </template>
+
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 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>
 </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>
 </style>

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

@@ -1,107 +1,52 @@
-// 汽车装货
+//装货
 <template>
 <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">
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
         <i class="el-icon-search"></i>查询
       </el-button>
       </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>
     </div>
+    <dilTable v-bind.sync="option"></dilTable>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 export default {
+  name: "homeworkPath",
   data() {
   data() {
     return {
     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: {
   methods: {
     onclick() {
     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>
 </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>
 </style>

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

@@ -1,47 +1,52 @@
-// 卸货作业
+//卸货
 <template>
 <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>
     </div>
+    <dilTable v-bind.sync="option"></dilTable>
+  </div>
 </template>
 </template>
+
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 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>
 </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>
 </style>

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

@@ -30,7 +30,33 @@
 </div>
 </div>
     <template>
     <template>
 			<div>		
 			<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>
 			</dilTable>
       </div>
       </div>
 		</template>
 		</template>
@@ -60,10 +86,83 @@ export default {
       },
       },
       numberValidateForm: {
       numberValidateForm: {
           planTruckNumber: null,
           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: {
   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){
     handleSelect(item){
       this.carrierId = item.carrierId
       this.carrierId = item.carrierId
       item.carrierName = this.state2
       item.carrierName = this.state2

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

@@ -3,30 +3,6 @@
   <div class="inwardRequirement">
   <div class="inwardRequirement">
     <page-title>新增需求</page-title>
     <page-title>新增需求</page-title>
     <div>
     <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">
       <div class="requireUnit form">
        <el-form
        <el-form
@@ -50,29 +26,153 @@
         </el-form-item>
         </el-form-item>
     </el-form>
     </el-form>
     </div>
     </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>
-      <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>
         </el-form>
       </div>
       </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>
       </div>
+    </el-drawer>
+    </div>  
       <el-drawer
       <el-drawer
         :visible.sync="drawer"
         :visible.sync="drawer"
         :direction="direction"
         :direction="direction"
@@ -94,12 +194,6 @@
         >
         >
           <i class="el-icon-search"></i>查询
           <i class="el-icon-search"></i>查询
         </el-button>
         </el-button>
-        <div v-show="a == 1">
-          <dilTable
-            v-bind.sync="materialTable"
-            @radio-change="currentRadioChange1"
-          ></dilTable>
-        </div>
         <div v-show="a == 2">
         <div v-show="a == 2">
           <dilTable
           <dilTable
             v-bind.sync="second1"
             v-bind.sync="second1"
@@ -135,11 +229,48 @@ export default {
   components: { PageTitle },
   components: { PageTitle },
   data() {
   data() {
     return {
     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,
       materialName: null,
       requirementPlatformName: null,
       requirementPlatformName: null,
       materialNum:null,
       materialNum:null,
       materialWeight:null,
       materialWeight:null,
       a: 1,
       a: 1,
+      index:null,
       direction: "rtl",
       direction: "rtl",
       input:null,
       input:null,
       requiremntUnitId: null,
       requiremntUnitId: null,
@@ -148,13 +279,15 @@ export default {
       truckPoint: "",
       truckPoint: "",
       materialId: null,
       materialId: null,
       requireUnitName:null,
       requireUnitName:null,
+      inputMaterial:null,
       shipperId:null,
       shipperId:null,
       truckPoint1: "",
       truckPoint1: "",
       drawer: false,
       drawer: false,
+      selectionList1: [],
       form: {},
       form: {},
       materialTable: {
       materialTable: {
         requestUrl: "",
         requestUrl: "",
-        selectionType: "radio",
+        selectionType: "select",
         mapList1: []
         mapList1: []
       },
       },
       second1: {
       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: {
   methods: {
      //用车单位弹出层
      //用车单位弹出层
     handleSelectCarrier(item){    
     handleSelectCarrier(item){    
@@ -187,17 +348,78 @@ export default {
           return (restaurantsCarrier.shipperName.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
           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){
       if(num==1){
+        this.table = true
         this.materialTable.requestUrl = "/api/v1/uc/queryMaterialByLike?apiId=244&i=" + new Date()
         this.materialTable.requestUrl = "/api/v1/uc/queryMaterialByLike?apiId=244&i=" + new Date()
-      }
-      this.drawer = true;
+      }else{
+        this.drawer = true;
+      }  
       this.a = num;
       this.a = num;
     },
     },
     handleClose(done) {
     handleClose(done) {
       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) {
     onclick(a) {
       if(this.input != null){
       if(this.input != null){
         if (a == 1) {
         if (a == 1) {
@@ -221,28 +443,60 @@ export default {
       }else{
       }else{
         this.materialName = this.mapList1.materialName + selection.materialSpecification + '(' + selection.materialModel + ')';
         this.materialName = this.mapList1.materialName + selection.materialSpecification + '(' + selection.materialModel + ')';
       }
       }
-      
       this.materialId = selection.materialId;
       this.materialId = selection.materialId;
     },
     },
     currentRadioChange2(selection) {
     currentRadioChange2(selection) {
-      this.mapList2 = selection;
       if (this.a == 2) {
       if (this.a == 2) {
         this.truckPoint = selection.wareHouseName;
         this.truckPoint = selection.wareHouseName;
         this.requiremntUnitId = selection.wareHouseId;
         this.requiremntUnitId = selection.wareHouseId;
       } else if (this.a == 3) {
       } 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) {
       } 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() {
     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 = {
       let requiremnet = {
-        materialId: this.materialId,
-        materialWeight: Number(this.materialWeight),
-        materialNumber: Number(this.materialNum),
         requirementEstimatedDuration: this.form.requirementEstimatedDuration,
         requirementEstimatedDuration: this.form.requirementEstimatedDuration,
         requirementOverlimit: this.form.requirementOverlimit,
         requirementOverlimit: this.form.requirementOverlimit,
         requirementTruckTime: sjTime(this.form.requirementTruckTime),
         requirementTruckTime: sjTime(this.form.requirementTruckTime),
@@ -250,13 +504,10 @@ export default {
         requirementWorkContent: this.form.requirementWorkContent,
         requirementWorkContent: this.form.requirementWorkContent,
         requirementWorkEnvironment: this.form.requirementWorkEnvironment,
         requirementWorkEnvironment: this.form.requirementWorkEnvironment,
         requirementWorkType: this.form.requirementWorkType,
         requirementWorkType: this.form.requirementWorkType,
-        requirementUnloadUnitId: this.requirementUnloadUnitId,
-        requirementPlatformId: this.requirementPlatformId,
         requirementShipperId: this.shipperId,
         requirementShipperId: this.shipperId,
+        mapList:this.tableData,
         orgCode:getCookie("orgCode")
         orgCode:getCookie("orgCode")
       };
       };
-      console.log(requiremnet);
-      debugger
       this.axios
       this.axios
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
         .then(res => {
         .then(res => {
@@ -287,6 +538,45 @@ export default {
     margin-top: 5px;
     margin-top: 5px;
     margin-bottom: 20px;
     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 {
   .material {
     display: flex;
     display: flex;
     justify-content: center;
     justify-content: center;

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

@@ -26,22 +26,14 @@
     </div>
     </div>
     <template>
     <template>
       <div>
       <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">
           <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">
               <el-table-column fixed="right" label="操作" width="180">
                 <template slot-scope="scope">
                 <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 type="text" size="mini" @click="updatePlan(scope)">
                     修改
                     修改
                   </el-button>
                   </el-button>
@@ -50,26 +42,98 @@
                   </el-button>
                   </el-button>
                 </template>
                 </template>
               </el-table-column>
               </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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane label="已下发" name="third">
           <el-tab-pane label="已下发" name="third">
-            <dilTable v-bind.sync="third">
+            <dilTable v-bind.sync="third" ref="table2">
               <el-table-column
               <el-table-column
                 fixed="right"
                 fixed="right"
                 align="center"
                 align="center"
                 label="操作"
                 label="操作"
-                width="80"
+                width="180"
               >
               >
                 <template slot-scope="scope">
                 <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 type="text" size="mini" @click="finishPlan(scope)">
                     确认完成
                     确认完成
                   </el-button>
                   </el-button>
                 </template>
                 </template>
               </el-table-column>
               </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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane label="已完成" name="fourth">
           <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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
         </el-tabs>
         </el-tabs>
@@ -84,60 +148,190 @@ export default {
       inputText: "",
       inputText: "",
       first: {
       first: {
         // first请求数据的地址
         // first请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1",
+        requestUrl:"",
       },
       },
       second: {
       second: {
         // second请求数据的地址
         // second请求数据的地址
-        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=257&planStatus=0",
+        requestUrl: "",
         selectionType: "select",
         selectionType: "select",
         mapList: [],
         mapList: [],
       },
       },
       third: {
       third: {
         // second请求数据的地址
         // second请求数据的地址
-        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1",
+        requestUrl: "",
       },
       },
       fourth: {
       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: {
   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) {
     selectionChange(selection) {
       this.second.mapList = selection;
       this.second.mapList = selection;
@@ -165,10 +359,7 @@ export default {
                   type: "success",
                   type: "success",
                   message: "已完成该计划!",
                   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 {
               } else {
                 this.$message({
                 this.$message({
                   message: "操作失败",
                   message: "操作失败",
@@ -200,10 +391,7 @@ export default {
                   type: "success",
                   type: "success",
                   message: "删除成功!",
                   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 {
               } else {
                 this.$message({
                 this.$message({
                   message: "删除失败",
                   message: "删除失败",
@@ -220,6 +408,10 @@ export default {
         });
         });
     },
     },
     Issue() {
     Issue() {
+      if(this.second.mapList.length == 0){
+        this.$message.error("选择计划后才能下发")
+        return
+      }
       console.log(this.second.mapList);
       console.log(this.second.mapList);
       this.$confirm("是否下发", "提示", {
       this.$confirm("是否下发", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
@@ -236,10 +428,7 @@ export default {
                   type: "success",
                   type: "success",
                   message: "下发成功!",
                   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'
                 this.activeName = 'third'
               } else {
               } else {
                 this.$message({
                 this.$message({

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

@@ -26,17 +26,17 @@
     </div>
     </div>
     <template>
     <template>
       <div>
       <div>
-        <el-tabs v-model="activeName">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="未下发" name="first">
           <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">
                 <template slot-scope="scope">
                   <el-button
                   <el-button
                     type="text"
                     type="text"
                     size="mini"
                     size="mini"
-                    @click="updateRequirement(scope)"
+                    @click="getRequirementMaterial1(scope.row)"
                   >
                   >
-                    修改
+                    物资详情
                   </el-button>
                   </el-button>
                   <el-button
                   <el-button
                     type="text"
                     type="text"
@@ -47,10 +47,60 @@
                   </el-button>
                   </el-button>
                 </template>
                 </template>
               </el-table-column>
               </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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane label="已下发" name="second">
           <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-tab-pane>
         </el-tabs>
         </el-tabs>
       </div>
       </div>
@@ -75,6 +125,47 @@ export default {
         requestUrl:
         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",
       activeName: "first",
     };
     };
   },
   },
@@ -87,7 +178,68 @@ export default {
       this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" + getCookie("orgCode")
       this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" + getCookie("orgCode")
     }
     }
   },
   },
+  
   methods: {
   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(){
     getRequestUrl(){
       if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"){
       if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"){
       this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" + new Date()
       this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" + new Date()
@@ -100,9 +252,6 @@ export default {
     selectionChange(selection) {
     selectionChange(selection) {
       this.first.mapList = selection;
       this.first.mapList = selection;
     },
     },
-    toInsert() {
-      this.$router.push("/addRequirement");
-    },
     toInsert2() {
     toInsert2() {
       this.$router.push("/addRequirement2");
       this.$router.push("/addRequirement2");
     },
     },
@@ -147,6 +296,10 @@ export default {
     },
     },
     Issue() {
     Issue() {
       console.log(this.first.mapList);
       console.log(this.first.mapList);
+      if(this.first.mapList.length == 0){
+        this.$message.warning("请选择需求")
+        return
+      }
       this.$confirm("是否下发", "提示", {
       this.$confirm("是否下发", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",

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

@@ -2,8 +2,34 @@
 <template>
 <template>
 	<div class="desomposePlan">
 	<div class="desomposePlan">
 		<page-title>分解计划</page-title>
 		<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">
     <div class="form-box">
         <el-form :inline="true" class="demo-form-inline" :label-position="left"  label-width="80px">
         <el-form :inline="true" class="demo-form-inline" :label-position="left"  label-width="80px">
           <el-form-item label="选择路线">
           <el-form-item label="选择路线">
@@ -16,6 +42,9 @@
     </div>
     </div>
      <div class="box-form">
      <div class="box-form">
         <dil-form :formId="318" v-model="form"></dil-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>
     </div>
      <el-drawer
      <el-drawer
       :visible.sync="linedrawer"
       :visible.sync="linedrawer"
@@ -35,19 +64,15 @@
       :before-close="handleClose"
       :before-close="handleClose"
       size="30%"
       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">
       <el-button type="primary" class="btn" @click="onclick()"  style="margin-bottom:15px">
         <i class="el-icon-search"></i>查询
         <i class="el-icon-search"></i>查询
       </el-button>
       </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>
     </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"
 		<vxe-table v-model="tableData" keep-source border resizable show-overflow show-footer ref="xTable"
 			max-height="400" :footer-method="footerMethod" :data="tableData"
 			max-height="400" :footer-method="footerMethod" :data="tableData"
 			:edit-config="{trigger: 'click', mode: 'cell', showStatus: true}"
 			:edit-config="{trigger: 'click', mode: 'cell', showStatus: true}"
@@ -65,7 +90,7 @@
       <vxe-input v-model="row.requirementNo" type="text" disabled></vxe-input>
       <vxe-input v-model="row.requirementNo" type="text" disabled></vxe-input>
       </template>
       </template>
 			</vxe-table-column>
 			</vxe-table-column>
-			<vxe-table-column field="materialName" title="物资名称"
+			<!-- <vxe-table-column field="materialName" title="物资名称"
 			
 			
 			>
 			>
       <template #edit="{ row }">
       <template #edit="{ row }">
@@ -85,7 +110,7 @@
        <template #edit="{ row }">
        <template #edit="{ row }">
       <vxe-input v-model="row.materialNumber" type="text" ></vxe-input>
       <vxe-input v-model="row.materialNumber" type="text" ></vxe-input>
       </template>       
       </template>       
-			</vxe-table-column>
+			</vxe-table-column> -->
        <vxe-table-column field="capacityNumber" title="车牌号"
        <vxe-table-column field="capacityNumber" title="车牌号"
 				:edit-render="{}"
 				:edit-render="{}"
 				>
 				>
@@ -95,7 +120,6 @@
 			</vxe-table-column>
 			</vxe-table-column>
 		    <vxe-column title="操作" width="200">
 		    <vxe-column title="操作" width="200">
             <template #default="{ row }">
             <template #default="{ row }">
-              <vxe-button status="primary" @click="drawerCapacity(row)">选择车牌</vxe-button>
               <vxe-button status="danger" @click="removeRow(row)">删除</vxe-button>
               <vxe-button status="danger" @click="removeRow(row)">删除</vxe-button>
             </template>
             </template>
           </vxe-column>
           </vxe-column>
@@ -116,35 +140,70 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      lineId:null,
+      requirementId:null,
+      capacityNumber:null,
       userCarrierId:null,
       userCarrierId:null,
       lineName:null,
       lineName:null,
       linedrawer:false,
       linedrawer:false,
       tableData:[],
       tableData:[],
       direction: "rtl",
       direction: "rtl",
       input:'',
       input:'',
-      selectRow:null,
+      selectRow:null, 
       drawer:false,
       drawer:false,
-      purchaseOrderNo:"",
       planNo:"",
       planNo:"",
       requirementNo:"",
       requirementNo:"",
-      materialName:"",
-      materialWeight:null,
-      materialNumber:null,
       carrierId:null,
       carrierId:null,
       form: {},
       form: {},
       first:{
       first:{
        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId="+this.$route.params.planId,
        requestUrl: "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId="+this.$route.params.planId,
       },
       },
       second:{
       second:{
-        requestUrl:"/api/v1/oms/getCapacityAndDriverList?apiId=246&carrierId=" + '',
-        selectionType: "radio",
+        requestUrl:"/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" + null,
+        selectionType: "select",
         mapList1:[]
         mapList1:[]
       },
       },
       zero:{
       zero:{
         requestUrl:"/api/v1/rms/getAllLineDesk?apiId=249",
         requestUrl:"/api/v1/rms/getAllLineDesk?apiId=249",
         selectionType: "radio",
         selectionType: "radio",
         mapList0:[]
         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(){
   created(){
@@ -155,11 +214,48 @@ export default {
       this.information()
       this.information()
   },
   },
   methods: {
   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.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(){
     drawerLine(){
       this.linedrawer = true
       this.linedrawer = true
@@ -173,11 +269,12 @@ export default {
     },
     },
     currentRadioChange(selection){
     currentRadioChange(selection){
       this.mapList1=selection,
       this.mapList1=selection,
-      this.selectRow.capacityNumber = this.mapList1.capacityNumber
+      console.log(this.mapList1)
     },
     },
     currentRadioChange1(selection){
     currentRadioChange1(selection){
       this.mapList0=selection
       this.mapList0=selection
       this.lineName = this.mapList0.lineName
       this.lineName = this.mapList0.lineName
+      this.lineId = this.mapList0.lineId
       console.log(this.mapList0.lineId)
       console.log(this.mapList0.lineId)
     },
     },
    handleClose(done){
    handleClose(done){
@@ -197,26 +294,26 @@ export default {
           "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId=" + this.$route.params.planId
           "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&planId=" + this.$route.params.planId
         )
         )
         .then((res) => {
         .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.requirementNo = planRow[0].requirementNumber,
             this.planNo = planRow[0].planNumber,
             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 $table = this.$refs.xTable
               const record = {
               const record = {
-                purchaseOrderNo: this.purchaseOrderNo,
                 requirementNo:this.requirementNo,
                 requirementNo:this.requirementNo,
                 planNo:this.planNo,
                 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)
               const { row: newRow } = await $table.insertAt(record, row)
               await $table.setActiveCell(newRow, 'name')
               await $table.setActiveCell(newRow, 'name')
@@ -228,11 +325,7 @@ export default {
             },
             },
     // 修改
     // 修改
     makeSure() {
     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('没有选择订单类型,请选择')
         this.$alert('没有选择订单类型,请选择')
         return
         return
       }
       }
@@ -244,12 +337,13 @@ export default {
       }
       }
       let BmsTrainFreight = {
       let BmsTrainFreight = {
           planId:this.$route.params.planId,
           planId:this.$route.params.planId,
-          lineId:this.mapList0.lineId,
+          lineId:this.lineId,
           orderType:this.form.orderType,
           orderType:this.form.orderType,
           carrierId:this.carrierId,
           carrierId:this.carrierId,
           mapList:this.$refs.xTable.getInsertRecords()
           mapList:this.$refs.xTable.getInsertRecords()
       };
       };
       console.log(BmsTrainFreight)
       console.log(BmsTrainFreight)
+      debugger
       this.axios
       this.axios
         .post("/api/v1/oms/addInwardOrder", BmsTrainFreight)
         .post("/api/v1/oms/addInwardOrder", BmsTrainFreight)
         .then((res) => {
         .then((res) => {
@@ -294,6 +388,17 @@ export default {
     display: flex;
     display: flex;
   }
   }
 }
 }
+.capacityButton {
+  // width: 800px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-left: 150px;
+  .truckBtn {
+    width: 300px;
+  }
+  
+}
 .button-box{
 .button-box{
   display: flex;
   display: flex;
   justify-content: center;
   justify-content: center;

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

@@ -7,23 +7,44 @@
       <el-button type="primary" class="btn">
       <el-button type="primary" class="btn">
         <i class="el-icon-search"></i>查询
         <i class="el-icon-search"></i>查询
       </el-button>
       </el-button>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="dispatch"
-        v-if="activeName == 'first'"
-      >
-        <i class="el-icon-download"></i>分派</el-button
-      >
     </div>
     </div>
     <template>
     <template>
       <div>
       <div>
         <el-tabs v-model="activeName" @tab-click="handleClick">
         <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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
-          <el-tab-pane label="已分派" name="second">
+          <el-tab-pane label="已接收" name="second">
             <dilTable v-bind.sync="second"> </dilTable>
             <dilTable v-bind.sync="second"> </dilTable>
           </el-tab-pane>
           </el-tab-pane>
         </el-tabs>
         </el-tabs>
@@ -39,63 +60,106 @@ export default {
       inputText: "",
       inputText: "",
       userCarrierId:'',
       userCarrierId:'',
       first: {
       first: {
-        // first请求数据的地址
-        requestUrl:
-        "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=" + '',
-        selectionType: "select",
-        mapList: [],
-      },
-      second: {
-        // second请求数据的地址
+        // 
         requestUrl:
         requestUrl:
           "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + '',
           "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + '',
       },
       },
       activeName: "first",
       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(){
   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: {
   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) {
     deletePlan(scope) {
       this.$confirm("是否删除", "提示", {
       this.$confirm("是否删除", "提示", {

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

@@ -11,21 +11,14 @@
     <template>
     <template>
       <div>
       <div>
         <el-tabs v-model="activeName" @tab-click="handleClick">
         <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">
                 <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>
                   </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
                   <el-button
                     type="text"
                     type="text"
                     size="mini"
                     size="mini"
@@ -35,17 +28,55 @@
                   </el-button>
                   </el-button>
                 </template>
                 </template>
               </el-table-column>
               </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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane label="已分解" name="third">
           <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>
             </dilTable>
           </el-tab-pane>
           </el-tab-pane>
         </el-tabs>
         </el-tabs>
@@ -60,22 +91,63 @@ export default {
     return {
     return {
       inputText: "",
       inputText: "",
       carrierId:40,
       carrierId:40,
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount1: 1,
+       oldRow2: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount2: 1,
       first: {
       first: {
         // first请求数据的地址
         // first请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" + ''
+        requestUrl:"",
       },
       },
       second: {
       second: {
         // second请求数据的地址
         // second请求数据的地址
         requestUrl:
         requestUrl:
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" + ''
+          "" 
       },
       },
       third: {
       third: {
         // second请求数据的地址
         // second请求数据的地址
         requestUrl:
         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(){
   created(){
@@ -83,9 +155,92 @@ export default {
       this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1"
       this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1"
       this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2"
       this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2"
       this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3"
       this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3"
-      console.log(this.carrierId)
   },
   },
   methods: {
   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(){
     getRequestUrl(){
       this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&i=" + new Date()
       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()
       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",
         selectionType: "radio",
         mapList: [],
         mapList: [],
       },
       },
-
       //记录旧的row对象(未下发)
       //记录旧的row对象(未下发)
       oldRow: "",
       oldRow: "",
       //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
       //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
@@ -170,11 +169,6 @@ export default {
           label: "物资数量(件数/重量)",
           label: "物资数量(件数/重量)",
           width: 150,
           width: 150,
         },
         },
-        // {
-        //   prop: "materialWeight",
-        //   label: "物资重量",
-        //   width: 100,
-        // },
       ],
       ],
       tableData: [],
       tableData: [],
       tableData1: [],
       tableData1: [],
@@ -273,7 +267,6 @@ export default {
       }
       }
       
       
     },
     },
-
     // -------查看物资详情(未下发)
     // -------查看物资详情(未下发)
     detailclick(row) {
     detailclick(row) {
       // 记录重复点击次数
       // 记录重复点击次数