zhouzh há 3 anos atrás
pai
commit
cbca3734c2

+ 1 - 1
build/utils.js

@@ -20,7 +20,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 
  let devModules = ['all']
 // let devModules = ['index','inward','SporadicManage']
-// let devModules = ['index','inward']
+// let devModules = ['index','inward','RMS']
 // let devModules = ['index','SporadicManage','RMS','statisticalReport']
 // let devModules = ['index','inward','statisticalReport']
 //  let devModules = ['index','WMS','sale','TMS','inward','SporadicManage']

BIN
dist.rar


+ 319 - 0
src/views/RMS/components/addOtherCapacity.vue

@@ -0,0 +1,319 @@
+<template>
+  <!-- 添加运力信息 -->
+  <div class="addCapacity">
+    <PageTitle>返回</PageTitle>
+    <div class="form_box" style="margin-right: 10rem">
+      <dil-form :formId="309" v-model="form1" ref="from1"></dil-form>
+    </div>
+    <div class="elForm">
+      <el-form :inline="true" class="demo-form-inline" label-width="80px">
+        <el-form-item label="选择承运商">
+          <el-autocomplete
+            class="inline-input"
+            v-model="state"
+            :fetch-suggestions="querySearch"
+            placeholder="请输入承运商名称"
+            :trigger-on-focus="false"
+            @select="handleSelect"
+          >
+            <template slot-scope="{ item }">
+              <div class="name" v-if="item.carrierName">
+                {{ item.carrierName }}
+              </div>
+            </template>
+          </el-autocomplete>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="button_box">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="makeSure" :loading="addLoading"
+        >确定</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { getCookie } from "@/utils/util.js";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      addLoading: false,
+      form1: {},
+      form1Initialization: {
+        capacityTypeId: 1,
+        capacityNumber: "",
+        capacityCorlor: "黄",
+        capacityOwneris: "否",
+        capacityVip: "否",
+        capacityBlacklist: "否",
+      },
+      value: undefined,
+      carrierIds: null,
+      state: null,
+      userId: null,
+      restaurants: [],
+      accessToken: null,
+      userCode: null,
+      carrierUserId: null,
+      carrierId: null,
+    };
+  },
+  created() {
+    this.carrierUserId = getCookie("userId");
+    this.form1 = this.form1Initialization;
+    // console.log(this.carrierUserId, "carrierUserId");
+  },
+  mounted() {
+    this.axios
+      .post(
+        "/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=" + this.carrierUserId
+      )
+      .then((res) => {
+        if (res.data.code == "200") {
+          // console.log(res.data.data);
+          if (res.data.data) {
+            this.state = res.data.data.carrierName;
+            this.carrierIds = res.data.data.carrierId;
+          }
+        }
+      });
+  },
+  methods: {
+    //承运商弹出层
+    handleSelect(item) {
+      this.carrierIds = item.carrierId;
+      item.carrierName = this.state;
+    },
+    //以下是承运商边输边查搜索
+    querySearch(queryString, cb) {
+      this.axios
+        .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            // console.log(res.data.data);
+            var restaurants = res.data.data;
+            // console.log(restaurants, "restaurants");
+            var results = queryString
+              ? restaurants.filter(this.createFilter(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是承运商边输边查搜索
+    deleteUser(userId) {
+      this.axios.delete("pass/v1/sysusers/" + userId).then((res) => {
+        this.$message.error("添加失败,车牌可能重复");
+      });
+    },
+    insertRole(userId, userCode) {
+      this.axios
+        .post(
+          "pass/v1/sysuserroles/addUserroles?userId=" +
+            userId +
+            "&userCode=" +
+            userCode +
+            "&roleId=" +
+            "923693668269953024"
+        )
+        .then((res) => {
+          if (res.code === "0") {
+            this.$message.success("操作成功");
+            this.saveLoading = false;
+            this.rolesTree.loading = false;
+          } else {
+            this.$message.error(res.message);
+          }
+        });
+    },
+    // isVehicleNumber(vehicleNumber) {
+    //   // console.log(vehicleNumber);
+    //   var result = false;
+    //   if (vehicleNumber.length == 7) {
+    //     var express =
+    //       /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
+    //     result = express.test(vehicleNumber);
+    //   }
+    //   return result;
+    // },
+    makeSure() {
+      this.addLoading = true;
+      // if (!this.isVehicleNumber(this.form1.capacityNumber.toUpperCase())) {
+      //   this.$message.error("车牌号格式不正确");
+      //   this.addLoading = false;
+      //   return;
+      // }
+      if(this.form1.capacityNumber.length<=2){
+        this.$message.error("车牌号必须大于三位");
+        this.addLoading = false;
+        return;
+
+      }
+      if (this.carrierIds == null) {
+        this.$message.error("请选择承运商");
+        this.addLoading = false;
+        return;
+      }
+      let RmsCapacity = {
+        capacityTypeId: this.form1.capacityTypeId,
+        capacityNumber: this.form1.capacityNumber.toUpperCase(),
+        capacityCorlor: this.form1.capacityCorlor,
+        capacityOwneris: this.form1.capacityOwneris,
+        capacityVip: this.form1.capacityVip,
+        capacityBlacklist: this.form1.capacityBlacklist,
+        remark: this.form1.remark,
+        carrierId: this.carrierIds,
+        state: this.state,
+      };
+      if (
+        RmsCapacity.capacityNumber == null ||
+        RmsCapacity.capacityCorlor == null ||
+        RmsCapacity.capacityOwneris == null ||
+        RmsCapacity.capacityVip == null ||
+        RmsCapacity.capacityBlacklist == null
+      ) {
+        this.$message.error("存在空值!");
+        this.addLoading = false;
+      } else {
+        //新增SSO运力账号
+        var formData = new FormData();
+        formData.append("userCode", this.form1.capacityNumber.toUpperCase());
+        formData.append("orgCode", "yunli");
+        formData.append("orgName", "运力");
+        formData.append("groupId", "506514577756917769");
+        formData.append("companyId", "713710108567277568");
+        formData.append("orgId", "924126716337721344");
+        // console.log(formData.get("userCode"));
+        // console.log(typeof formData);
+        this.$store
+          .dispatch("system/usersManage/addUser", formData)
+          .then((res) => {
+            // console.log(res);
+            if (res.code === "0") {
+              // console.log(res.data.userId);
+              this.userId = res.data.userId;
+              this.userCode = res.data.userCode;
+              RmsCapacity.ssoId = res.data.userId;
+              this.axios
+                .post("/api/v1/rms/insertCapacity", RmsCapacity)
+                .then((res) => {
+                  if (res.data.data == 1) {
+                    this.insertRole(this.userId, this.userCode);
+                    this.$message.success("添加成功");
+                    this.$router.push("capacity");
+                  } else if (res.data.code == "201") {
+                    this.deleteUser(this.userId);
+                  } else {
+                    this.deleteUser(this.userId);
+                  }
+                });
+            } else {
+              // console.log(RmsCapacity, "RmsCapacity");
+              if (res.message == "账号已被注册") {
+                this.$confirm(
+                  "该账号已经被注册, 是否确定新增承运商绑定关系?",
+                  "提示",
+                  {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }
+                )
+                  .then(() => {
+                    this.axios
+                      .post("/api/v1/rms/insertCapacity", RmsCapacity)
+                      .then((res) => {
+                        // console.log(res, "res");
+                        if (res.data.data == 0) {
+                          this.$message.success("新增承运商绑定关系成功!");
+                          this.$router.push("capacity");
+                        } else {
+                          this.$message.error("该绑定关系已存在!");
+                        }
+                      });
+                  })
+                  .catch(() => {
+                    this.$message({
+                      type: "info",
+                      message: "已取消删除",
+                    });
+                  });
+              }
+            }
+          });
+        this.addLoading = false;
+      }
+    },
+    // 取消
+    cancel() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+<style lang='scss' >
+.addCapacity {
+  .elForm {
+    margin-left: 40%;
+  }
+  .form_box {
+    width: 100%;
+    margin-top: 30px;
+    margin-left: 50px;
+    display: flex;
+    justify-content: center;
+    .el-form-item {
+      display: flex;
+      justify-content: center;
+      .el-form-item__label {
+        display: flex;
+        align-items: center;
+      }
+      .el-form-item__content {
+        .el-select {
+          width: 250px;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+    }
+  }
+  .inputBox {
+    display: flex;
+    justify-content: center;
+    margin-bottom: 30px;
+    .text {
+      text-align: right;
+      display: flex;
+      align-items: center;
+      margin-right: 5px;
+    }
+    .input {
+      width: 250px;
+    }
+  }
+  .button_box {
+    display: flex;
+    justify-content: center;
+    .el-button {
+      width: 80px;
+      margin-right: 10px;
+    }
+  }
+}
+</style>

+ 6 - 0
src/views/RMS/components/capacity.vue

@@ -13,6 +13,9 @@
        <el-button type="primary" class="btn" @click="toInsert">
         <i class="el-icon-plus"></i>新增
       </el-button>
+      <el-button type="primary" class="btn" @click="toInsert1">
+        <i class="el-icon-plus"></i>新增特殊车牌
+      </el-button>
       <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
     </div>
     <div class="table">
@@ -113,6 +116,9 @@ export default {
      toInsert() {
       this.$router.push("/addCapacity");
     },
+    toInsert1() {
+      this.$router.push("/addOtherCapacity");
+    },
     updateCapacity(capacityId){
       this.$router.push("/editCapacity/" + capacityId)
     },

+ 2 - 0
src/views/RMS/router/index.js

@@ -24,6 +24,7 @@ import addTruckCalculate from '../components/addTruckCalculate.vue'
 import capacity from '../components/capacity.vue'
 import carDriver from '../components/carDriver.vue'
 import carrier from '../components/carrier.vue'
+import addOtherCapacity from '../components/addOtherCapacity'
 
 import editCapacity from '../components/editCapacity.vue'
 import editCarDriver from '../components/editCarDriver.vue'
@@ -81,6 +82,7 @@ const constantRouterMap = [
 		{path: 'addRmsShipper', name: 'addRmsShipper', meta: {code: 'xtpzgl-yhgl'}, component: addRmsShipper},
 		{path: 'addSupplier', name: 'addSupplier', meta: {code: 'xtpzgl-yhgl'}, component: addSupplier},
 		{path: 'addTruckCalculate', name: 'addTruckCalculate', meta: {code: 'xtpzgl-yhgl'}, component: addTruckCalculate},
+		{path: 'addOtherCapacity', name: 'addOtherCapacity', meta: {code: 'xtpzgl-yhgl'}, component: addOtherCapacity},
 		{path: 'capacity', name: 'capacity', meta: {code: 'xtpzgl-yhgl'}, component: capacity},
 		{path: 'carDriver', name: 'carDriver', meta: {code: 'xtpzgl-yhgl'}, component: carDriver},
 		{path: 'carrier', name: 'carrier', meta: {code: 'xtpzgl-yhgl'}, component: carrier},

+ 81 - 2
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -27,7 +27,7 @@
     </el-form>
       </div>
       <div class="form-box">
-        <dil-form :formId="300" v-model="form"></dil-form>
+        <dil-form :formId="377" v-model="form"></dil-form>
       </div>
 
       <div class="DueTime">
@@ -51,6 +51,51 @@
           </div>
           </el-form>
       </div>
+     <!--选择车辆类型--> 
+     <div class="capacity">
+      <div class="capacityName">
+         <el-form
+        :inline="true"
+        class="demo-form-inline"
+        label-width="80px"
+      >
+        <el-form-item label="选择车辆类型">    
+        </el-form-item>  
+        <el-form-item>
+         <el-input
+          el-input v-model="capacityTypeName" disabled>  
+       </el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="ondrawer(3)" class="truckBtn"
+          >浏览</el-button>
+        </el-form-item>
+        </el-form>
+      </div>
+      <el-drawer
+      title="选择车辆类型"
+      :visible.sync="drawer2"
+      direction="rtl"
+      size="40%"
+      :show-close="false"
+      >
+      <div style="margin-left:-300px">
+        <el-input placeholder="请输入内容" v-model="inputCapacityType" style="margin-left:20px;width: 250px" clearable > </el-input
+      ><el-button type="primary" class="btn" @click="onclickCapacity">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      </div>
+      
+     
+      <!-- <el-button @click="open">取消</el-button> -->
+    
+      <div class="tablecls">
+      
+        <dilTable ref="options3" v-bind.sync="options3" @radio-change="selectionChange1" :drawer="aaadrawer">
+        </dilTable>
+      </div>
+      </el-drawer>
+</div> 
       <div class="materialDrawer">
          <el-form
         :inline="true"
@@ -256,10 +301,12 @@ export default {
       options: [],
       value: '',
       isOpenDueTime : true,
+      inputCapacityType:null,
       DueTime:null,
       // 件数与重量的开关
       value: false,
       //物资模态框开关
+      drawer2:false,
       table: false,
       //物资表格表头
       tableTop: [
@@ -304,11 +351,14 @@ export default {
       materialId: null,
       requireUnitName:null,
       inputMaterial:null,
+      inputCapacityType:null,
       shipperId:null,
       truckPoint1: "",
       drawer: false,
       selectionList1: [],
       form: {},
+      capacityTypeId: "",
+      capacityTypeName:"",
       materialTable: {
         requestUrl: "",
         selectionType: "select",
@@ -319,6 +369,11 @@ export default {
         selectionType: "radio",
         mapList2: []
       },
+      options3:{
+        requestUrl:"",
+        selectionType:"radio",
+        mapList3: []
+      },
       form:{}
     };
   },
@@ -380,6 +435,7 @@ export default {
     selectionChange(selection) {
       this.selectionList1 = [];
       this.selectionList1 = selection;
+      console.log("selection",selection)
     },
     unloadPoint(index) {
       this.getUnloadRequestUrl()
@@ -398,6 +454,9 @@ export default {
       if(num==1){
         this.table = true
         this.materialTable.requestUrl = "/api/v1/uc/queryMaterialByLike?apiId=244&i=" + new Date()
+      }else if(num==3){
+        this.drawer2 = true
+        this.options3.requestUrl = "/api/v1/uc/getCapacityType?apiId=460"
       }else{
         this.drawer = true;
       }  
@@ -414,6 +473,14 @@ export default {
         this.inputMaterial = null
       }
     },
+    onclickCapacity(){
+      if(this.inputCapacityType == null){
+        this.options3.requestUrl = "/api/v1/uc/getCapacityType?apiId=460"
+      }else{
+        this.options3.requestUrl = "/api/v1/uc/getCapacityType?apiId=460&index="+this.inputCapacityType
+        this.inputCapacityType = null
+      }
+    },
     //删除行
     deleteRow(index, rows) {
       // console.log(index)
@@ -490,6 +557,9 @@ export default {
       }
       this.materialId = selection.materialId;
     },
+    selectionChange1(radio){
+      this.capacityTypeName  = radio.capacityTypeName
+    },
     currentRadioChange2(selection) {
       console.log(selection);
       if (this.a == 2) {
@@ -585,7 +655,7 @@ export default {
         DueTime:DueTime,
         mapList:this.tableData,
         orgCode:getCookie("orgCode"),
-        remark:this.form.Tel + this.form.capacityType
+        remark:this.form.Tel + this.capacityTypeName+this.form.typeRemarks
       };
       console.log("requirement",requiremnet);
       this.axios
@@ -639,6 +709,15 @@ export default {
       margin-right: 70px;
     }
   }
+.capacity{
+  display: flex;
+  text-align: center;
+  align-items: center;
+  justify-content: center;
+  margin-top: 2rem;
+  margin-bottom: 1.25rem;
+  margin-right: 10px;
+}
 .materialDrawer {
   display: flex;
   justify-content: center;