Jelajahi Sumber

增加导出接口和提单号查询跳转

lichao 3 tahun lalu
induk
melakukan
4c3443093d

+ 8 - 0
src/api/warehouseBusiness/warehouseAnalysis.js

@@ -7,3 +7,11 @@ export function getList(query) {
     params: query
   })
 }
+
+export function exportData(query) {
+  return request({
+    url: '/warehousing/analysis/export',
+    method: 'get',
+    params: query
+  })
+}

+ 69 - 7
src/views/Warehousing/analysis/index.vue

@@ -26,6 +26,16 @@
           </el-form-item>
         </el-col>
         <el-col :xs="12" :sm="6">
+          <el-form-item label="提单号">
+            <el-input
+              v-model="queryParams.fMblno"
+              placeholder="请输入提单号"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6">
           <el-form-item label="仓库">
             <el-select v-model="queryParams.fWarehouseid" placeholder="请选择仓库库区" clearable filterable>
               <el-option
@@ -54,6 +64,8 @@
             </el-select>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row v-show="show">
         <el-col :xs="12" :sm="6">
           <el-form-item label="截止日期">
             <el-date-picker
@@ -61,7 +73,7 @@
               type="date"
               value-format="yyyy-MM-dd"
               clearable
-              style="width: 230px"
+              style="width: 200px"
               placeholder="选择日期"
             ></el-date-picker>
           </el-form-item>
@@ -150,6 +162,22 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
             >重置</el-button
             >
+            <el-button
+              v-show="show"
+              @click="show = !show"
+              icon="el-icon-arrow-up"
+              size="mini"
+              style="border: 1px dashed #dedddd"
+            >展开</el-button
+            >
+            <el-button
+              v-show="!show"
+              @click="show = !show"
+              icon="el-icon-arrow-down"
+              size="mini"
+              style="border: 1px dashed #dedddd"
+            >展开</el-button
+            >
             <right-toolbar
               :showSearch.sync="showSearch"
               @queryTable="getList"
@@ -166,7 +194,6 @@
         </div>
       </el-row>
     </el-form>
-
     <el-tabs v-model="activeName" @tab-click="tabsHandle">
       <el-tab-pane label="出库" name="outStock"></el-tab-pane>
       <el-tab-pane label="在库" name="inStock"></el-tab-pane>
@@ -202,6 +229,12 @@
           <span v-if="item.label == 'fBsdate'">
             {{ scope.row.fBsdate | fBsdateFormat }}
           </span>
+          <span v-else-if="item.label == 'fMblno'">
+            <el-link :underline="false" type="primary" v-if="activeName == 'outStock'">
+              <span @click="jumpPage(scope.row)">{{ scope.row.fMblno }}</span>
+            </el-link>
+            <span v-else>{{ scope.row.fMblno }}</span>
+          </span>
           <span v-else-if="item.label == 'fBilltype'">
             {{ scope.row.fBilltype | billTypeFormat(billTypeList) }}
           </span>
@@ -226,7 +259,7 @@
 import { listCorps } from "@/api/basicdata/corps";
 import { listWarehousesss } from "@/api/basicdata/warehouse";
 import { queryClerkRoleList } from "@/api/warehouseBusiness/warehouseInStock";
-import { getList } from "@/api/warehouseBusiness/warehouseAnalysis";
+import { getList, exportData } from "@/api/warehouseBusiness/warehouseAnalysis";
 import Cookies from "js-cookie";
 import {addSet, resetModule, select} from '@/api/system/set';
 import draggable from "vuedraggable";
@@ -254,6 +287,7 @@ export default {
       billTypeList: [],
       activeName: 'outStock',
       disabledName: 'outStock',
+      show: false,
 
       // 设置列开关
       showSetting: false,
@@ -268,7 +302,7 @@ export default {
           label: "fBilltype",
           name: "业务类型",
           checked: 0,
-          width: 150,
+          width: 100,
           show: true,
         },
         {
@@ -276,7 +310,15 @@ export default {
           label: "fCorpid",
           name: "客户名称",
           checked: 0,
-          width: 150,
+          width: 120,
+          show: true,
+        },
+        {
+          surface: "2",
+          label: "fName",
+          name: "品名",
+          checked: 0,
+          width: 100,
           show: true,
         },
         {
@@ -284,7 +326,7 @@ export default {
           label: "fMblno",
           name: "提单号",
           checked: 0,
-          width: 150,
+          width: 130,
           show: true,
         },
         {
@@ -447,7 +489,19 @@ export default {
       this.handleQuery();
     },
     //导出
-    handleExport() {},
+    handleExport() {
+      const type = this.activeName == 'outStock'? 2: 1
+      const query = {...this.queryParams, type}
+      this.$confirm(type == 2?"是否确认导出出库数据项?": "是否确认导出在库数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        return exportData(query)
+      }).then(res => {
+        this.download(res.msg);
+      })
+    },
     //合计
     getSum(param) {
       const { columns, data } = param;
@@ -504,6 +558,14 @@ export default {
         this.$refs.table.doLayout()
       })
     },
+    jumpPage(row) {
+      if (this.activeName == 'outStock') {
+        this.$router.push({
+          path: "/business/outStock",
+          query: { id: row.fId },
+        });
+      }
+    },
 
 
     //列设置全选