소스 검색

提交配载流程,以及修复若依get请求bug

caojunjie 4 년 전
부모
커밋
7c2548ea06

+ 14 - 4
src/api/fleet/ftmsorderbillscars.js

@@ -28,13 +28,23 @@ export function addStowage(data) {
 }
 
 
+//原来 // 撤销配车
+// export function revokeStowage(id) {
+//   return request({
+//     url: '/fleet/ftmsorderbillscars/revokeStowage/'+ id,
+//     method: 'get',
+//   })
+// }
+
 // 撤销配车
-export function revokeStowage(id) {
+export function revokeStowage(data) {
   return request({
-    url: '/fleet/ftmsorderbillscars/revokeStowage/'+ id,
-    method: 'get',
+    url: '/fleet/ftmsorderbillscars/vehicleArrangementRevokeStowage',
+    method: 'post',
+    data:data
   })
 }
+
 //原来 // 查询可配车列表
 // export function selectStowage(query) {
 //   return request({
@@ -122,7 +132,7 @@ export function singleaddFtmsorderbillscars(data) {
 //单条变更提交
 export function singleChangeFtmsorderbillscars(data) {
   return request({
-    url: '/fleet/ftmsorderbillscars/vehicleArrangementChange',
+    url: '/fleet/ftmsorderbillscars/'+ (data.billKind !== 'MH'?'vehicleArrangementChange':'vehicleArrangementAddStowage'),
     method: 'post',
     data: data
   })

+ 49 - 49
src/utils/request.js

@@ -10,7 +10,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 30000
+  timeout: 10000
 })
 // request拦截器
 service.interceptors.request.use(config => {
@@ -25,7 +25,7 @@ service.interceptors.request.use(config => {
     for (const propName of Object.keys(config.params)) {
       const value = config.params[propName];
       var part = encodeURIComponent(propName) + "=";
-      if (value && typeof(value) !== "undefined") {
+      if (value !== null && typeof(value) !== "undefined") {
         if (typeof value === 'object') {
           for (const key of Object.keys(value)) {
             let params = propName + '[' + key + ']';
@@ -43,61 +43,61 @@ service.interceptors.request.use(config => {
   }
   return config
 }, error => {
-    console.log(error)
-    Promise.reject(error)
+  console.log(error)
+  Promise.reject(error)
 })
 
 // 响应拦截器
 service.interceptors.response.use(res => {
-    // 未设置状态码则默认成功状态
-    const code = res.data.code || 200;
-    // 获取错误信息
-    const msg = errorCode[code] || res.data.msg || errorCode['default']
-    if (code === 401) {
-      MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
-          confirmButtonText: '重新登录',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      ).then(() => {
-        store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+      // 未设置状态码则默认成功状态
+      const code = res.data.code || 200;
+      // 获取错误信息
+      const msg = errorCode[code] || res.data.msg || errorCode['default']
+      if (code === 401) {
+        MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
+              confirmButtonText: '重新登录',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }
+        ).then(() => {
+          store.dispatch('LogOut').then(() => {
+            location.href = '/index';
+          })
         })
-      })
-    } else if (code === 500) {
+      } else if (code === 500) {
+        Message({
+          message: msg,
+          type: 'error'
+        })
+        return Promise.reject(new Error(msg))
+      } else if (code !== 200) {
+        Notification.error({
+          title: msg
+        })
+        return Promise.reject('error')
+      } else {
+        return res.data
+      }
+    },
+    error => {
+      console.log('err' + error)
+      let { message } = error;
+      if (message == "Network Error") {
+        message = "后端接口连接异常";
+      }
+      else if (message.includes("timeout")) {
+        message = "系统接口请求超时";
+      }
+      else if (message.includes("Request failed with status code")) {
+        message = "系统接口" + message.substr(message.length - 3) + "异常";
+      }
       Message({
-        message: msg,
-        type: 'error'
-      })
-      return Promise.reject(new Error(msg))
-    } else if (code !== 200) {
-      Notification.error({
-        title: msg
+        message: message,
+        type: 'error',
+        duration: 5 * 1000
       })
-      return Promise.reject('error')
-    } else {
-      return res.data
-    }
-  },
-  error => {
-    console.log('err' + error)
-    let { message } = error;
-    if (message == "Network Error") {
-      message = "后端接口连接异常";
+      return Promise.reject(error)
     }
-    else if (message.includes("timeout")) {
-      message = "系统接口请求超时";
-    }
-    else if (message.includes("Request failed with status code")) {
-      message = "系统接口" + message.substr(message.length - 3) + "异常";
-    }
-    Message({
-      message: message,
-      type: 'error',
-      duration: 5 * 1000
-    })
-    return Promise.reject(error)
-  }
 )
 
 export default service

+ 6 - 3
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -7578,6 +7578,9 @@ export default {
             fSealno: this.importList.fSealno,
             fFleet: this.importList.fFleet,
             remark: this.importList.remark,
+            fPlanqty: this.importList.fPlanqty,
+            fPlannetweight: this.importList.fPlannetweight,
+            fPlangrossweight: this.importList.fPlangrossweight,
           });
           if (this.detailList[0].fGoodsid) {
             for (let item in this.goodsOptions) {
@@ -7793,12 +7796,12 @@ export default {
           this.$set(this.importList, 'fPlannetweight', this.form.fPlannetweight)
           this.$set(this.importList, 'fNetweight', this.form.fNetweight)
           //录入复制
-          console.log(this.importList)
+          // console.log(this.importList)
           if (this.detailList.length !== 0) this.importList = JSON.parse(JSON.stringify(this.detailList[0]))
           // this.importList.fBusinessType = JSON.stringify(this.importList.fBusinessType)
           if (this.importList.fBusinessType) this.$set(this.importList, 'fBusinessType', typeof this.importList.fBusinessType != 'string' ? JSON.stringify(this.importList.fBusinessType) : this.importList.fBusinessType)
-          this.$set(this.importList, 'fCntrno', this.importList.fTruckno === null ? '' : this.importList.fTruckno)
-          console.log(this.importList)
+          this.$set(this.importList, 'fCntrno', this.importList.fCntrno === null ? '' : this.importList.fCntrno)
+          // console.log(this.importList)
           //结束
           this.importList.fQty = Number(
               (this.form.fPlanqty - this.sumMum).toFixed(2)

+ 11 - 18
src/views/fleet/sendcar/AddOrUpdate.vue

@@ -775,6 +775,7 @@
                     prop="orderStatus"
                 >
                   <template slot-scope="scope">
+                    <div v-if="scope.row.billStatus == 1">新建</div>
                     <div v-if="scope.row.billStatus == 2">已暂存</div>
                     <div v-if="scope.row.billStatus == 3">已撤销</div>
                     <div v-if="scope.row.billStatus >= 6">已提交</div>
@@ -1498,7 +1499,7 @@
           <!--          <el-table-column prop="mblno" label="运输性质" :show-overflow-tooltip="true"/>-->
           <el-table-column label="操作">
             <template slot-scope="scope">
-              <el-button type="text" icon="el-icon-finished" @click="stowageForm(scope.row)">配载</el-button>
+              <el-button type="text" icon="el-icon-finished" @click="stowageForm(scope.row)">确认配载</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -1591,6 +1592,7 @@ export default {
       multipleSelection: [],
       companyList: [],
       formLabelAlign: {},
+      formList: {},
       lbStatus: {},
       dcList: [
         {
@@ -1735,7 +1737,7 @@ export default {
       return moment(date).format("YYYY-MM-DD HH:mm:ss")
     },
     changeStowageRow(row) {
-      revokeStowage(row.id).then((response) => {
+      revokeStowage(row).then((response) => {
         if (response.code == 200) {
           this.msgSuccess("配载撤销成功");
           response.data.map((e, index) => {
@@ -1755,22 +1757,6 @@ export default {
     handleRowClick(row) {
       this.$refs.multipleTable.toggleRowSelection(row);
     },
-    stowageForm(row) {
-      addStowage({
-        sourceId:this.formLabelAlign.sourceId,
-        targetId:row.id
-      }).then((response) => {
-        console.log(response)
-        // if (response.code == 200) {
-        //   this.msgSuccess("配载成功");
-        //   this.stowageDialog = false;
-        //   let row = response.data;
-        //   response.data.map((e, index) => {
-        //     this.$set(this.vehicleList, index, e);
-        //   });
-        // }
-      });
-    },
     carChange(row) {
       let arr = [];
       arr = this.carManages.filter((e) => e.carNum == row.carregNo);
@@ -2143,8 +2129,15 @@ export default {
         }
       });
     },
+    // 配载跳转
+    stowageForm(row) {
+      this.showDialog = false
+      this.stowageDialog = false
+      this.$emit('stowageInquiry', row,this.formList)
+    },
     // 查询可配载数据
     selectStowage(row) {
+      this.formList = row
       this.formLabelAlign.mblno = row.mblno
       this.formLabelAlign.sourceId = row.id
       selectStowage(row).then((response) => {

+ 16 - 1
src/views/fleet/sendcar/index.vue

@@ -389,6 +389,7 @@
       :relevantAttachments="relevantAttachments"
       @changeShow="showAddOrUpdate"
       @fixDisabled="fixDisabled"
+      @stowageInquiry="stowageInquiry"
       ref="addOrUpdateRef"
     ></add-or-update>
   </div>
@@ -788,8 +789,13 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
+    /** 配载返回查询 */
+    stowageInquiry(row,res){
+      console.log(row,res)
+      this.handleUpdate(row,res)
+    },
     /** 修改按钮操作 */
-    handleUpdate(row) {
+    handleUpdate(row,res) {
       this.reset();
       const id = row.id || this.ids;
       getFtmsorderbillscars(id).then((response) => {
@@ -832,6 +838,15 @@ export default {
           });
         }
         this.vehicleList = response.data.cars;
+        if(res){
+          res.billStatus = 1
+          res.billKind = 'MH'
+          res.orderNo = ''
+          res.id = ''
+          this.$set(res, "billStatus", 5);
+          console.log(this.vehicleList)
+          this.vehicleList.push(res)
+        }
         this.relevantAttachments = response.data.attachs;
         this.addOrUpdateVisible = !this.addOrUpdateVisible;
       });

+ 1 - 1
src/views/reportManagement/whgenleg/index.vue

@@ -432,7 +432,7 @@ export default {
         pageNum: 1,
         pageSize: 50,
         fOriginalbillno: null,
-        isCntrno: 0,
+        isCntrno: 1,
         fPreqty: null,
         fLocalcntrno: null,
         fPregrossweight: null,