Your Name 3 vuotta sitten
vanhempi
commit
272d2eeea8

+ 15 - 1
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -421,6 +421,15 @@ export default {
     },
      // 返回主界面
     makeSure1() {
+        console.log(this.tableData.length);
+        if(this.tableData.length > 0&&this.selectionList1.length>0){
+          this.$message.warning("一个需求只允许填写一个物资")
+          return
+        }
+        if(this.selectionList1.length > 1){
+          this.$message.warning("一个需求只允许填写一个物资")
+          return
+        }
         this.selectionList1.forEach((e) => {
           // console.log(e.materialModel,e.materialSpecification)
         if(e.materialSpecification == null){
@@ -523,6 +532,10 @@ export default {
           this.disabled = false
           return
         }
+      }if(typeof(this.form.Tel) == 'undefined'){
+          this.$message.error("请填写联系电话")
+          this.disabled = false
+          return
       }
       var i=0
       this.tableData.forEach((e) =>{
@@ -554,7 +567,8 @@ export default {
         // 用车截日期
         DueTime:DueTime,
         mapList:this.tableData,
-        orgCode:getCookie("orgCode")
+        orgCode:getCookie("orgCode"),
+        remark:this.form.Tel
       };
       console.log("requirement",requiremnet);
       this.axios

+ 303 - 0
src/views/inward/components/truckOrder/getPlanOrder.vue

@@ -0,0 +1,303 @@
+// 分派计划
+<template>
+  <div class="inwardOrder">
+    <div class="sache">
+      <el-input placeholder="请输入内容" v-model="inputText" clearable>
+      </el-input>
+      <el-button type="primary" class="btn">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button type="primary" class="btn" @click="cancel">
+        返回
+      </el-button>
+    </div>
+     <!-- 车辆信息 -->
+    <el-dialog
+        title="车辆信息"
+        :visible.sync="dialogTableVisible"
+        :before-close="handleClose"
+    >
+      <el-input v-model="truckInput" style="width:250px"></el-input>
+      <el-button type="primary" @click="clickTruck">查询</el-button>
+      <dilTable
+        v-bind.sync="truck"
+        @radio-change="currentRadioChange1"
+        >
+      </dilTable>
+      <span slot="footer" class="dialog-footer">
+      <el-button @click="cancelUpdate()">取 消</el-button>
+      <el-button type="primary" @click="updateTruckCapacity()"
+      >确 定</el-button>
+      </span>
+    </el-dialog>
+    <template>
+      <div>
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <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>
+                  <el-button type="text" size="mini" @click="deleteClick(scope)">
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+              <!-- 物资详情抽屉 -->
+              <el-table-column type="expand" width="1">
+                <template slot-scope="props">
+                  <el-form
+                    label-position="center"
+                    inline
+                    class="demo-table-expand"
+                  >
+                    <div v-if="false">{{ props }}</div>
+                    <div>
+                      <el-table :data="tableData" border>
+                        <el-table-column
+                          v-for="(item, i) in tableHead"
+                          :key="i"
+                          :prop="item.prop"
+                          :label="item.label"
+                          :width="item.width"
+                        ></el-table-column>
+                      </el-table>
+                    </div>
+                  </el-form>
+                </template>
+              </el-table-column>
+            </dilTable>
+          </el-tab-pane>
+          <el-tab-pane label="已接收" name="second">
+            <dilTable v-bind.sync="second"> </dilTable>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </template>
+  </div>
+</template>
+<script>
+import { getCookie } from "@/utils/util.js";
+export default {
+  data() {
+    return {
+      inputText: "",
+      truckInput:null,
+      userCarrierId: "",
+      //是否弹出对话框
+      dialogTableVisible: false,
+      first: {
+        //
+        requestUrl:
+          "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" +
+          "",
+      },
+      //车辆信息的表格
+      truck: {
+        requestUrl:
+          "/api/v1/oms/getCapacityAndDriverList?apiId=246&carrierId=" + "",
+        // 控制显示当选列
+        selectionType: "radio",
+      },
+      //选中的运力id
+      capacityId: null,
+      activeName: "first",
+      second: {
+        requestUrl: "",
+      },
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "loadName",
+          label: "装货点",
+          width: 150,
+        },
+        {
+          prop: "unloadName",
+          label: "卸货点",
+          width: 150,
+        },
+        {
+          prop: "loadSequence",
+          label: "装卸货次序",
+          width: 150,
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 150,
+        },
+        {
+          prop: "materialCount",
+          label: "物资数量",
+          width: 150,
+        },
+      ],
+      tableData: [],
+      //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+    };
+  },
+  created() {
+      this.first.requestUrl =
+        "/api/v1/ams/getPlanOrder?apiId=260&orderStatus=4" + "&planId=" + this.$route.params.planId
+      this.second.requestUrl =
+        "/api/v1/ams/getPlanOrder?apiId=260&orderStatus=5" + "&planId=" + this.$route.params.planId
+  },
+  methods: {
+    getRequest() {
+      this.first.requestUrl =
+        "/api/v1/ams/getPlanOrder?apiId=260&orderStatus=4" + "&i=" + new Date() + "&planId=" + this.$route.params.planId
+      this.second.requestUrl =
+        "/api/v1/ams/getPlanOrder?apiId=260&orderStatus=5" + "&i=" + new Date() + "&planId=" + this.$route.params.planId
+    },
+    cancel(){
+        this.$router.go(-1)
+    },
+    handleClick() {
+      this.getRequirementMaterial();
+      this.getRequest()
+    },
+    handleClose(done){
+      done()
+      this.$message.info("取消修改运力")
+    },
+    currentRadioChange1(row){
+      console.log(row)
+      this.capacityId = row.capacityId
+    },
+    getTruckRequestUrl(){
+      if (getCookie("orgCode") == "chengyunshang") {
+      this.truck.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
+        getCookie("userId") + "&test=" + new Date();
+      } else {
+      this.truck.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" + null +  "&test=" + new Date();
+      }
+    },
+    //修改运输订单
+    updatePlan(scope){
+      this.getTruckRequestUrl()
+      this.orderId = scope.row.orderId
+      this.dialogTableVisible = true
+      console.log(scope.row.orderId)
+    },
+    updateTruckCapacity(){
+        if(this.capacityId == null){
+            this.$message.error("未选中运力")
+            return
+        }
+        this.axios.post("/api/v1/oms/updateCapacityId",{
+          capacityId:this.capacityId,
+          orderId :this.orderId
+        }).then((res) =>{
+          if(res.data.code == "200"){
+            this.$message.success("修改运力成功")
+            this.dialogTableVisible = false
+            this.getRequest()
+            
+          }else{
+            this.$message.error("修改运力失败")
+            this.dialogTableVisible = false
+            this.getRequest()
+          }
+        })
+    },
+    clickTruck(){
+      this.truck.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" + null + "&index=" + this.truckInput
+    },
+    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);
+        });
+    },
+      //删除运输订单
+    deleteClick(scope){
+      this.$confirm('是否删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then(() => {
+            this.axios
+            .post("/api/v1/oms/closeOmstruckOrder?orderId=" + scope.row.orderId)
+            .then((res) => {
+              if (res.data.code == 200) {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });     
+                this.getRequest()
+              } else {
+                this.$message({
+                  message: "删除失败",
+                  type: "warning",
+                });
+              }
+            });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.inwardOrder {
+  margin-top: 20px;
+  margin-left: 20px;
+  .sache {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 7 - 1
src/views/inward/components/truckOrder/plan.vue

@@ -51,11 +51,14 @@
           </el-tab-pane>
           <el-tab-pane label="已分解" name="third">
             <dilTable v-bind.sync="third" ref="table2">
-             <el-table-column fixed="right" label="操作" width="100">
+             <el-table-column fixed="right" label="操作" width="150">
                 <template slot-scope="scope">
                   <el-button type="text" size="mini" @click="getRequirementMaterial2(scope.row)">
                     物资详情
                   </el-button>
+                  <el-button type="text" size="mini" @click="getPlanOrder(scope)">
+                    运单
+                  </el-button>
                 </template>
               </el-table-column>
           <!-- 物资详情抽屉 -->
@@ -295,6 +298,9 @@ export default {
     desponsePlan(scope) {
       this.$router.push("/decomposePlan/" + scope.row.planId);
     },
+    getPlanOrder(scope) {
+      this.$router.push("/getPlanOrder/" + scope.row.planId);
+    },
     deletePlan(scope) {
       this.$confirm("是否删除", "提示", {
         confirmButtonText: "确定",

+ 5 - 1
src/views/inward/router/index.js

@@ -118,6 +118,9 @@ import updatePlan from '@/views/inward/components/truckAppoint/updatePlan.vue'
 import addRailPlan from '@/views/inward/components/truckAppoint/addRailPlan.vue'
 //计划分解
 import decomposePlan from '@/views/inward/components/truckOrder/decomposePlan.vue'
+
+//查看计划运单详情
+import getPlanOrder from '@/views/inward/components/truckOrder/getPlanOrder.vue'
 //内转异地库计划分解
 import decomposeRailPlan from '@/views/inward/components/truckOrder/decomposeRailPlan.vue'
 //请车作业新增
@@ -216,7 +219,8 @@ const constantRouterMap = [{
     {path: 'addPlan',name: 'addPlan',meta: {code: 'xtpzgl-yhgl'},component: addPlan}, 
     {path: 'updatePlan/:planId',name: 'updatePlan',meta: {code: 'xtpzgl-yhgl'},component: updatePlan}, 
     {path: 'addRailPlan',name: 'addRailPlan',meta: {code: 'xtpzgl-yhgl'},component: addRailPlan}, 
-    {path: 'decomposePlan/:planId',name: 'decomposePlan',meta: {code: 'xtpzgl-yhgl'},component: decomposePlan}, 
+    {path: 'decomposePlan/:planId',name: 'decomposePlan',meta: {code: 'xtpzgl-yhgl'},component: decomposePlan},
+    {path: 'getPlanOrder/:planId',name: 'getPlanOrder',meta: {code: 'xtpzgl-yhgl'},component: getPlanOrder},  
     {path: 'decomposeRailPlan/:dayPlanId',name: 'decomposeRailPlan',meta: {code: 'xtpzgl-yhgl'},component: decomposeRailPlan}, 
     {path: 'addWagonPlease',name: 'addWagonPlease',meta: {code: 'xtpzgl-yhgl'},component: addWagonPlease}, 
     {path: 'editWagonPlease/:resultId',name: 'editWagonPlease',meta: {code: 'xtpzgl-yhgl'},component: editWagonPlease},