luobang il y a 2 ans
Parent
commit
fff30b8160

+ 11 - 11
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.js

@@ -84,7 +84,7 @@ export default {
     },
     // 通过请求获取数据
     requestData(options) {
-      debugger
+      console.log(options, 'options')
       console.log(options)
       let pageNum = undefined
       let pageSize = undefined
@@ -350,16 +350,16 @@ export default {
     }
   },
   watch: {
-    // requestQuery: {
-    //   deep: true,
-    //   handler(val, oldVal) {
-    //     let q = this.dataRequestQuery
-    //     for (const key in val) {
-    //       q[key] = val[key] ? val[key] : undefined
-    //     }
-    //     this.setDataRequestQuery(q)
-    //   }
-    // }
+    requestQuery: {
+      deep: true,
+      handler(val, oldVal) {
+        let q = this.dataRequestQuery
+        for (const key in val) {
+          q[key] = val[key] ? val[key] : undefined
+        }
+        this.setDataRequestQuery(q)
+      }
+    }
   },
   // 注册组件
   components: {

+ 1 - 1
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.vue

@@ -152,7 +152,7 @@ export default {
     },
     // 请求地址
     requestUrl: {
-      default: ''
+      default: '' + '&i=' + new Date()
     },
     // 请求参数 请求体中的参数
     requestQuery: {

+ 12 - 13
src/components/DilCommonUI/packages/table/src/table.js

@@ -45,7 +45,6 @@ export default {
     },
     // 通过请求获取数据
     requestData(options) {
-      // debugger
       console.log('我被调用了几次')
       let pageNum = undefined
       let pageSize = undefined
@@ -302,18 +301,18 @@ export default {
     }
   },
   watch: {
-    // requestQuery: {
-    //   deep: true,
-    //   handler(val, oldVal) {
-    //     console.log(oldVal, 'oldVal')
-    //     let q = this.dataRequestQuery
-    //     for (const key in val) {
-    //       q[key] = val[key] ? val[key] : undefined
-    //     }
-    //     console.log(q, 'q')
-    //     this.setDataRequestQuery(q)
-    //   }
-    // }
+    requestQuery: {
+      deep: true,
+      handler(val, oldVal) {
+        console.log(oldVal, 'oldVal')
+        let q = this.dataRequestQuery
+        for (const key in val) {
+          q[key] = val[key] ? val[key] : undefined
+        }
+        console.log(q, 'q')
+        this.setDataRequestQuery(q)
+      }
+    }
   },
   // 注册组件
   components: {

+ 40 - 39
src/components/DilCommonUI/packages/table/src/table.vue

@@ -52,7 +52,7 @@
             :label="scope.row.ROW_ID"
             @click.native.prevent.stop="rowClick(scope.row)"
           >
-            {{ "" }}
+            {{ '' }}
           </el-radio>
         </template>
       </el-table-column>
@@ -119,9 +119,9 @@
 </template>
 
 <script>
-import table from "./table.js";
+import table from './table.js'
 export default {
-  name: "DilTable",
+  name: 'DilTable',
   extends: table,
   props: {
     shiyHeigth: {
@@ -132,7 +132,7 @@ export default {
     },
     showSummaryList: {
       default() {
-        return [];
+        return []
       }
     },
     isHeigth: {
@@ -147,18 +147,18 @@ export default {
     },
     // 请求地址
     requestUrl: {
-      default: ""
+      default: ''
     },
     // 请求参数 请求体中的参数
     requestQuery: {
       default() {
-        return {};
+        return {}
       }
     },
     // 表头数据
     columnData: {
       default() {
-        return [];
+        return []
       }
     },
     // 是否显示序号
@@ -172,7 +172,7 @@ export default {
     // radio : 显示单选框
     // select : 显示多选框
     selectionType: {
-      default: ""
+      default: ''
     },
     // 是否在数据翻页后保留之前选中的数据(需指定 row-key)
     reserveSelection: {
@@ -182,8 +182,8 @@ export default {
     stripe: {
       default: true
     },
-    height:{
-      default:null
+    height: {
+      default: null
     },
     // Table 的高度,默认为自动高度。
     // 如果 height 为 number 类型,单位 px;
@@ -195,11 +195,11 @@ export default {
     },
     // 是否启用排序
     sortable: {
-      default: "custom"
+      default: 'custom'
     },
     // 对齐方式 left/center/right
     align: {
-      default: "center"
+      default: 'center'
     },
     // 是否带有纵向边框
     border: {
@@ -216,13 +216,13 @@ export default {
     // 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。
     rowClassName: {
       default() {
-        return ({ row, rowIndex }) => "";
+        return ({ row, rowIndex }) => ''
       }
     },
     // 单元格的 className 的回调方法,也可以使用字符串为所有单元格设置一个固定的 className。
     cellClassName: {
       default() {
-        return ({ row, rowIndex }) => "";
+        return ({ row, rowIndex }) => ''
       }
     },
     loading: {
@@ -239,7 +239,7 @@ export default {
     // 每页显示个数选择器的选项设置
     pageSizes: {
       default() {
-        return [5, 10, 20, 50, 100, 200, 1000];
+        return [5, 10, 20, 50, 100, 200, 1000]
       }
     },
     // 每页显示条目个数,支持 .sync 修饰符
@@ -248,74 +248,75 @@ export default {
     },
     //组件布局,子组件名用逗号分隔
     layout: {
-      default: "total, prev, pager, next, sizes, jumper"
+      default: 'total, prev, pager, next, sizes, jumper'
     }
   },
   watch: {
     requestUrl() {
-      this.refreshData();
+      console.log('无变化了')
+      this.refreshData()
     },
     drawer(val) {
       if (val) {
-        this.dataRadioId = null;
+        this.dataRadioId = null
       }
     }
   },
   data() {
     return {
       height: null
-    };
+    }
   },
   methods: {
     // 刷新表格数据
     refreshData() {
-      this.requestData();
+      this.requestData()
       // 多选表格清空用户的选择
-      if (this.isClear != "1") {
-        this.$refs.mainTable.clearSelection();
+      if (this.isClear != '1') {
+        this.$refs.mainTable.clearSelection()
       }
     },
     rowDbClick(row) {
-      this.$emit("rowDbClick", row);
+      this.$emit('rowDbClick', row)
     },
     toggleRowExpansion(row, expanded) {
-      this.$refs.mainTable.toggleRowExpansion(row, expanded);
+      this.$refs.mainTable.toggleRowExpansion(row, expanded)
     },
     //合计
     //表尾合计行
     getSummaries(param) {
-      const { columns, data } = param;
-      const sums = [];
+      const { columns, data } = param
+      const sums = []
       columns.forEach((column, index) => {
         //如果索引值为0,则展示‘合计’
         if (index === 0) {
-          sums[index] = "合计";
-          return;
+          sums[index] = '合计'
+          return
         }
-        console.log(column);
+        console.log(column)
         if (this.showSummaryList.includes(column.property)) {
-          const values = data.map(item => Number(item[column.property]));
+          const values = data.map(item => Number(item[column.property]))
           if (!values.every(value => isNaN(value))) {
             sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
+              const value = Number(curr)
               if (!isNaN(value)) {
-                return prev + curr;
+                return prev + curr
               } else {
-                return prev;
+                return prev
               }
-            }, 0);
-            sums[index] = sums[index].toFixed(3);
+            }, 0)
+            sums[index] = sums[index].toFixed(3)
           } else {
-            sums[index] = "N/A";
+            sums[index] = 'N/A'
           }
         }
         //遍历数组,找到符合条件的列
-      });
+      })
 
-      return sums;
+      return sums
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>

+ 182 - 169
src/views/inward/components/truckOrder/plan.vue

@@ -2,34 +2,46 @@
 <template>
   <div>
     <div style="margin:10px">
-     <el-select v-model="condition1" placeholder="请选择筛选条件"  style="width:150px" clearable>
-          <el-option
+      <el-select
+        v-model="condition1"
+        placeholder="请选择筛选条件"
+        style="width:150px"
+        clearable
+      >
+        <el-option
           v-for="item in options"
           :key="item.value"
           :label="item.label"
-          :value="item.value">
-          </el-option>
+          :value="item.value"
+        >
+        </el-option>
       </el-select>
       <el-input
-          placeholder="请输入内容"
-          v-model="input1"
-          style="width:200px"
-          clearable
+        placeholder="请输入内容"
+        v-model="input1"
+        style="width:200px"
+        clearable
       >
       </el-input>
-      <el-select v-model="condition2" placeholder="请选择筛选条件" style="width:150px" clearable>
-          <el-option
+      <el-select
+        v-model="condition2"
+        placeholder="请选择筛选条件"
+        style="width:150px"
+        clearable
+      >
+        <el-option
           v-for="item in options"
           :key="item.value"
           :label="item.label"
-          :value="item.value">
-          </el-option>
+          :value="item.value"
+        >
+        </el-option>
       </el-select>
       <el-input
-          placeholder="请输入内容"
-          v-model="input2"
-          style="width:200px"
-          clearable
+        placeholder="请输入内容"
+        v-model="input2"
+        style="width:200px"
+        clearable
       >
       </el-input>
       <span>需求时间:</span>
@@ -54,7 +66,7 @@
     </div>
     <template>
       <div>
-        <el-tabs v-model="activeName" >
+        <el-tabs v-model="activeName">
           <el-tab-pane label="待分解" name="second">
             <mergeRowTable v-bind.sync="second" ref="table1" max-height="300">
               <el-table-column fixed="right" label="操作" width="100">
@@ -100,7 +112,8 @@
             </mergeRowTable>
           </el-tab-pane>
           <el-tab-pane label="已完成" name="four">
-            <mergeRowTable v-bind.sync="four" ref="table3" max-height="300"> </mergeRowTable>
+            <mergeRowTable v-bind.sync="four" ref="table3" max-height="300">
+            </mergeRowTable>
           </el-tab-pane>
         </el-tabs>
       </div>
@@ -108,258 +121,258 @@
   </div>
 </template>
 <script>
-import { getCookie } from "@/utils/util.js";
-import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from '@/utils/util.js'
+import { sjTime } from '@/utils/sharedJsFile'
 export default {
   data() {
     return {
-      condition1:null,
-      condition2:null,
-      input1:null,
-      input2:null,
-      options:[
-          {
-          label:"用车单位",
-          value:"shipperName"
-          },
-          {
-          label:"物资名称",
-          value:"materialName"
-          },
-          {
-          label:"装货点",
-          value:"loadName"
-          },
-          {
-          label:"卸货点",
-          value:"unloadName"
-          }
+      condition1: null,
+      condition2: null,
+      input1: null,
+      input2: null,
+      options: [
+        {
+          label: '用车单位',
+          value: 'shipperName'
+        },
+        {
+          label: '物资名称',
+          value: 'materialName'
+        },
+        {
+          label: '装货点',
+          value: 'loadName'
+        },
+        {
+          label: '卸货点',
+          value: 'unloadName'
+        }
       ],
       endTime: null,
       startTime: null,
-      inputText: "",
+      inputText: '',
       carrierId: 40,
       second: {
         columnIndexs: [0, 1, 2, 3, 4, 5, 9.1, 21, 22],
-        comparison: "requirementNumber",
+        comparison: 'requirementNumber',
         // second请求数据的地址
-        requestUrl: ""
+        requestUrl: ''
       },
       third: {
         columnIndexs: [0, 1, 2, 3, 4, 5, 9.1, 21, 22],
-        comparison: "requirementNumber",
+        comparison: 'requirementNumber',
         // second请求数据的地址
-        requestUrl: ""
+        requestUrl: ''
       },
       four: {
-        requestUrl: ""
+        requestUrl: ''
       },
-      activeName: "second",
+      activeName: 'second',
       tableData: []
-    };
+    }
   },
   created() {
-    if (getCookie("orgCode") == "chengyunshang") {
+    if (getCookie('orgCode') == 'chengyunshang') {
       this.second.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" +
-        getCookie("userId");
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=' +
+        getCookie('userId')
       this.third.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" +
-        getCookie("userId");
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=' +
+        getCookie('userId')
       this.four.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" +
-        getCookie("userId");
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=' +
+        getCookie('userId')
     } else {
       this.second.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2";
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2'
       this.third.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3";
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3'
       this.four.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4";
+        '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4'
     }
   },
   methods: {
     handleClick(tab, event) {
-      console.log("zhix");
-      this.getRequestUrl();
+      console.log('zhix')
+      this.getRequestUrl()
     },
     onclick() {
-      let startTime = null;
-      let endTime = null;
+      let startTime = null
+      let endTime = null
       if (this.startTime && this.endTime) {
-        startTime = sjTime(this.startTime);
-        endTime = sjTime(this.endTime);
+        startTime = sjTime(this.startTime)
+        endTime = sjTime(this.endTime)
       }
-      let requestQuery={
-        startTime:startTime,
-        endTime:endTime
+      let requestQuery = {
+        startTime: startTime,
+        endTime: endTime
       }
-      if(this.condition1 == this.condition2){
-            requestQuery[this.condition1]=[this.input1,this.input2]
-      }else{
-          requestQuery[this.condition1]=[this.input1+'']
-          requestQuery[this.condition2]=[this.input2+'']
+      if (this.condition1 == this.condition2) {
+        requestQuery[this.condition1] = [this.input1, this.input2]
+      } else {
+        requestQuery[this.condition1] = [this.input1 + '']
+        requestQuery[this.condition2] = [this.input2 + '']
       }
-      this.second.requestQuery=requestQuery
-      this.third.requestQuery=requestQuery
-      this.four.requestQuery=requestQuery
-      if (getCookie("orgCode") == "chengyunshang") {
-      this.second.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" +
-        getCookie("userId");
-      this.third.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" +
-        getCookie("userId");
-      this.four.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" +
-        getCookie("userId");
-    } else {
-      this.second.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2";
-      this.third.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3";
-      this.four.requestUrl =
-        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4";
-    }
-      this.$forceUpdate();
+      this.second.requestQuery = requestQuery
+      this.third.requestQuery = requestQuery
+      this.four.requestQuery = requestQuery
+      if (getCookie('orgCode') == 'chengyunshang') {
+        this.second.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=' +
+          getCookie('userId')
+        this.third.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=' +
+          getCookie('userId')
+        this.four.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=' +
+          getCookie('userId')
+      } else {
+        this.second.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2'
+        this.third.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3'
+        this.four.requestUrl =
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4'
+      }
+      this.$forceUpdate()
     },
     getRequestUrl() {
-      if (getCookie("orgCode") == "chengyunshang") {
+      if (getCookie('orgCode') == 'chengyunshang') {
         this.second.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" +
-          getCookie("userId") +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=' +
+          getCookie('userId') +
+          '&i=' +
+          new Date()
         this.third.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" +
-          getCookie("userId") +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=' +
+          getCookie('userId') +
+          '&i=' +
+          new Date()
         this.four.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" +
-          getCookie("userId") +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=' +
+          getCookie('userId') +
+          '&i=' +
+          new Date()
       } else {
         this.second.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2" +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2' +
+          '&i=' +
+          new Date()
         this.third.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3" +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3' +
+          '&i=' +
+          new Date()
         this.four.requestUrl =
-          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4" +
-          "&i=" +
-          new Date();
+          '/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4' +
+          '&i=' +
+          new Date()
       }
     },
     closePlanOrder(scope) {
-      console.log(scope.row.planId);
+      console.log(scope.row.planId)
       this.$confirm(
-        "确定关闭该计划吗?该操作会将计划下未接收订单全部关闭",
-        "是否继续?",
+        '确定关闭该计划吗?该操作会将计划下未接收订单全部关闭',
+        '是否继续?',
         {
           center: true,
-          confirmButtonText: "确定",
-          cancelButtonText: "取消"
+          confirmButtonText: '确定',
+          cancelButtonText: '取消'
         }
       ).then(() => {
         this.axios
-          .post("/api/v1/oms/closeInwardOrderByPlan?planId=" + scope.row.planId)
+          .post('/api/v1/oms/closeInwardOrderByPlan?planId=' + scope.row.planId)
           .then(res => {
-            if (res.data.code == "200") {
-              this.$message.success("关闭成功");
-              this.getRequestUrl();
+            if (res.data.code == '200') {
+              this.$message.success('关闭成功')
+              this.getRequestUrl()
             } else {
-              this.$message.error("关闭失败");
+              this.$message.error('关闭失败')
             }
           })
           .catch(() => {
-            this.$message.error("关闭失败");
-          });
-      });
+            this.$message.error('关闭失败')
+          })
+      })
     },
     receiver(scope) {
-      this.$confirm("是否接收", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('是否接收', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
         center: true
       })
         .then(() => {
           this.axios
-            .post("/api/v1/ams/receiveInwardPlan/" + scope.row.planId)
+            .post('/api/v1/ams/receiveInwardPlan/' + scope.row.planId)
             .then(res => {
               if (res.data.code == 200) {
                 this.$message({
-                  type: "success",
-                  message: "接收成功!"
-                });
-                this.getRequestUrl();
+                  type: 'success',
+                  message: '接收成功!'
+                })
+                this.getRequestUrl()
               } else {
                 this.$message({
-                  message: "接收失败",
-                  type: "warning"
-                });
+                  message: '接收失败',
+                  type: 'warning'
+                })
               }
-            });
+            })
         })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "接收操作已取消!"
-          });
-        });
+            type: 'info',
+            message: '接收操作已取消!'
+          })
+        })
     },
     selectionChange(selection) {
-      this.second.mapList = selection;
+      this.second.mapList = selection
     },
     desponsePlan(scope) {
-      this.$router.push("/decomposePlan/" + scope.row.planId);
+      this.$router.push('/decomposePlan/' + scope.row.planId)
     },
     getPlanOrder(scope) {
-      this.$router.push("/getPlanOrder/" + scope.row.planId);
+      this.$router.push('/getPlanOrder/' + scope.row.planId)
     },
     Issue() {
-      console.log(this.first.mapList);
-      this.$confirm("是否下发", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      console.log(this.first.mapList)
+      this.$confirm('是否下发', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
         center: true
       })
         .then(() => {
           this.axios
             .post(
-              "/api/v1/ams/addFixedAmsDispatchSaleOrder",
+              '/api/v1/ams/addFixedAmsDispatchSaleOrder',
               this.first.mapList
             )
             .then(res => {
               if (res.data.code == 200) {
                 this.$message({
-                  type: "success",
-                  message: "下发成功!"
-                });
-                this.getRequestUrl();
+                  type: 'success',
+                  message: '下发成功!'
+                })
+                this.getRequestUrl()
               } else {
                 this.$message({
-                  message: "下发失败",
-                  type: "warning"
-                });
+                  message: '下发失败',
+                  type: 'warning'
+                })
               }
-            });
+            })
         })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "取消下发!"
-          });
-        });
+            type: 'info',
+            message: '取消下发!'
+          })
+        })
     }
   }
-};
+}
 </script>
 <style lang="scss">
 .inwardDisPlan {

+ 5 - 2
src/views/statisticalReport/components/salesLogisticsStatistics/yawnReport.vue

@@ -360,8 +360,11 @@ export default {
                 (countRow.unloadThoWeight * 1000 +
                   item.unloadThoWeight * 1000) /
                 1000
-              countRow.trainWeight += item.trainWeight
-              countRow.trainThoWeight += item.trainThoWeight
+              countRow.trainWeight =
+                (item.trainWeight * 1000 + countRow.trainWeight * 1000) / 1000
+              countRow.trainThoWeight =
+                (item.trainThoWeight * 1000 + countRow.trainThoWeight * 1000) /
+                1000
             }
           })
           if (countRow.planNum) {