Browse Source

修改后台操作

liyg 2 years ago
parent
commit
4587c2e2de
1 changed files with 150 additions and 2 deletions
  1. 150 2
      src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

+ 150 - 2
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -3,7 +3,7 @@
   <div class="admin">
     <template>
       <div class="admin1">
-        <el-tabs v-model="activeName">
+        <el-tabs v-model="activeName" tab-position="left">
           <el-tab-pane label="补录计量实绩" name="first">
             <div class="switch">
               <el-switch
@@ -506,6 +506,71 @@
               >
             </div>
           </el-tab-pane>
+          <el-tab-pane label="修改装卸货信息" name="tenth">
+            <div class="admin2">
+              <el-form  class="load" label-width="80px" style="margin-left:33%">
+                  <el-form-item label="运输订单号:">
+                    <el-input class="inline-input" v-model="loadDetail.orderNumber" @change="selectLoadingIdRemark"></el-input>
+                  </el-form-item>
+                  <el-form-item label="物资:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="loadDetail.materialName"
+                      :fetch-suggestions="querySearchMaterial"
+                      placeholder="物资名"
+                      :trigger-on-focus="false"
+                      @select="handleSelectMaterial"
+                    >
+                      <template slot-scope="{ item }">
+                        <div class="name">{{ item.materialName }}</div>
+                      </template>
+                    </el-autocomplete>
+                  </el-form-item>
+                  <el-form-item label="装货点:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="loadDetail.loadingName"
+                      :fetch-suggestions="querySearchWareHouse"
+                      placeholder="装货点"
+                      :trigger-on-focus="false"
+                      @select="handleSelectLoading"
+                    >
+                      <template slot-scope="{ item }">
+                        <div class="name">{{ item.warehouseName }}</div>
+                      </template>
+                    </el-autocomplete>
+                  </el-form-item>
+                  <el-form-item label="卸货点:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="loadDetail.unloadingName"
+                      :fetch-suggestions="querySearchWareHouse"
+                      placeholder="卸货点"
+                      :trigger-on-focus="false"
+                      @select="handleSelectUnloading"
+                    >
+                      <template slot-scope="{ item }">
+                        <div class="name">{{ item.warehouseName }}</div>
+                      </template>
+                    </el-autocomplete>
+                  </el-form-item>
+                   <el-form-item label="装机备注:">
+                    <el-input  class="inline-input" v-model="loadDetail.capacityRemark"></el-input>
+                  </el-form-item>
+                   <el-form-item label="备注:">
+                    <el-input class="inline-input"  v-model="loadDetail.insertUpdateRemark"></el-input>
+                  </el-form-item>
+              </el-form>
+            </div>
+            <div class="button_box">
+              <el-button
+                type="primary"
+                @click="updateLoadingIdRemark"
+                :disabled="disabled"
+                >确认修改</el-button
+              >
+            </div>
+          </el-tab-pane>
         </el-tabs>
       </div>
     </template>
@@ -544,7 +609,8 @@ export default {
       gatePostList: [],
       enFactoryGatepost: null,
       gatePostId: null,
-      orderStatus: null
+      orderStatus: null,
+      loadDetail:{}
     }
   },
   created() {
@@ -555,6 +621,76 @@ export default {
     this.information()
   },
   methods: {
+    selectLoadingIdRemark(){
+      if(this.loadDetail.orderNumber && this.loadDetail.orderNumber.length == 21){
+        this.axios.post("/api/v1/tms/selectLoadingIdRemark",this.loadDetail).then(res=>{
+          console.log(res);
+          if(res.data.status=="succeed"){
+            this.loadDetail=res.data.data;
+          }else{
+            this.$message.error(res.data.data);
+          }
+        })
+      }else{
+        this.loadDetail={};
+      }
+    },
+    querySearchMaterial(queryString, cb) {
+      if (queryString.length < 1) {
+        return
+      }
+      this.axios
+        .get('/api/v1/uc/getMaterialByLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            cb(res.data.data)
+          }
+        })
+    },
+    handleSelectMaterial(item){
+      console.log("material:",item);
+      this.loadDetail.materialId=item.materialId;
+      this.loadDetail.materialName=item.materialName;
+    },
+    querySearchWareHouse(queryString, cb) {
+      if (queryString.length < 1) {
+        return
+      }
+      this.axios
+        .get('/api/v1/uc/getWareHouseNameLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            cb(res.data.data)
+          }
+        })
+    },
+    handleSelectLoading(item){
+      console.log("load:",item);
+      this.loadDetail.loadingId=item.warehouseId;
+      this.loadDetail.loadingName=item.warehouseName;
+    },
+    handleSelectUnloading(item){
+      console.log("unload:",item);
+      this.loadDetail.unloadingId=item.warehouseId;
+      this.loadDetail.unloadingName=item.warehouseName;
+    },
+    //修改装卸货信息
+    updateLoadingIdRemark(){
+      console.log(this.loadDetail);
+      if(!this.loadDetail.orderNumber || !this.loadDetail.loadResultId || !this.loadDetail.unloadResultId){
+        this.$message.warning("请填写正确的运输订单号");
+      }else if(!this.loadDetail.materialId || !this.loadDetail.loadingId || !this.loadDetail.unloadingId){
+        this.$message.warning("请填写物资、装卸点");
+      }else {
+        this.axios.post("/api/v1/tms/updateLoadingIdRemark",this.loadDetail).then(res=>{
+        if(res.data.status=="succeed"){
+              this.$message.success("修改成功!");
+            }else{
+              this.$message.error(res.data.data);
+            }
+        });
+      }
+    },
     linkageDeleteTransportOrder() {
       let good = ''
       let goodspa = ''
@@ -866,6 +1002,18 @@ export default {
         justify-content: center;
         margin-top: 20px;
         margin-bottom: 20px;
+        .el-input {
+          width: 250px;
+        }
+      }
+      .load {
+        align-items: center;
+        justify-content: center;
+        margin-top: 20px;
+        margin-bottom: 20px;
+        .el-input {
+          width: 250px;
+        }
       }
       .carrier {
         display: flex;