浏览代码

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

luobang 2 年之前
父节点
当前提交
edd54f56d7
共有 1 个文件被更改,包括 121 次插入54 次删除
  1. 121 54
      src/views/inward/components/truckAppoint/addRequirement2.vue

+ 121 - 54
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -39,7 +39,7 @@
         </el-select>
       </div>
       <div class="DueTime">
-        <el-form :inline="true" style="margin-top: 0.5rem;">
+        <el-form :inline="true" style="margin-top: 0.5rem">
           <el-form-item>
             <el-switch
               v-model="isOpenDueTime"
@@ -52,7 +52,7 @@
             <el-form-item v-if="isOpenDueTime == true">
               <label
                 class="el-form-item__label"
-                style="width: auto; margin-left:10px;"
+                style="width: auto; margin-left: 10px"
                 >截止日期</label
               >
               <el-date-picker
@@ -88,11 +88,11 @@
           size="40%"
           :show-close="false"
         >
-          <div style="margin-left:-300px">
+          <div style="margin-left: -300px">
             <el-input
               placeholder="请输入内容"
               v-model="inputCapacityType"
-              style="margin-left:20px;width: 250px"
+              style="margin-left: 20px; width: 250px"
               clearable
             >
             </el-input
@@ -114,6 +114,8 @@
           </div>
         </el-drawer>
       </div>
+
+      <!-- 选择物资 -->
       <div class="materialDrawer">
         <el-form :inline="true" class="demo-form-inline" label-width="80px">
           <el-form-item label="选择物资"> </el-form-item>
@@ -173,7 +175,7 @@
                   <!-- 装货点 -->
                   <template
                     v-if="item.prop == 'requirementPlatformName'"
-                    style="width:400px"
+                    style="width: 400px"
                   >
                     <el-input
                       class="textinput"
@@ -246,6 +248,7 @@
           direction="rtl"
           size="40%"
           :show-close="false"
+          :before-close="handleClose2"
         >
           <el-input placeholder="请输入内容" v-model="inputMaterial" clearable>
           </el-input
@@ -253,7 +256,7 @@
             <i class="el-icon-search"></i>查询
           </el-button>
           <!-- <el-button @click="open">取消</el-button> -->
-          <el-button type="primary" @click="makeSure1">确定</el-button>
+          <!-- <el-button type="primary" @click="makeSure1">确定</el-button> -->
           <div class="tablecls">
             <!-- 查询所有的物资 -->
             <dilTable
@@ -331,44 +334,44 @@ export default {
       options6: [
         {
           value: "焦化",
-          label: "焦化"
+          label: "焦化",
         },
         {
           value: "污粉",
-          label: "污粉"
+          label: "污粉",
         },
         {
           value: "喷煤",
-          label: "喷煤"
+          label: "喷煤",
         },
         {
           value: "溶剂",
-          label: "溶剂"
+          label: "溶剂",
         },
         {
           value: "配料",
-          label: "配料"
+          label: "配料",
         },
         {
           value: "二次",
-          label: "二次"
+          label: "二次",
         },
         {
           value: "原料",
-          label: "原料"
+          label: "原料",
         },
         {
           value: "烧结矿",
-          label: "烧结矿"
+          label: "烧结矿",
         },
         {
           value: "打堆、装车",
-          label: "打堆、装车"
+          label: "打堆、装车",
         },
         {
           value: "回收废旧物资",
-          label: "回收废旧物资"
-        }
+          label: "回收废旧物资",
+        },
       ],
       installremark: "",
       options: [],
@@ -386,25 +389,25 @@ export default {
         {
           prop: "materialName",
           label: "物资名称",
-          width: "140"
+          width: "140",
         },
         {
           prop: "requirementPlatformName",
           label: "装货点",
           slot: true,
-          width: "140"
+          width: "140",
         },
         {
           prop: "truckPoint1",
           label: "卸货点",
           slot: true,
-          width: "140"
+          width: "140",
         },
         {
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true
-        }
+          slot: true,
+        },
       ],
       row: {},
       //物资表格数据
@@ -436,25 +439,25 @@ export default {
       materialTable: {
         requestUrl: "",
         selectionType: "select",
-        mapList1: []
+        mapList1: [],
       },
       second1: {
         requestUrl: "",
         selectionType: "radio",
-        mapList2: []
+        mapList2: [],
       },
       options3: {
         requestUrl: "",
         selectionType: "radio",
-        mapList3: []
+        mapList3: [],
       },
-      form: {}
+      form: {},
     };
   },
   computed: {
     requirementType() {
       return this.form.requirementType;
-    }
+    },
   },
   watch: {
     requirementType() {
@@ -481,14 +484,14 @@ export default {
         this.tableTop.push({
           prop: "orderMaterialNumber",
           label: "件数",
-          slot: true
+          slot: true,
         });
       } else {
         this.tableTop.splice(this.tableTop.length - 1, 1);
         this.tableTop.push({
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true
+          slot: true,
         });
       }
     },
@@ -498,7 +501,7 @@ export default {
       } else {
         this.aaadrawer = true;
       }
-    }
+    },
   },
   methods: {
     //用车单位弹出层
@@ -514,7 +517,7 @@ export default {
     querySearchCarrier(queryString, cb) {
       this.axios
         .post("/api/v1/uc/getRequireUnitName?index=" + queryString)
-        .then(res => {
+        .then((res) => {
           if (res.data.code == "200") {
             var restaurantsCarrier = res.data.data;
             // console.log(restaurantsCarrier,"restaurantsCarrier");
@@ -527,7 +530,7 @@ export default {
         });
     },
     createFilterCarrier(queryString) {
-      return restaurantsCarrier => {
+      return (restaurantsCarrier) => {
         return (
           restaurantsCarrier.shipperName
             .toLowerCase()
@@ -573,6 +576,58 @@ export default {
     },
     handleClose(done) {
       done();
+      //执行选择
+    },
+    handleClose2(done) {
+      console.log("add2");
+
+      console.log(this.tableData.length);
+      console.log("ad");
+      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) {
+          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;
+      done();
+    },
+    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,
+          loadPointName: e.loadPointName,
+          unloadPointName: e.unloadPointName,
+        };
+        this.tableData.push(addmap);
+      });
     },
     onclickMaterial() {
       if (this.inputMaterial == null) {
@@ -614,6 +669,7 @@ export default {
     // 返回主界面
     makeSure1() {
       console.log(this.tableData.length);
+      console.log("ad");
       if (this.tableData.length > 0 && this.selectionList1.length > 0) {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
@@ -622,7 +678,7 @@ export default {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
       }
-      this.selectionList1.forEach(e => {
+      this.selectionList1.forEach((e) => {
         // console.log(e.materialModel,e.materialSpecification)
         if (e.materialSpecification == null) {
           e.materialSpecification = "";
@@ -633,7 +689,7 @@ export default {
         var addmap = {
           materialName:
             e.materialName + e.materialSpecification + e.materialModel,
-          materialId: e.materialId
+          materialId: e.materialId,
         };
         this.tableData.push(addmap);
       });
@@ -643,7 +699,7 @@ export default {
     refreshTable() {
       var arr = this.tableData;
       this.tableData = [];
-      arr.forEach(e => {
+      arr.forEach((e) => {
         var addmap = {
           materialName: e.materialName,
           materialId: e.materialId,
@@ -654,7 +710,7 @@ export default {
           orderMaterialNumber: e.orderMaterialNumber,
           orderMaterialWeight: e.orderMaterialWeight,
           loadPointName: e.loadPointName,
-          unloadPointName: e.unloadPointName
+          unloadPointName: e.unloadPointName,
         };
         this.tableData.push(addmap);
       });
@@ -739,11 +795,11 @@ export default {
     },
     // 新增
     makeSure() {
-      console.log(this.form.isMineral);
-      // 判断当前装机是否选择了装机必填
-      console.log("进来了");
-      console.log(this.whether);
-      console.log(this.installremark);
+      // console.log(this.form.isMineral);
+      // // 判断当前装机是否选择了装机必填
+      // console.log("进来了");
+      // console.log(this.whether);
+      // console.log(this.installremark);
       if (this.whether == 2 && this.installremark == "") {
         console.log("确实进来了");
         this.$message.warning("请选择装机必填");
@@ -789,7 +845,7 @@ export default {
         return;
       }
       var i = 0;
-      this.tableData.forEach(e => {
+      this.tableData.forEach((e) => {
         if (e.requirementPlatformId && e.requirementUnloadUnitId) {
           i++;
         }
@@ -844,15 +900,15 @@ export default {
         capacityTypeId: this.capacityTypeId,
         mapList: this.tableData,
         orgCode: getCookie("orgCode"),
-        remark: this.form.Tel + this.capacityTypeName + this.form.typeRemarks
+        remark: this.form.Tel + this.capacityTypeName + this.form.typeRemarks,
       };
       this.axios
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
-        .then(res => {
+        .then((res) => {
           if (res.data.code == 200) {
             this.$message({
               type: "success",
-              message: "新增成功!"
+              message: "新增成功!",
             });
             this.$router.go(-1);
           } else {
@@ -868,8 +924,8 @@ export default {
     // 返回
     cancel() {
       this.$router.go(-1);
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>
@@ -966,13 +1022,24 @@ export default {
       display: flex;
       justify-content: center;
       align-items: center;
-      margin-right: 500px;
-      .el-form-item {
-        .el-form-item__label {
-          width: 170px !important;
-        }
-        .el-input {
-          width: 210px !important;
+      margin-right: 600px;
+      // margin-left: -20px;
+      background-color: yellow;
+      .preview-group {
+        background-color: blue;
+        ::v-deep .el-form-item {
+          background-color: blue;
+          .el-form-item__label {
+            width: 170px !important;
+            background-color: blue;
+          }
+          ::v-deep .el-form-item__content {
+            background-color: red;
+            width: 300px;
+          }
+          .el-input {
+            width: 210px !important;
+          }
         }
       }
     }