luobang 3 vuotta sitten
vanhempi
commit
240c4dc67a

+ 1 - 1
build/utils.js

@@ -18,7 +18,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // let devModules = ['index','inward']
 // let devModules = ['index','appoint','sale','statisticalReport']
 // let devModules = ['index','sale']
-// let devModules = ['index','appoint']
+// let devModules = ['index','statisticalReport','inward','sale']
 let devModules = ['all']
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;

+ 1 - 1
config/index.js

@@ -66,7 +66,7 @@ let proxyTable = {
   "/api/v1": {
       target: "http://172.16.33.166:8080",
     //  target: "http://localhost:8080",
-    // target: "http://192.168.1.104:8080",
+    // target: "http://192.168.1.106:8080",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"

+ 19 - 0
src/assets/excel/Export2Excel.js

@@ -132,6 +132,25 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
     var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
  
  
+    /* add worksheet to workbook */
+    wb.SheetNames.push(ws_name);
+    wb.Sheets[ws_name] = ws;
+ 
+    var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
+    var title = defaultTitle || '列表'
+    saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx")
+}
+export function exportJsonToExcel(th, jsonData, defaultTitle) {
+ 
+    /* original data */
+ 
+    var data = jsonData;
+    data.unshift(th);
+    var ws_name = "SheetJS";
+ 
+    var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
+ 
+ 
     /* add worksheet to workbook */
     wb.SheetNames.push(ws_name);
     wb.Sheets[ws_name] = ws;

+ 0 - 3
src/components/DilCommonUI/packages/table/src/table.vue

@@ -255,10 +255,7 @@ export default {
     refreshData() {
       this.requestData();
       // 多选表格清空用户的选择
-      console.log("我正在执行这里");
-      console.log(this.isClear);
       if (this.isClear != "1") {
-        console.log("我正在执行这里1");
         this.$refs.mainTable.clearSelection();
       }
     },

+ 24 - 0
src/utils/exportExcelAdvanced.JS

@@ -0,0 +1,24 @@
+/**
+ * 导出excel的高级版本
+ * luobang
+ * 2022-05-09 有待进一步优化
+ */
+// 导出Excel全局组件
+export function exportExcelAdvanced(tableTitle, tableColumnData, tableData) {
+    let tHeader = [];
+    let filterVal = [];
+    tableColumnData.forEach(e => {
+    if (tHeader.indexOf(e.label) === -1) {
+          tHeader.push(e.label);
+    };
+    if (filterVal.indexOf(e.prop) === -1) {
+          filterVal.push(e.prop);
+    };
+    });
+    // this.downloadLoading = true;
+    require.ensure([], () => {
+    const { exportJsonToExcel } = require('@/assets/excel/Export2Excel.js');
+    let data = tableData.map(v => filterVal.map(j => v[j]));
+    exportJsonToExcel(tHeader, data, tableTitle);
+    });
+ }

+ 37 - 36
src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue

@@ -275,18 +275,18 @@ export default {
         {
           prop: "capacityNumber",
           label: "车牌号",
-          width: "140",
+          width: "140"
         },
         {
           prop: "carrierName",
           label: "承运商",
-          width: "140",
+          width: "140"
         },
         {
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true,
-        },
+          slot: true
+        }
       ],
       //发货单位名称
       supplierName: "",
@@ -320,31 +320,31 @@ export default {
       frist: {
         requestUrl: "",
         selectionType: "radio",
-        mapList1: [],
+        mapList1: []
       },
       secend: {
         requestUrl: "",
         selectionType: "radio",
-        mapList2: [],
+        mapList2: []
       },
       third: {
         requestUrl: "",
         selectionType: "select",
-        mapList3: [],
+        mapList3: []
       },
       unloadPoint: {
         requestUrl: "",
-        selectionType: "radio",
+        selectionType: "radio"
       },
       line: {
         requestUrl: "",
-        selectionType: "radio",
+        selectionType: "radio"
       },
       purchaseOrder: {
         requestUrl: "",
-        selectionType: "radio",
+        selectionType: "radio"
       },
-      truckList: [],
+      truckList: []
     };
   },
   watch: {
@@ -359,17 +359,17 @@ export default {
         this.tableTop.push({
           prop: "orderMaterialNumber",
           label: "件数",
-          slot: true,
+          slot: true
         });
       } else {
         this.tableTop.splice(this.tableTop.length - 1, 1);
         this.tableTop.push({
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true,
+          slot: true
         });
       }
-    },
+    }
   },
   created() {
     if (getCookie("orgCode") == "chengyunshang") {
@@ -397,7 +397,7 @@ export default {
     querySearchSupplier(queryString, cb) {
       this.axios
         .post("/api/v1/uc/getSupplierMesByLike?index=" + this.stateSupplier)
-        .then((res) => {
+        .then(res => {
           if (res.data.code == "200") {
             var restaurantsSupplier = res.data.data;
             var results = queryString
@@ -411,7 +411,7 @@ export default {
         });
     },
     createFilterSupplier(queryString) {
-      return (restaurantsSupplier) => {
+      return restaurantsSupplier => {
         return (
           restaurantsSupplier.value
             .toLowerCase()
@@ -422,20 +422,20 @@ export default {
     getPurchaseOrderNo() {
       let map = {
         materialId: this.materialId,
-        supplierId: this.supplierId,
+        supplierId: this.supplierId
       };
       if (this.remark) {
         map.remark = this.remark;
       }
       console.log(this.map);
       if (this.materialId && this.supplierId) {
-        this.axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
+        this.axios.post("/api/v1/oms/selectNewOrderId", map).then(res => {
           console.log(res);
           if (res.data.code == "200") {
             if (res.data.data == null) {
               this.$message({
                 message: "没有匹配的采购订单号!",
-                type: "warning",
+                type: "warning"
               });
               this.form1 = [];
               this.purchaseOrderId = null;
@@ -643,37 +643,37 @@ export default {
         if (!this.materialId) {
           this.$message({
             message: "请选择物资!",
-            type: "warning",
+            type: "warning"
           });
           return;
         } else if (!this.supplierId) {
           this.$message({
             message: "请选择发货单位!",
-            type: "warning",
+            type: "warning"
           });
           return;
         } else if (!this.purchaseOrderId) {
           this.$message({
             message: "没有匹配的采购订单号!",
-            type: "warning",
+            type: "warning"
           });
           return;
         } else if (!this.unloadPointId) {
           this.$message({
             message: "请选择卸货地点!",
-            type: "warning",
+            type: "warning"
           });
           return;
         } else if (!this.lineId) {
           this.$message({
             message: "请选择运输路线!",
-            type: "warning",
+            type: "warning"
           });
           return;
         } else if (!sjTime(this.form1.orderEntryTime)) {
           this.$message({
             message: "请选择预估进厂时间!",
-            type: "warning",
+            type: "warning"
           });
           return;
         }
@@ -681,11 +681,11 @@ export default {
       if (this.selectionList.length == 0) {
         this.$message({
           message: "请选择车辆!",
-          type: "warning",
+          type: "warning"
         });
         return;
       } else {
-        this.selectionList.forEach((e) => {
+        this.selectionList.forEach(e => {
           if (e.orderMaterialWeight) {
             if (isNumber(e.orderMaterialWeight)) {
               if (isIntegerNumber(e.orderMaterialWeight)) {
@@ -693,14 +693,14 @@ export default {
               } else {
                 this.$message({
                   message: "重量只能是整数!",
-                  type: "warning",
+                  type: "warning"
                 });
                 return;
               }
             } else {
               this.$message({
                 message: "重量只能是数字!",
-                type: "warning",
+                type: "warning"
               });
               return;
             }
@@ -717,25 +717,26 @@ export default {
         orderType: this.orderType,
         lineId: this.lineId,
         isMoreTrips: this.isMoreTrips,
-        orgCode: getCookie("orgCode"),
+        userId: getCookie("userId"),
+        orgCode: getCookie("orgCode")
       };
 
-      this.axios.post("/api/v1/oms/addPurOrder", map).then((res) => {
+      this.axios.post("/api/v1/oms/addPurOrder", map).then(res => {
         if (res.data.code == "200") {
           this.$message({
             message: "添加成功!",
-            type: "success",
+            type: "success"
           });
           this.$router.push("/transportReserveFu");
         } else {
           this.$message({
             message: res.data.data,
-            type: "warning",
+            type: "warning"
           });
         }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss">
@@ -898,4 +899,4 @@ export default {
   width: 100%;
   height: 100px;
 }
-</style>
+</style>

+ 34 - 15
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -164,6 +164,7 @@
           :key="i"
           :prop="item.prop"
           :label="item.label"
+          :width="item.width"
           align="center"
           show-overflow-tooltip
         >
@@ -365,7 +366,7 @@
               <template v-if="item.prop == 'truckRemark'">
                 <el-input
                   class="textinput5"
-                  placeholder="(必填)"
+                  placeholder="(必填)"
                   v-model.number="scope.row.truckRemark"
                   @change="batchUpdateValue(scope.row, scope.$index)"
                 ></el-input>
@@ -670,8 +671,7 @@ export default {
       materialTableTop: [
         {
           prop: "materialName",
-          label: "物资名称",
-          width: "140"
+          label: "物资名称"
         },
         {
           prop: "meterNumber",
@@ -680,8 +680,7 @@ export default {
         },
         {
           prop: "Specification",
-          label: "规格型号",
-          width: "140"
+          label: "规格型号"
         },
         {
           prop: "orderPlanWeight",
@@ -797,53 +796,52 @@ export default {
         {
           prop: "cxh",
           label: "车序号",
-          width: "50"
+          width: "50px"
         },
         {
           prop: "materialName",
           label: "物资名称",
-          width: "300",
+          width: "300px",
           slot: true
         },
         {
           prop: "meterNumber",
           label: "米数",
-          width: "60",
+          width: "60px",
           slot: true
         },
         {
           prop: "Specification",
           label: "规格型号",
-          width: "140"
+          width: "140px"
         },
         {
           prop: "orderPlanWeight",
           label: "件数",
-          width: "60",
+          width: "60px",
           slot: true
         },
         {
           prop: "isPound",
           label: "是否磅重销售",
-          width: "80",
+          width: "80px",
           slot: true
         },
         {
           prop: "saleShipperAddressName",
           label: "收货地址",
-          width: "300",
+          width: "400px",
           slot: true
         },
         {
           prop: "saleOrderConsigneeTel",
           label: "收货客户电话",
-          width: "120",
+          width: "120px",
           slot: true
         },
         {
           prop: "truckRemark",
           label: "备注",
-          width: "140",
           slot: true
         }
       ],
@@ -1098,7 +1096,6 @@ export default {
           };
         } else {
           if (e.materialName.includes("米")) {
-            console.log(e.materialName.replace(/[^0-9]/gi, ""));
             var addmap = {
               materialName: e.materialName,
               Specification: e.materialSpecification + e.materialModel,
@@ -1181,6 +1178,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.materialList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       if (
         !this.saleOrderConsigneeTel &&
         this.ignoreSaleOrderConsigneeTel == 0
@@ -1573,6 +1581,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.selectionList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       //获取是否自提字段
       this.options.forEach(e => {
         if (this.values == e.values) {

+ 33 - 0
src/views/appoint/components/saleContract/editSaleOrder.vue

@@ -1247,6 +1247,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.materialList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       if (
         !this.saleOrderConsigneeTel &&
         this.ignoreSaleOrderConsigneeTel == 0
@@ -1376,6 +1387,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.materialList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       if (this.materialList.length == 0) {
         this.$message.warning("请至少为这车序号添加一个物资!");
       } else {
@@ -1749,6 +1771,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.selectionList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       //获取是否自提字段
       this.options.forEach(e => {
         if (this.values == e.values) {

+ 559 - 18
src/views/appoint/components/saleContract/updateSaleOrderSteel.vue

@@ -8,7 +8,9 @@
         clearable
       ></el-input>
       <el-button type="primary" @click="onclick">查询</el-button>
-      <el-button type="primary" @click="back">返回</el-button>
+      <el-button type="primary" @click="back" icon="el-icon-d-arrow-left"
+        >返回</el-button
+      >
     </div>
     <!-- //物资模态框多选 -->
     <div class="edrwer">
@@ -66,6 +68,62 @@
         </div>
       </el-drawer>
     </div>
+    <!-- //物资模态框单选 -->
+    <div class="edrwer">
+      <!-- 物资选择模态框 -->
+      <el-drawer
+        title="选择物资信息"
+        :visible.sync="currentTable"
+        direction="rtl"
+        size="90%"
+        :show-close="true"
+      >
+        <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;"
+              >物资名称/型号</label
+            >
+          </el-form-item>
+          <el-form-item>
+            <el-input
+              placeholder="请输入物资名称或型号"
+              v-model="materialNameText"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;">规格</label>
+          </el-form-item>
+          <el-form-item>
+            <el-input
+              placeholder="请输入内容"
+              v-model="materialSpecificationText"
+              clearable
+              ><template slot="prepend">Φ</template></el-input
+            >
+          </el-form-item>
+          <el-button
+            type="primary"
+            class="btn"
+            @click="onclick1"
+            style="margin-left: 4px;"
+            ><i class="el-icon-search"></i>查询</el-button
+          >
+          <el-button type="primary" @click="makeSureChange"
+            ><i class="el-icon-check"></i>确定</el-button
+          >
+        </el-form>
+        <div class="tablecls">
+          <!-- 查询所有的物资 -->
+          <dilTable
+            v-bind.sync="option1"
+            @radio-change="currentRadioChange"
+            @rowDbClick="rowDbClick1"
+          >
+          </dilTable>
+        </div>
+      </el-drawer>
+    </div>
     <div class="table">
       <el-table
         :data="tableData"
@@ -113,7 +171,8 @@
       <el-dialog
         :title="title"
         :visible.sync="dialogTableVisible"
-        style="width:100%"
+        :center="true"
+        width="1100px"
       >
         <div class="errorMaterial">
           <el-button @click="openDrawer" type="primary">新增拼数</el-button>
@@ -131,6 +190,7 @@
               :key="i"
               :prop="item.prop"
               :label="item.label"
+              :width="item.width"
               align="center"
               show-overflow-tooltip
             >
@@ -145,6 +205,11 @@
                       disabled
                     >
                     </el-input>
+                    <el-button
+                      type="primary"
+                      @click="changeMaterial(scope.$index)"
+                      >更改</el-button
+                    >
                   </template>
                   <!-- 物资件数 -->
                   <template v-if="item.prop == 'orderPlanWeight'">
@@ -157,6 +222,7 @@
                   <!-- 米数 -->
                   <template v-if="item.prop == 'meterNumber'">
                     <el-input
+                      v-if="scope.row.haveMeter == 1"
                       :disabled="scope.row.isDisable == 1"
                       class="textinput111"
                       v-model.number="scope.row.meterNumber"
@@ -210,12 +276,92 @@
         </div>
       </el-dialog>
     </div>
+    <div class="addressDialog">
+      <!-- 收货地址弹出框 -->
+      <el-dialog title="收货地址" :visible.sync="addressDialog" width="90%">
+        <div class="addressItem">
+          <el-form :inline="true">
+            <el-form-item>
+              <label class="el-form-item__label" style="width: auto;">省</label>
+              <el-select
+                v-model="province"
+                filterable
+                placeholder="请选择"
+                @change="onchangeProvince"
+              >
+                <el-option
+                  v-for="item in provinceList"
+                  :key="item.id"
+                  :label="item.addressProvince"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <label class="el-form-item__label" style="width: auto;">市</label>
+              <el-select
+                v-model="city"
+                filterable
+                placeholder="请选择"
+                @change="onchangeCity"
+              >
+                <el-option
+                  v-for="item in cityList"
+                  :key="item.id"
+                  :label="item.addressDistrict"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <label class="el-form-item__label" style="width: auto;"
+                >县(区)</label
+              >
+              <el-select
+                v-model="county"
+                filterable
+                placeholder="请选择"
+                @change="onchangeCounty"
+              >
+                <el-option
+                  v-for="item in countyList"
+                  :key="item.id"
+                  :label="item.addressTown"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <label class="el-form-item__label" style="width: auto;"
+                >具体收货地址</label
+              >
+              <el-autocomplete
+                class="inline-input"
+                v-model="place"
+                :fetch-suggestions="querySearch1"
+                placeholder="请输入具体收货地址"
+                :trigger-on-focus="false"
+                @select="handleSelect1"
+              >
+              </el-autocomplete>
+            </el-form-item>
+          </el-form>
+        </div>
+
+        <div slot="footer" class="button-box">
+          <el-button @click="addressDialog = false">取 消</el-button>
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      addressDialog: false,
+      currentTable: false,
       title: "",
       capacityNumber: null,
       //是否磅重销售
@@ -244,10 +390,17 @@ export default {
       //物资表格多选
       option: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/uc/getSteelMaterial?apiId=244",
+        requestUrl: "",
         // 控制显示多选列
         selectionType: "select"
       },
+      //物资表格单选
+      option1: {
+        // 表格请求数据的地址
+        requestUrl: "",
+        // 控制显示单选列
+        selectionType: "radio"
+      },
       materialSpecificationText: null,
       materialNameText: null,
       spanArr: [],
@@ -255,47 +408,374 @@ export default {
         {
           prop: "capacityNumber",
           label: "车牌号",
-          width: "80"
+          width: "100px"
         },
         {
           prop: "materialName",
           label: "物资名称",
-          width: "90",
+          width: "400px",
           slot: true
         },
         {
           prop: "meterNumber",
           label: "米数",
-          width: "60",
+          width: "100px",
           slot: true
         },
         {
           prop: "Specification",
           label: "规格型号",
-          width: "140"
+          width: "140px"
         },
         {
           prop: "orderPlanWeight",
           label: "件数",
-          width: "60",
+          width: "100px",
           slot: true
         },
         {
           prop: "isPound",
           label: "是否磅重销售",
-          width: "80",
+          width: "100px",
           slot: true
         }
       ],
-      orderId: null
+      orderId: null,
+      selectedMaterialCode: null,
+      selectedMaterialModel: null,
+      selectedMaterialSpecification: null,
+      selectedMaterialName: null,
+      selectedMaterialId: null,
+      //所有省
+      provinceList: [],
+      //选中的省
+      province: "",
+      //所有市
+      cityList: [],
+      //选中的市
+      city: "",
+      //所有的县(区)
+      countyList: [],
+      //选中的县
+      county: "",
+      //判断是内层还是外层点击的收货地址浏览
+      inOrOut: 0,
+      //地址输入框的值
+      addresText: "",
+      //已选中省市县
+      address: null,
+      //具体地址
+      place: null,
+      //暂存具体地址
+      place1: null,
+      //省市县Id
+      addressId: null,
+      orderSaleMap: {},
+      isNewCar: null
     };
   },
+  watch: {
+    dialogTableVisible() {
+      this.getOrderList();
+    }
+  },
   mounted() {
     this.getOrderList();
+    this.getAllProvince();
   },
   methods: {
-    updateAddress(scope) {},
+    updateAddress(scope) {
+      this.capacityNumber = scope.row.capacityNumber;
+      this.orderSaleMap = scope.row;
+      console.log(this.orderSaleMap);
+      let title = `请选择对-${scope.row.capacityNumber}-进行的操作?`;
+      let confirmText = `删除-${scope.row.capacityNumber}-金蝶分录`;
+      let cancelText = `不删除-${scope.row.capacityNumber}-金蝶分录`;
+      this.$confirm(title, "提示", {
+        confirmButtonText: confirmText,
+        cancelButtonText: cancelText,
+        distinguishCancelAndClose: true,
+        center: true,
+        type: "info"
+      })
+        .then(() => {
+          this.deleteEasEntryId(scope.row);
+        })
+        .catch(action => {
+          console.log(action);
+          if (action === "cancel") {
+            this.noDeleteEasEntryId();
+          }
+        });
+    },
+    //删除金蝶分录
+    deleteEasEntryId(row) {
+      let title = `确定删除-${this.capacityNumber}-金蝶分录?`;
+      this.$confirm(title, {
+        confirmButtonText: "是",
+        cancelButtonText: "否",
+        center: true,
+        type: "warning"
+      })
+        .then(() => {
+          let map = row;
+          map.isCloseEas = Number(0);
+          map.saleOrderId = this.$route.params.saleOrderId;
+          this.axios.post("/api/v1/ams/updateCarAddress", map).then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("删除成功");
+            } else {
+              this.$message.error("删除失败");
+            }
+          });
+        })
+        .catch(() => {
+          this.$message.info("取消删除");
+        });
+    },
+    //不删除金蝶分录,继续选择
+    noDeleteEasEntryId() {
+      let title = `请选择对-${this.capacityNumber}-进行的操作?`;
+      let confirmText = `仅更换-${this.capacityNumber}-的收货地址`;
+      this.$confirm(title, {
+        confirmButtonText: confirmText,
+        cancelButtonText: "更换地址且换车",
+        center: true,
+        distinguishCancelAndClose: true,
+        type: "info"
+      })
+        .then(() => {
+          this.onlyUpdateAddress();
+        })
+        .catch(action => {
+          if (action === "cancel") {
+            this.updateAddressAndCar();
+          }
+        });
+    },
+    onlyUpdateAddress() {
+      let title = `仅更换-${this.capacityNumber}-的收货地址吗`;
+      this.$confirm(title, {
+        confirmButtonText: "是",
+        cancelButtonText: "否",
+        center: true,
+        type: "warning"
+      }).then(() => {
+        this.addressDialog = true;
+        this.isNewCar = 1;
+      });
+    },
+    //收货地址弹出层
+    handleSelect1(item) {
+      console.log("获取所有下拉值!");
+    },
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb) {
+      this.axios
+        .post(
+          "/api/v1/ams/getRealAddressByLike?addressId=" +
+            this.addressId +
+            "&index=" +
+            queryString
+        )
+        .then(res => {
+          if (res.data.code == "200") {
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return restaurants => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+    //监听收货地址模态框点击事件
+    currentRadioChange1(radioList) {
+      this.addressId = radioList.addressId;
+      this.address = radioList.address;
+    },
+    //确定收货地址事件
+    addAddressClick() {
+      let map = this.orderSaleMap;
+      map.isCloseEas = Number(1);
+      map.isNewCar = Number(this.isNewCar);
+      map.saleOrderId = this.$route.params.saleOrderId;
+      map.place = this.place;
+      map.shipperAddressId = this.addressId;
+      this.axios.post("/api/v1/ams/updateCarAddress", map).then(res => {
+        if (res.data.code == "200") {
+          this.$message.success("修改成功");
+          this.getOrderList();
+        } else {
+          this.$message.error("修改失败");
+          this.getOrderList();
+        }
+      });
+      this.addressDialog = false;
+      //初始化
+      this.addressId = null;
+      this.province = null;
+      this.cityList = [];
+      this.city = null;
+      this.countyList = [];
+      this.county = null;
+      //暂存具体地址
+      this.place1 = this.place;
+      this.place = null;
+      this.addresText = null;
+    },
+    updateAddressAndCar() {
+      this.$confirm("确定修改收货地址且换车?将会解除授权!", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        center: true,
+        type: "warning"
+      })
+        .then(() => {
+          this.addressDialog = true;
+          this.isNewCar = 0;
+        })
+        .catch(() => {
+          this.$message.info("取消");
+        });
+    },
+    //获取所有省数据
+    getAllProvince() {
+      this.axios.post("/api/v1/uc/getAllProvince").then(res => {
+        this.provinceList = res.data.data;
+      });
+    },
+    //省改变
+    onchangeProvince() {
+      this.axios
+        .post(
+          "/api/v1/uc/getDistrictByProvince?addressProvince=" + this.province
+        )
+        .then(res => {
+          this.cityList = res.data.data;
+        });
+    },
+    //市改变
+    onchangeCity() {
+      this.axios
+        .post("/api/v1/uc/getTownByDistrict?addressDistrict=" + this.city)
+        .then(res => {
+          this.countyList = res.data.data;
+        });
+    },
+    //县(区)改变
+    onchangeCounty() {
+      let mapValue = {
+        addressProvince: this.province,
+        addressDistrict: this.city,
+        addressTown: this.county
+      };
+      this.axios.post("/api/v1/uc/getPlaceByAllAddress", mapValue).then(res => {
+        this.addressId = res.data.data[0].addressId;
+      });
+    },
+    rowDbClick1(row) {
+      this.selectedMaterialId = row.materialId;
+      this.selectedMaterialName = row.materialName;
+      this.selectedMaterialSpecification = row.materialSpecification;
+      this.selectedMaterialModel = row.materialModel;
+      this.selectedMaterialCode = row.materialCode;
+      this.makeSureChange();
+    },
+    //更改行物资
+    changeMaterial(index) {
+      this.option1.requestUrl =
+        "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
+      this.currentTable = true;
+      this.materialNameText = null;
+      this.materialSpecificationText = null;
+      this.isOpenDrawer = 1;
+      this.indexChangeMaterial = index;
+    },
+    //单选一行物资
+    currentRadioChange(row) {
+      this.selectedMaterialId = row.materialId;
+      this.selectedMaterialName = row.materialName;
+      this.selectedMaterialSpecification = row.materialSpecification;
+      this.selectedMaterialModel = row.materialModel;
+      this.selectedMaterialCode = row.materialCode;
+    },
+    //确认物资修改
+    makeSureChange() {
+      if (!this.selectedMaterialId) {
+        this.$message.warning("请先选择一个物资!");
+      } else {
+        if (!this.selectedMaterialSpecification) {
+          this.selectedMaterialSpecification = "";
+        }
+        if (!this.selectedMaterialModel) {
+          this.selectedMaterialModel = "";
+        }
+        //记录是理重还是磅重
+        var getisPound = 1;
+        //判断物资是否为盘螺或非定尺
+        if (
+          this.selectedMaterialName.includes("盘螺") ||
+          this.selectedMaterialName.includes("乱尺") ||
+          this.selectedMaterialName.includes("盘元") ||
+          this.selectedMaterialName.includes("盘圆")
+        ) {
+          getisPound = 0;
+        } else {
+          getisPound = 1;
+        }
+        this.materialList[
+          this.indexChangeMaterial
+        ].materialId = this.selectedMaterialId;
+        this.materialList[
+          this.indexChangeMaterial
+        ].materialName = this.selectedMaterialName;
+        this.materialList[this.indexChangeMaterial].Specification =
+          this.selectedMaterialSpecification + this.selectedMaterialModel;
+        this.materialList[
+          this.indexChangeMaterial
+        ].materialCode = this.selectedMaterialModel;
+        this.materialList[this.indexChangeMaterial].isPound = getisPound;
+        //确定更改的物资有无米数
+        if (
+          this.selectedMaterialName.includes("盘螺") ||
+          this.selectedMaterialName.includes("盘圆") ||
+          this.selectedMaterialName.includes("盘元")
+        ) {
+          console.log("执行了这里");
+          this.materialList[this.indexChangeMaterial].haveMeter = 0;
+          this.materialList[this.indexChangeMaterial].meterNumber = null;
+        } else {
+          this.materialList[this.indexChangeMaterial].haveMeter = 1;
+          this.materialList[this.indexChangeMaterial].isDisable = 0;
+          this.materialList[this.indexChangeMaterial].meterNumber = null;
+        }
+        //重新初始化
+        this.indexChangeMaterial = null;
+        this.selectedMaterialId = null;
+        this.selectedMaterialName = null;
+        this.selectedMaterialSpecification = null;
+        this.selectedMaterialModel = null;
+        this.selectedMaterialCode = null;
+        //关闭弹出框
+        this.currentTable = false;
+        this.isOpenDrawer = 0;
+        //初始化查询数据
+        this.materialNameText = null;
+        this.materialSpecificationText = null;
+      }
+    },
     cancelUpdateMaterial() {
+      this.getOrderList();
       this.dialogTableVisible = false;
     },
     makeSureUpdateMaterial() {
@@ -325,6 +805,17 @@ export default {
         this.$message.error("件数必填且请输入正整数");
         return;
       }
+      this.materialList.forEach(e => {
+        if (e.materialName.includes("定尺")) {
+          if (!e.meterNumber) {
+            i++;
+          }
+        }
+      });
+      if (i != 0) {
+        this.$message.error("定尺必须填写米数");
+        return;
+      }
       this.dialogTableVisible = false;
       this.orderId = null;
       this.saleOrderMaterialId = null;
@@ -342,7 +833,13 @@ export default {
       this.axios
         .post("/api/v1/ams/updateAllMaterialInSale", mapVal)
         .then(res => {
-          console.log(res);
+          if (res.data.code == "200") {
+            this.$message.success("修改成功!");
+            this.getOrderList();
+          } else {
+            this.$message.warning("修改失败");
+            this.getOrderList();
+          }
         });
     },
     makeSureMaterial() {
@@ -382,11 +879,11 @@ export default {
             meterNumber: null,
             isPound: getisPound,
             //物资Id
-            materialId: e.materialId
+            materialId: e.materialId,
+            haveMeter: 0
           };
         } else {
           if (e.materialName.includes("米")) {
-            console.log("着");
             var addmap = {
               capacityNumber: this.capacityNumber,
               orderId: this.orderId,
@@ -394,10 +891,12 @@ export default {
               Specification: e.materialSpecification + e.materialModel,
               materialCode: e.materialCode,
               orderPlanWeight: null,
+              haveMeter: 1,
               meterNumber: e.materialName.replace(/[^0-9]/gi, ""),
               isPound: getisPound,
               //物资Id
-              materialId: e.materialId
+              materialId: e.materialId,
+              isDisable: 1
               //有米数
             };
             console.log(addmap);
@@ -411,6 +910,7 @@ export default {
               orderPlanWeight: null,
               meterNumber: null,
               isPound: getisPound,
+              haveMeter: 1,
               //物资Id
               materialId: e.materialId
             };
@@ -432,6 +932,11 @@ export default {
       this.makeSureMaterial();
     },
     openDrawer() {
+      this.option.requestUrl =
+        "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
+      this.materialModelText = null;
+      this.materialSpecificationText = null;
+      this.materialNameText = null;
       this.table1 = true;
     },
     //返回选中的物资信息
@@ -445,7 +950,18 @@ export default {
         "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
         this.materialNameText +
         "&materialSpecificationText=" +
-        this.materialSpecificationText;
+        this.materialSpecificationText +
+        "&i=" +
+        new Date();
+    },
+    onclick1() {
+      this.option1.requestUrl =
+        "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
+        this.materialNameText +
+        "&materialSpecificationText=" +
+        this.materialSpecificationText +
+        "&i=" +
+        new Date();
     },
     //开关是否删除
     showDelete() {
@@ -456,12 +972,25 @@ export default {
       this.status = 1;
     },
     updateMaterial(scope) {
+      this.materialList = [];
       this.materialList = this.tableData.filter((item, index) => {
         return item.orderId == scope.row.orderId;
       });
       this.materialList.forEach(e => {
         this.capacityNumber = e.capacityNumber;
         this.orderId = e.orderId;
+        if (
+          e.materialName.includes("盘螺") ||
+          e.materialName.includes("盘圆") ||
+          e.materialName.includes("盘元")
+        ) {
+          e.haveMeter = 0;
+        } else {
+          e.haveMeter = 1;
+          if (e.materialName.includes("米")) {
+            e.isDisable = 1;
+          }
+        }
       });
       this.getSpanArr1(this.materialList);
       this.title = "处理" + "-" + this.capacityNumber + "-" + "异常物资信息";
@@ -476,14 +1005,15 @@ export default {
             new Date()
         )
         .then(res => {
+          this.tableData = [];
           this.tableData = res.data.data;
           this.getSpanArr(this.tableData);
         });
     },
-    onclick() {},
     back() {
       this.$router.push("/saleOrderSteel");
     },
+    //合并方法
     getSpanArr1(data) {
       //每次调用方法初始化
       this.spanArr1 = [];
@@ -570,12 +1100,23 @@ export default {
     margin-left: 20px;
   }
   .dialog {
-    width: 600px;
     .buttonx {
       display: flex;
       justify-content: center;
       align-items: center;
     }
   }
+  .addressDialog {
+    .addressDialog {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+    .button-box {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+  }
 }
 </style>

+ 2 - 2
src/views/inward/components/truckAppoint/requirement.vue

@@ -13,8 +13,8 @@
         @click="toInsert2"
         v-if="activeName == 'first'"
       >
-        <i class="el-icon-plus"></i>新增 </el-button
-      >w
+        <i class="el-icon-plus"></i>新增
+      </el-button>
     </div>
     <template>
       <div>

+ 42 - 47
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -15,7 +15,7 @@
       <div class="in_transit_information2">
         <span class="item_details">时间段:</span>
         <el-date-picker
-         style="width:200px"
+          style="width:200px"
           class="date_picker_style"
           v-model="time[0]"
           @change="changeTime"
@@ -31,7 +31,7 @@
           @change="changeTime"
           type="time"
           format="yyyy-MM-dd HH:mm:ss"
-           placeholder="结束日期"
+          placeholder="结束日期"
         >
         </el-date-picker>
         <!-- <el-date-picker
@@ -134,7 +134,7 @@
       <el-button type="primary" @click="slow">慢速</el-button>
       <el-button type="success" @click="middle">中速</el-button>
       <el-button type="danger" @click="fast">快速</el-button>
-      <el-button type="success" @click="addProgress" plain>快进</el-button> 
+      <el-button type="success" @click="addProgress" plain>快进</el-button>
       <el-button type="danger" @click="stop" plain>暂停</el-button>
       <el-button type="success" @click="play" plain>开始</el-button>
     </el-row>
@@ -202,8 +202,8 @@ export default {
           label: "60分钟"
         },
         {
-        value: 36000000,
-        label: "关闭"
+          value: 36000000,
+          label: "关闭"
         }
       ],
       //选择离线时长
@@ -235,8 +235,8 @@ export default {
           label: "60分钟"
         },
         {
-        value: 36000000,
-        label: "关闭"
+          value: 36000000,
+          label: "关闭"
         }
       ],
       //二、 展示相关
@@ -380,38 +380,24 @@ export default {
       return Date.parse(dateStr);
     },
     //校验查询时间
-    changeTime() {
-      let that = this;
-      console.log("that.time")
-      console.log(that.time)
-     
-      if(that.time!=null&&that.time.length==2){
-        if (that.time[1].getTime() - that.time[0].getTime() > 86400000 * 3) {
-          this.$message.error("时间查询范围不能超过3天");
-          that.time = [];
-        }else if(that.time[1].getTime()<that.time[0].getTime()){
-           this.$message.error("开始时间要大于结束时间");
-            that.time = [];
-        }
-      } 
-    },
+    changeTime() {},
     //速度慢
-    slow(){
-          console.log("slow")
-          let that=this;
-          that.pathNavigator.setSpeed(1000);
+    slow() {
+      console.log("slow");
+      let that = this;
+      that.pathNavigator.setSpeed(1000);
     },
     //速度中
-    middle(){
-          console.log("middle")
-        let that=this;
-        that.pathNavigator.setSpeed(10000);
+    middle() {
+      console.log("middle");
+      let that = this;
+      that.pathNavigator.setSpeed(10000);
     },
     //速度快
-    fast(){
-        console.log("fast")
-        let that=this;
-        that.pathNavigator.setSpeed(100000);
+    fast() {
+      console.log("fast");
+      let that = this;
+      that.pathNavigator.setSpeed(100000);
     },
     //启动
     play() {
@@ -454,21 +440,20 @@ export default {
           that.endPointName = result.regeocode.formattedAddress;
           setInterval(
             that.initCustomMarkes(
-              that.carNumber ,
+              that.carNumber,
               "起点:" +
                 that.startPointName +
                 "<br/>" +
                 "终点:" +
-                that.endPointName+
+                that.endPointName +
                 "<br/>" +
                 "距离:" +
-                that.listPath[0].miled
-                ,
+                that.listPath[0].miled,
               lnglatXY[0],
               lnglatXY[1]
-            )
-            , 500);
-          
+            ),
+            500
+          );
         }
       });
     },
@@ -480,11 +465,21 @@ export default {
         this.$message.error("车牌号不能为空!");
         return;
       }
-    
-      if (that.time==null&&that.time.length!=2) {
+      if (that.time == null && that.time.length != 2) {
         this.$message.error("请选择时间");
         return;
       }
+      if (that.time != null && that.time.length == 2) {
+        if (that.time[1].getTime() - that.time[0].getTime() > 86400000 * 3) {
+          this.$message.error("时间查询范围不能超过3天");
+          // that.time = [];
+          return;
+        } else if (that.time[1].getTime() < that.time[0].getTime()) {
+          this.$message.error("开始时间要大于结束时间,请重新选择!");
+          // that.time = [];
+          return;
+        }
+      }
       that.axios
         .post("/api/v1/otms/fullPathVisualizationByCarNumber", {
           capacityNumber: that.carNumber,
@@ -492,9 +487,9 @@ export default {
           endTime: that.formatDate(that.time[1], "yyyy-MM-dd hh:mm:ss")
         })
         .then(res => {
-          if(res.data.data=="-1"){
-             this.$message.error('自提车辆无权查看!');
-          }else if (res.data.data.startAndEndRoutes != "") {
+          if (res.data.data == "-1") {
+            this.$message.error("自提车辆无权查看!");
+          } else if (res.data.data.startAndEndRoutes != "") {
             that.listPath = res.data.data.startAndEndRoutes;
             that.initMap([105.602725, 37.076636]);
           } else {
@@ -510,7 +505,7 @@ export default {
           //设置地图容器id
           viewMode: "2D", //是否为2D地图模式
           zoom: 10, //初始化地图级别
-          center: lonlat, //初始化地图中心点位置
+          center: lonlat //初始化地图中心点位置
         });
         //初始化
         that.initGeocoder();

+ 68 - 70
src/views/statisticalReport/components/defendCapacity/getCapacityByDefend.vue

@@ -19,7 +19,7 @@
       <el-button type="primary" class="btn" @click="onclickSearch">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="exportData()"
+      <el-button type="primary" @click="exportExcel"
         ><i class="el-icon-download"></i>导出(Excel)</el-button
       >
       <span style="margin-left: 1rem">合计车数:</span>
@@ -28,15 +28,18 @@
         :disabled="true"
         style="width: 100px"
       ></el-input>
-         <el-input placeholder="请输入车牌号/出厂门岗" v-model="input" style="width: 220px;margin-left: 1rem;" clearable>
+      <el-input
+        placeholder="请输入车牌号/出厂门岗"
+        v-model="input"
+        style="width: 220px;margin-left: 1rem;"
+        clearable
+      >
       </el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
     </div>
-   
-   
-   
+
     <div class="table">
       <mergeRowTable
         ref="excelDom"
@@ -50,6 +53,7 @@
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
 import { getCookie } from "@/utils/util.js";
+import { exportExcelAdvanced } from "@/utils/exportExcelAdvanced.js";
 export default {
   data() {
     return {
@@ -57,43 +61,66 @@ export default {
       totalCapacity: null,
       startTime: null,
       endTime: null,
-
-      input: "",
+      input: null,
       tableTitle: "汽车抽查报表",
       option: {
         // 表格请求数据的地址
-        requestUrl: "api/v1/tms/getCapacityByDefend?apiId=474",
+        requestUrl: "",
         comparison: "orderNumber",
-        columnIndexs: [0, 1, 2,7],
+        columnIndexs: [0, 1, 2, 7]
       },
+      tableData: []
     };
   },
   created() {
-    if (
-      getCookie("orgCode") == "dagangadmin" ||
-      getCookie("orgCode") == "zidonghuabu"
-    ) {
-      this.option.requestUrl =
-        "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
-        new Date();
-    } else if (getCookie("orgCode") == "baiweibu") {
-      this.option.requestUrl =
-        "/api/v1/tms/getCapacityByDefend?apiId=474&orderType=13&startTime=null&endTime=null&i=" +
-        new Date();
-    } else {
-      this.option.requestUrl =
-        "/api/v1/tms/getCapacityByDefend?apiId=474&userId=" +
-        getCookie("orgCode") +
-        "&startTime=null&endTime=null&i=" +
-        new Date();
-    }
+    this.option.requestUrl =
+      "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
+      new Date();
   },
   methods: {
+    exportExcel() {
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime && this.endTime) {
+        startTime = sjTime(this.startTime);
+        endTime = sjTime(this.endTime);
+      } else {
+        this.$message.info("没有选择时间,将默认导出当天时间");
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: "请等待导出",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      this.axios
+        .post(
+          "/api/v1/tms/getCapacityByDefend?apiId=474&yes=yes&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&con=" +
+            this.input
+        )
+        .then(res => {
+          this.tableData = res.data.data;
+          console.log(res);
+          console.log(this.tableData);
+          exportExcelAdvanced(
+            this.tableTitle,
+            this.tableColumnData,
+            this.tableData
+          );
+          setTimeout(() => {
+            loading.close();
+          }, 2000);
+        });
+    },
     func(res) {
-      console.log(res);
+      this.tableColumnData = res.columnData;
       var resultNetWeightTotal = 0;
       var currentCapacityTotal = 0;
-      res.list.forEach((e) => {
+      res.list.forEach(e => {
         currentCapacityTotal++;
         resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
       });
@@ -105,26 +132,10 @@ export default {
         "/api/v1/tms/getCapacityByDefend?apiId=474&con=" + this.input;
     },
     getRequestUrl() {
-      if (
-        getCookie("orgCode") == "dagangadmin" ||
-        getCookie("orgCode") == "zidonghuabu"
-      ) {
-        this.option.requestUrl =
-          "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
-          new Date();
-      } else if (getCookie("orgCode") == "baoweibu") {
-        this.option.requestUrl =
-          "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
-          new Date();
-      } else {
-        this.option.requestUrl =
-          "/api/v1/tms/getCapacityByDefend?apiId=474&userId=" +
-          getCookie("orgCode") +
-          "&startTime=null&endTime=null&i=" +
-          new Date();
-      }
+      this.option.requestUrl =
+        "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
+        new Date();
     },
-
     // 添加开始结束时间筛选
     onclickSearch() {
       console.log("aaaa");
@@ -140,26 +151,13 @@ export default {
       }
       if (startTime && endTime) {
         if (startTime < endTime) {
-          if (
-            getCookie("orgCode") == "dagangadmin" ||
-            getCookie("orgCode") == "zidonghuabu"
-          ) {
-            this.option.requestUrl =
-              "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i=" +
-              new Date();
-          } else if (getCookie("orgCode") == "baoweibu") {
-            this.option.requestUrl =
-              "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i=" +
-              new Date();
-          }
+          this.option.requestUrl =
+            "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&i=" +
+            new Date();
         } else {
           this.startTime = null;
           this.endTime = null;
@@ -168,8 +166,8 @@ export default {
       } else {
         this.getRequestUrl();
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 100 - 57
src/views/statisticalReport/components/sporadicReport/sporadicReportEnterFactory.vue

@@ -2,11 +2,21 @@
   <div class="purchasFuelNewMonitor">
     <div class="frameCalculation">
       <span>计皮时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span>至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
+      <el-input
+        v-model="input"
+        placeholder="请输入发货单位或物资或车牌号"
+        style="width:250px"
+        clearable
+      ></el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -14,9 +24,17 @@
         ><i class="el-icon-download"></i>导出(Excel)</el-button
       >
       <span style="margin-left: 1rem;">合计净重:</span>
-      <el-input v-model="totalNumber" :disabled="true" style="width: 100px;"></el-input>
+      <el-input
+        v-model="totalNumber"
+        :disabled="true"
+        style="width: 100px;"
+      ></el-input>
       <span style="margin-left: 1rem;">合计车数:</span>
-      <el-input v-model="totalCapacity" :disabled="true" style="width: 100px;"></el-input>
+      <el-input
+        v-model="totalCapacity"
+        :disabled="true"
+        style="width: 100px;"
+      ></el-input>
     </div>
     <div class="table">
       <dilTable ref="excelDom" v-bind.sync="option" @func="func"></dilTable>
@@ -26,20 +44,21 @@
 
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from '@/utils/util.js';
+import { getCookie } from "@/utils/util.js";
 export default {
   data() {
     return {
-      totalNumber:null,
-      totalCapacity:null,
+      input: null,
+      totalNumber: null,
+      totalCapacity: null,
       option: {
-        requestUrl:'',
+        requestUrl: ""
       },
       startTime: null,
       endTime: null,
-      tableTitle: "零星进厂统计报表",
+      tableTitle: "零星进厂统计报表"
     };
-  },   
+  },
   created() {
     if (
       getCookie("orgCode") == "dagangadmin" ||
@@ -52,7 +71,7 @@ export default {
       this.option.requestUrl =
         "/api/v1/tms/getSporadicSuppliesReport1?apiId=425&orderType=12&startTime=null&endTime=null&i=" +
         new Date();
-    }else {
+    } else {
       this.option.requestUrl =
         "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&userId=" +
         getCookie("orgCode") +
@@ -61,36 +80,36 @@ export default {
     }
   },
   methods: {
-     func(res){
-        console.log(res)
-        var resultNetWeightTotal = 0
-        var currentCapacityTotal = 0
-        res.list.forEach(e => {
-          currentCapacityTotal++
-          resultNetWeightTotal = resultNetWeightTotal+e.resultNetWeight
-        });
-        this.totalNumber = resultNetWeightTotal.toFixed(2) + "t"
-        this.totalCapacity = currentCapacityTotal;
+    func(res) {
+      console.log(res);
+      var resultNetWeightTotal = 0;
+      var currentCapacityTotal = 0;
+      res.list.forEach(e => {
+        currentCapacityTotal++;
+        resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
+      });
+      this.totalNumber = resultNetWeightTotal.toFixed(2) + "t";
+      this.totalCapacity = currentCapacityTotal;
     },
-    getRequestUrl(){
-        if (
-      getCookie("orgCode") == "dagangadmin" ||
-      getCookie("orgCode") == "zidonghuabu"
-    ) {
-      this.option.requestUrl =
-        "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&startTime=null&endTime=null&i=" +
-        new Date();
-    } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
-      this.option.requestUrl =
-        "/api/v1/tms/getSporadicSuppliesReport1?apiId=425&orderType=12&startTime=null&endTime=null&i=" +
-        new Date();
-    }else {
-      this.option.requestUrl =
-        "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&userId=" +
-        getCookie("orgCode") +
-        "&startTime=null&endTime=null&i=" +
-        new Date();
-    }
+    getRequestUrl() {
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&startTime=null&endTime=null&i=" +
+          new Date();
+      } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=425&orderType=12&startTime=null&endTime=null&i=" +
+          new Date();
+      } else {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&userId=" +
+          getCookie("orgCode") +
+          "&startTime=null&endTime=null&i=" +
+          new Date();
+      }
     },
     onclick() {
       let startTime = null;
@@ -101,25 +120,49 @@ export default {
       if (this.endTime) {
         endTime = sjTime(this.endTime);
       }
-      if (startTime && endTime) {
-        if (startTime < endTime) {
-          if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
-          }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
-          }else{
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport1?apiId=424&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
-          }
-        } else {
-          this.startTime = null;
-          this.endTime = null;
-          this.$message.warning("开始时间要比结束时间早");
-        }
+      if (!this.input && (!startTime || !endTime)) {
+        this.$message.warning("请输入查询条件");
+        return;
+      }
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
+        console.log(this.option.requestUrl);
+      } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&orderType=13&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
       } else {
-        this.getRequestUrl()
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport1?apiId=424&userId=" +
+          getCookie("orgCode") +
+          "&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
       }
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -136,4 +179,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 120 - 63
src/views/statisticalReport/components/sporadicReport/sporadicReportExFactory.vue

@@ -9,20 +9,32 @@
       >
       </el-date-picker>
       <span>至</span>
-      <el-date-picker
-        v-model="endTime"
-        type="datetime"
-        placeholder="选择日期"
-      >
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
+      <el-input
+        v-model="input"
+        placeholder="请输入收货单位或物资或车牌号"
+        style="width:250px"
+        clearable
+      ></el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
+      <el-button type="primary" @click="exportData()"
+        ><i class="el-icon-download"></i>导出(Excel)</el-button
+      >
       <span style="margin-left: 1rem;">合计净重:</span>
-      <el-input v-model="totalNumber" :disabled="true" style="width: 100px;"></el-input>
+      <el-input
+        v-model="totalNumber"
+        :disabled="true"
+        style="width: 100px;"
+      ></el-input>
       <span style="margin-left: 1rem;">合计车数:</span>
-      <el-input v-model="totalCapacity" :disabled="true" style="width: 100px;"></el-input>
+      <el-input
+        v-model="totalCapacity"
+        :disabled="true"
+        style="width: 100px;"
+      ></el-input>
     </div>
     <div class="table">
       <dilTable ref="excelDom" v-bind.sync="option" @func="func"></dilTable>
@@ -31,80 +43,125 @@
 </template>
 
 <script>
-import { sjTime } from '@/utils/sharedJsFile';
-import { getCookie } from '@/utils/util.js';
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
 export default {
   data() {
     return {
-      totalNumber:null,
-      totalCapacity:null,
+      input: null,
+      totalNumber: null,
+      totalCapacity: null,
       option: {
-        requestUrl: "",
+        requestUrl: ""
       },
       startTime: null,
       endTime: null,
-      tableTitle:'零星出厂统计报表'
+      tableTitle: "零星出厂统计报表"
     };
-  }, 
-  created(){
-      if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=null&endTime=null&i=' +new Date();
-      }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=null&endTime=null&i=" +new Date();
-      }else{
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=' + getCookie("orgCode")+"&startTime=null&endTime=null&i=" +new Date();
-      }
+  },
+  created() {
+    if (
+      getCookie("orgCode") == "dagangadmin" ||
+      getCookie("orgCode") == "zidonghuabu"
+    ) {
+      this.option.requestUrl =
+        "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=null&endTime=null&i=" +
+        new Date();
+    } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+      this.option.requestUrl =
+        "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=null&endTime=null&i=" +
+        new Date();
+    } else {
+      this.option.requestUrl =
+        "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=" +
+        getCookie("orgCode") +
+        "&startTime=null&endTime=null&i=" +
+        new Date();
+    }
   },
   methods: {
-    func(res){
-        console.log(res)
-        var resultNetWeightTotal = 0
-        var currentCapacityTotal = 0
-        res.list.forEach(e => {
-          currentCapacityTotal++
-          resultNetWeightTotal = resultNetWeightTotal+e.resultNetWeight
-        });
-        this.totalNumber = resultNetWeightTotal.toFixed(2) + "t"
-        this.totalCapacity = currentCapacityTotal;
+    func(res) {
+      console.log(res);
+      var resultNetWeightTotal = 0;
+      var currentCapacityTotal = 0;
+      res.list.forEach(e => {
+        currentCapacityTotal++;
+        resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
+      });
+      this.totalNumber = resultNetWeightTotal.toFixed(2) + "t";
+      this.totalCapacity = currentCapacityTotal;
     },
-    getRequestUrl(){
-        if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=null&endTime=null&i=' +new Date();
-      }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=null&endTime=null&i=" +new Date();
-      }else{
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=' + getCookie("orgCode")+"&startTime=null&endTime=null&i=" +new Date();
+    getRequestUrl() {
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=null&endTime=null&i=" +
+          new Date();
+      } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=null&endTime=null&i=" +
+          new Date();
+      } else {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=" +
+          getCookie("orgCode") +
+          "&startTime=null&endTime=null&i=" +
+          new Date();
       }
     },
     onclick() {
       let startTime = null;
       let endTime = null;
-      if(this.startTime){
+      if (this.startTime) {
         startTime = sjTime(this.startTime);
       }
-      if(this.endTime){
+      if (this.endTime) {
         endTime = sjTime(this.endTime);
       }
-      if(startTime && endTime){
-        if(startTime < endTime){
-          if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
-          }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          this.option.requestUrl = "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
-          }else{
-          this.option.requestUrl = '/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=' + getCookie("orgCode")+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
-          }
-        }else{
-          this.startTime = null;
-          this.endTime = null;
-          this.$message.warning('开始时间要比结束时间早')
-        }
-      }else{
-        console.log(startTime && endTime)
-        this.getRequestUrl()
+      if (!this.input && (!startTime || !endTime)) {
+        this.$message.warning("请输入查询条件");
+        return;
       }
-    },
-  },
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
+      } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&orderType=13&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
+      } else {
+        this.option.requestUrl =
+          "/api/v1/tms/getSporadicSuppliesReport2?apiId=425&userId=" +
+          getCookie("orgCode") +
+          "&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&con=" +
+          this.input +
+          "&i=" +
+          new Date();
+      }
+    }
+  }
 };
 </script>
 
@@ -116,9 +173,9 @@ export default {
     display: flex;
     align-items: center;
     padding-left: 50px;
-    .el-date-editor{
+    .el-date-editor {
       margin: 20px;
     }
   }
 }
-</style>
+</style>