luobang 2 năm trước cách đây
mục cha
commit
31f5a05794
2 tập tin đã thay đổi với 99 bổ sung99 xóa
  1. 1 1
      build/utils.js
  2. 98 98
      src/views/RMS/components/addConsignee.vue

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
 
 let devModules = ['all']
-// let devModules = ['index', 'statisticalReport', 'sale']
+// let devModules = ['index', 'RMS']
 // let devModules = ['all']
 
 // let devModules = ['index', 'ADMINISTRATORS']

+ 98 - 98
src/views/RMS/components/addConsignee.vue

@@ -2,31 +2,27 @@
   <!-- 添加收货客户信息 -->
   <div class="addConsignee">
     <PageTitle>返回</PageTitle>
-     <div class="form-box" style="margin-right: 10rem">
-        <dil-form :formId="367" v-model="form1" ref="from1"></dil-form>
-      </div>
-      <div class="f-box">
-         <el-form
-        :inline="true"
-        class="demo-form-inline"
-        label-width="80px"
-        >
+    <div class="form-box" style="margin-right: 10rem">
+      <dil-form :formId="367" v-model="form1" ref="from1"></dil-form>
+    </div>
+    <div class="f-box">
+      <el-form :inline="true" class="demo-form-inline" label-width="80px">
         <el-form-item label="收货父级单位">
-         <el-autocomplete
-          class="inline-input"
-          v-model="stateConsignee"
-          :fetch-suggestions="querySearchConsignee"
-          placeholder="请输入收货父级单位名称"
-          :trigger-on-focus="false"
-          @select="handleSelectConsignee"
-        >
-        <template slot-scope="{ item }">
-          <div class="name">{{ item.consigneeCompanyName }}</div>
-        </template>
-        </el-autocomplete>
+          <el-autocomplete
+            class="inline-input"
+            v-model="stateConsignee"
+            :fetch-suggestions="querySearchConsignee"
+            placeholder="请输入收货父级单位名称"
+            :trigger-on-focus="false"
+            @select="handleSelectConsignee"
+          >
+            <template slot-scope="{ item }">
+              <div class="name">{{ item.consigneeCompanyName }}</div>
+            </template>
+          </el-autocomplete>
         </el-form-item>
-        </el-form>
-      </div>
+      </el-form>
+    </div>
     <div class="button-box">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
@@ -35,21 +31,21 @@
 </template>
 
 <script>
-import PageTitle from "@/components/Page/Title";
-
+import PageTitle from '@/components/Page/Title'
+import { getCookie } from '@/utils/util.js'
 export default {
   components: { PageTitle },
   data() {
     return {
       form1: {},
-      stateConsignee:null,
-      restaurantsConsignee:null,
-    };
+      stateConsignee: null,
+      restaurantsConsignee: null
+    }
   },
   mounted() {},
   methods: {
-        //收货单位弹出层
-    handleSelectConsignee(item){
+    //收货单位弹出层
+    handleSelectConsignee(item) {
       console.log(this.consigneeId)
       this.consigneeId = item.consigneeId
       item.consigneeCompanyName = this.consigneeCompanyName
@@ -58,104 +54,108 @@ export default {
     },
     //以下是发货单位边输边查搜索
     querySearchConsignee(queryString, cb) {
-      this.axios.post('/api/v1/uc/getConsigneeByLike?index='+queryString).then((res)=>{
-        if(res.data.code == "200"){
-          console.log(res)
-          var restaurantsConsignee = res.data.data
-          var results = queryString ? restaurantsConsignee.filter(this.createFilterConsignee(queryString)) :restaurantsConsignee;
+      this.axios
+        .post('/api/v1/uc/getConsigneeByLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            console.log(res)
+            var restaurantsConsignee = res.data.data
+            var results = queryString
+              ? restaurantsConsignee.filter(
+                  this.createFilterConsignee(queryString)
+                )
+              : restaurantsConsignee
             // 调用 callback 返回建议列表的数据
-          console.log(results,"results");
-          cb(results);
-        }
-      })    
-      },
+            console.log(results, 'results')
+            cb(results)
+          }
+        })
+    },
     createFilterConsignee(queryString) {
-        return (restaurantsConsignee) => {
-          return (restaurantsConsignee.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
-        };
-      },
-      //以上是收货单位边输边查搜索
-     makeSure() {
-       console.log(this.form1)
-       let RmsConsignee={
-         companyName:this.form1.companyName,
-         consigneeAbbreviation:this.form1.consigneeAbbreviation,
-         consigneeRegisteredAddress:this.form1.consigneeRegisteredAddress,
-         consigneeReceiveAddress:this.form1.consigneeReceiveAddress,
-         consigneeRegistrationTime:this.form1.consigneeRegistrationTime,
-         consigneeContactName:this.form1.consigneeContactName,
-         consigneeContactTel:this.form1.consigneeContactTel,
-         consigneeFarId:this.consigneeId,
-         userName:getCookie('loginName')
-       };
-        console.log("RmsConsignee",RmsConsignee)
+      return restaurantsConsignee => {
+        return (
+          restaurantsConsignee.value
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        )
+      }
+    },
+    //以上是收货单位边输边查搜索
+    makeSure() {
+      console.log(this.form1)
+      let RmsConsignee = {
+        companyName: this.form1.companyName,
+        consigneeAbbreviation: this.form1.consigneeAbbreviation,
+        consigneeRegisteredAddress: this.form1.consigneeRegisteredAddress,
+        consigneeReceiveAddress: this.form1.consigneeReceiveAddress,
+        consigneeRegistrationTime: this.form1.consigneeRegistrationTime,
+        consigneeContactName: this.form1.consigneeContactName,
+        consigneeContactTel: this.form1.consigneeContactTel,
+        consigneeFarId: this.consigneeId,
+        userName: getCookie('loginName')
+      }
+      console.log('RmsConsignee', RmsConsignee)
 
-       if(
-        RmsConsignee.companyName == null
-       )this.$message.error("存在空值!");
-       else
-         this.axios
-          .post(
-            "/api/v1/rms/insertConsignee",
-            RmsConsignee
-          )
-    
-          .then((res) => {
-               console.log("res.data.code",res.data.code);
+      if (RmsConsignee.companyName == null) this.$message.error('存在空值!')
+      else
+        this.axios
+          .post('/api/v1/rms/insertConsignee', RmsConsignee)
+
+          .then(res => {
+            console.log('res.data.code', res.data.code)
             if (res.data.code == 200) {
               this.$message({
-                type: "success",
-                message: "新增成功!",
-              });
+                type: 'success',
+                message: '新增成功!'
+              })
               // this.$refs.table.refreshData();
-              this.$router.go(-1);
+              this.$router.go(-1)
             } else {
-              this.$message.error("新增失败,可能有重复");
+              this.$message.error('新增失败,可能有重复')
             }
-          });
+          })
     },
     // 取消
     cancel() {
-      this.$router.go(-1);
-    },
-  },
-};
+      this.$router.go(-1)
+    }
+  }
+}
 </script>
-<style lang='scss' >
-  .addConsignee{
-  .f-box{
+<style lang="scss">
+.addConsignee {
+  .f-box {
     margin-left: 36%;
   }
-  .button-box{
+  .button-box {
     display: flex;
     justify-content: center;
-    .el-button{
+    .el-button {
       width: 80px;
       margin-right: 10px;
     }
   }
-.form-box {
+  .form-box {
     width: 100%;
     margin-top: 30px;
     display: flex;
     justify-content: center;
-    .el-form-item{
+    .el-form-item {
       display: flex;
       justify-content: center;
-      .el-form-item__label{
+      .el-form-item__label {
         display: flex;
         align-items: center;
       }
-      .el-form-item__content{
-         .el-select{
-            width: 250px;
-          }
-          .el-input{
-            width: 250px;
-          }
+      .el-form-item__content {
+        .el-select {
+          width: 250px;
+        }
+        .el-input {
+          width: 250px;
+        }
       }
     }
   }
-  }
-  
+}
 </style>