huang_an 1 год назад
Родитель
Сommit
e2826cb557

+ 2 - 2
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -151,12 +151,12 @@
             @click="openPrint('print')"
             >打印出库单(嘉实)</el-button
           > -->
-          <el-button
+          <!-- <el-button
             icon="el-icon-printer"
             type="primary"
             @click="openPrint('print1')"
             >打印出库单(宝悦)</el-button
-          >
+          > -->
           <!-- <el-button
             icon="el-icon-printer"
             type="primary"

+ 11 - 4
src/views/warehouseManagement/statisticalReports/inventoryBalance/add.vue

@@ -44,7 +44,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="7">
-              <el-form-item label-width="90px" label="起止时间:" prop="name">
+              <el-form-item label-width="90px" label="起止时间:" prop="time">
                 <el-date-picker
                   :disabled="isView"
                   style="width: 100%"
@@ -123,7 +123,7 @@
         @click="downLoad"
         :loading="loading"
         type="primary"
-        >确认导出</el-button
+        >提交并导出</el-button
       >
       <el-button v-else size="small" @click="visible = false" type="primary"
         >确定</el-button
@@ -155,8 +155,9 @@
         },
         // 表单验证规则
         rules: {
-          name: [
-            { required: true, message: '请输入库存余额名称', trigger: 'blur' }
+          name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+          time: [
+            { required: true, message: '请选择起止时间', trigger: 'change' }
           ]
         },
         pickerOptions: {
@@ -290,6 +291,12 @@
         return `${obj.year}-${obj.month}-${obj.strDate}`;
       },
       downLoad() {
+        if (!this.formData.name) {
+          return this.$message.error('请输入名称');
+        }
+        if (!this.formData.time) {
+          return this.$message.error('请选择时间');
+        }
         this.loading = true;
         const params = Object.assign({}, this.formData);
         if (params.time?.length) {

+ 62 - 26
src/views/warehouseManagement/statisticalReports/inventoryBalance/index.vue

@@ -51,13 +51,12 @@
         height="calc(100vh - 405px)"
         full-height="calc(100vh - 116px)"
         tool-class="ele-toolbar-form"
-        cache-key="systemOrgUserTable"
       >
         <template v-slot:toolbar="{ row }">
           <el-button
             size="small"
             type="primary"
-            icon="el-icon-download"
+            icon="el-icon-plus"
             class="ele-btn-icon"
             @click="add(false)"
           >
@@ -73,6 +72,14 @@
           >
             详情
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-download"
+            @click="downLoad(row)"
+          >
+            下载
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>
@@ -83,37 +90,32 @@
 <script>
   import add from './add.vue';
   import ItemSearch from './components/item-search.vue';
-  import { getStatementLogPage } from '@/api/warehouseManagement/statisticalReports';
+  import {
+    getStatementLogPage,
+    exportStockExcel
+  } from '@/api/warehouseManagement/statisticalReports';
 
   export default {
     components: { ItemSearch, add },
     data() {
       return {
-        keyWord: ''
-      };
-    },
-    computed: {
-      // 表格列配置
-      columns() {
-        let arr = [
+        keyWord: '',
+        columns: [
           {
-            columnKey: 'index',
             type: 'index',
-            width: 50,
-            align: 'center',
             label: '序号',
-            showOverflowTooltip: true,
-            fixed: 'left'
+            width: 50,
+            align: 'center'
           },
           {
             prop: 'code',
-            label: '库存余额编码',
+            label: '编码',
             align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'name',
-            label: '库存余额名称',
+            label: '名称',
             align: 'center',
             showOverflowTooltip: true
           },
@@ -124,25 +126,58 @@
             showOverflowTooltip: true
           },
           {
-            prop: 'createTime',
-            label: '创建时间',
+            prop: 'startTime',
+            label: '开始时间',
+            slot: 'startTime',
             align: 'center',
             showOverflowTooltip: true
           },
           {
+            prop: 'endTime',
+            label: '结束时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
             label: '操作',
-            slot: 'action',
+            fixed: 'right',
+            width: 250,
             align: 'center',
+            slot: 'action',
             showOverflowTooltip: true
           }
-        ];
-        return arr.filter((item) => item != '');
-      },
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      }
+        ]
+      };
     },
     methods: {
+      downLoad(row) {
+        exportStockExcel({
+          code: row.code,
+          name: row.name,
+          startTime: row.startTime,
+          endTime: row.endTime,
+          exportStatus: 1
+        }).then((data) => {
+          try {
+            let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
+            let elink = document.createElement('a');
+            elink.setAttribute(
+              'download',
+              decodeURI(decodeURI('库存余额.xlsx'))
+            );
+            elink.style.display = 'none';
+            elink.href = objectUrl1;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            window.URL.revokeObjectURL(elink.href);
+            this.search();
+          } catch (err) {
+            this.$message.error('导出失败,请联系管理员!');
+          }
+        });
+      },
       add(isView, row) {
         console.log('isView--', isView);
         console.log('row-----', row);
@@ -153,6 +188,7 @@
         const data = getStatementLogPage({
           ...where,
           ...order,
+          type: 1,
           keyWord: this.keyWord,
           pageNum: page,
           size: limit

+ 461 - 0
src/views/warehouseManagement/statisticalReports/transceiverDetails/add.vue

@@ -0,0 +1,461 @@
+<template>
+  <el-dialog
+    top="5vh"
+    :visible.sync="visible"
+    :title="isView ? '查看收发明细表明细' : '选择收发明细表明细'"
+    width="90vw"
+  >
+    <el-card shadow="never">
+      <!-- 数据表格 -->
+      <div>
+        <el-form
+          label-position="left"
+          class="ele-form-search"
+          :model="formData"
+          :rules="rules"
+          @keyup.enter.native="search"
+          @submit.native.prevent
+        >
+          <el-row :gutter="15">
+            <el-col :span="5">
+              <el-form-item label-width="60px" label="编码:" prop="code">
+                <el-input
+                  disabled
+                  v-model="formData.code"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label-width="60px" label="名称:" prop="name">
+                <el-input
+                  :disabled="isView"
+                  v-model="formData.name"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label-width="90px" label="起止时间:" prop="time">
+                <el-date-picker
+                  :disabled="isView"
+                  style="width: 100%"
+                  class="w100"
+                  size="small"
+                  v-model="formData.time"
+                  type="daterange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="yyyy-MM-dd"
+                  :picker-options="pickerOptions"
+                ></el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label-width="60px" label="关键词:" prop="keyWord">
+                <el-input
+                  :disabled="isView"
+                  v-model="formData.keyWord"
+                  placeholder="请输入关键词"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="!isView" :span="3">
+              <div class="ele-form-actions">
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  class="ele-btn-icon"
+                  @click="search"
+                  size="small"
+                >
+                  查询
+                </el-button>
+                <el-button
+                  @click="reset"
+                  icon="el-icon-refresh-left"
+                  size="small"
+                  type="primary"
+                  >重置</el-button
+                >
+              </div>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <ele-pro-table
+        ref="table"
+        class="table"
+        :needPage="!isView"
+        :columns="columns"
+        :datasource="datasource"
+        height="calc(100vh - 405px)"
+        full-height="calc(100vh - 116px)"
+        tool-class="ele-toolbar-form"
+      >
+        <!-- 状态 -->
+        <!-- <template v-slot:verifyStatus="{ row }">
+          <span :class="status[row.verifyStatus].class">
+            {{ status[row.verifyStatus].label }}
+          </span>
+        </template> -->
+        <template v-slot:bizType="{ row }">
+          {{ handleBizType(row.bizType, row.type) }}
+        </template>
+        <template v-slot:assetType="{ row }">
+          {{ handleAssetType(row.extInfo.assetType) }}
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <div slot="footer" class="dialog-footer" style="margin-right: 2%">
+      <el-button
+        v-if="!isView"
+        size="small"
+        @click="downLoad"
+        :loading="loading"
+        type="primary"
+        >提交并导出</el-button
+      >
+      <el-button v-else size="small" @click="visible = false" type="primary"
+        >确定</el-button
+      >
+      <el-button size="small" @click="visible = false">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { getCode } from '@/api/codeManagement/index.js';
+  import ItemSearch from './components/item-search.vue';
+  import { sendReceiveExcel } from '@/api/warehouseManagement/statisticalReports';
+  import storageApi from '@/api/warehouseManagement';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import {
+    warehousingType,
+    sceneState,
+    outputSceneState,
+    auditStatus,
+    useDict
+  } from '@/utils/dict/index';
+  export default {
+    components: { ItemSearch },
+    data() {
+      return {
+        auditStatus,
+        outputSceneState,
+        warehousingType,
+        sceneState,
+        status: [
+          { label: '未审核', class: 'ele-text-info' },
+          { label: '审核中', class: 'ele-text-primary' },
+          { label: '审核通过', class: 'ele-text-success' },
+          { label: '驳回', class: 'ele-text-danger' }
+        ],
+        loading: false,
+        isView: false,
+        formData: {
+          code: '',
+          name: '',
+          time: [],
+          status: 2,
+          keyWord: ''
+        },
+        // 表单验证规则
+        rules: {
+          name: [
+            { required: true, message: '请输入库存余额名称', trigger: 'blur' }
+          ],
+          time: [
+            { required: true, message: '请选择起止时间', trigger: 'change' }
+          ]
+        },
+        pickerOptions: {
+          shortcuts: [
+            {
+              text: '最近一周',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近一个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近三个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近一年',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
+                picker.$emit('pick', [start, end]);
+              }
+            }
+          ]
+        },
+        visible: false
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        let arr = [
+          {
+            type: 'index',
+            label: '序号',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'bizNo',
+            label: '单号',
+            align: 'center',
+            slot: 'bizNo',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'bizType',
+            slot: 'bizType',
+            label: '出入库类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'assetType',
+            slot: 'assetType',
+            label: '物品类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryNames',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryCodes',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'sourceBizNo',
+            label: '来源单据',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createUserName',
+            label: '操作人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            width: 160,
+            prop: 'storageTime',
+            label: '出入库时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyName',
+            label: '审核人',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+          // {
+          //   prop: 'verifyStatus',
+          //   label: '状态',
+          //   align: 'center',
+          //   slot: 'verifyStatus',
+          //   showOverflowTooltip: true,
+          //   width: 100
+          // }
+        ];
+        return arr.filter((item) => item != '');
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getTypeList();
+    },
+    methods: {
+      async getTypeList() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      handleBizType(code, type) {
+        if (type == 1) {
+          // 入库
+          for (const key in this.sceneState) {
+            if (this.sceneState[key].code == code) {
+              return this.sceneState[key].label;
+            }
+          }
+        } else {
+          // 出库
+          for (const key in this.outputSceneState) {
+            if (this.outputSceneState[key].code == code) {
+              return this.outputSceneState[key].label;
+            }
+          }
+        }
+      },
+      // 获取时间函数
+      getDate(date) {
+        console.log(date);
+        let obj = {
+          year: date.getFullYear(), //获取完整的年份(4位)
+          month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+          strDate: date.getDate() // 获取当前日(1-31)
+        };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      downLoad() {
+        if (!this.formData.name) {
+          return this.$message.error('请输入名称');
+        }
+        if (this.formData.time.length <= 0) {
+          return this.$message.error('请选择时间');
+        }
+        this.loading = true;
+        const params = Object.assign({}, this.formData);
+        if (params.time?.length) {
+          params.startTime = params.time[0];
+          params.endTime = params.time[1];
+        }
+        delete params.time;
+        sendReceiveExcel(params).then((data) => {
+          try {
+            let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
+            let elink = document.createElement('a');
+            elink.setAttribute(
+              'download',
+              decodeURI(decodeURI('收发明细表.xlsx'))
+            );
+            elink.style.display = 'none';
+            elink.href = objectUrl1;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            window.URL.revokeObjectURL(elink.href);
+            this.loading = false;
+            this.visible = false;
+            this.$emit('reload');
+          } catch (err) {
+            this.$message.error('导出失败,请联系管理员!');
+          }
+        });
+      },
+      async open(isView, row) {
+        console.log(row);
+        if (isView) {
+          this.tableList = row.info.map((item) => {
+            return {
+              ...item,
+              startTime: this.getDate(new Date(Number(item.startTime)))
+            };
+          });
+          this.formData.code = row.code;
+          this.formData.name = row.name;
+          this.formData.status = 2;
+          this.formData.time =
+            row.startTime && row.endTime ? [row.startTime, row.endTime] : [];
+          this.formData.keyWord = row.keyWord;
+        } else {
+          this.tableList = [];
+          this.formData = {
+            code: await getCode('statistics_log_code'),
+            name: '',
+            status: 2,
+            time: [],
+            keyWord: ''
+          };
+        }
+        this.isView = isView;
+        this.visible = true;
+        this.$nextTick(() => {
+          this.$refs.table.reload();
+        });
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        if (this.isView) {
+          return this.tableList;
+        } else {
+          const params = Object.assign({}, this.formData);
+          if (params.time?.length) {
+            params.startTime = params.time[0];
+            params.endTime = params.time[1];
+          }
+          delete params.time;
+          const data = await storageApi.getInboundList({
+            ...params,
+            ...where,
+            ...order,
+            pageNum: page,
+            size: limit
+          });
+          console.log(data);
+          this.tableList = data;
+          return data;
+        }
+      },
+      search() {
+        this.$refs.table.reload();
+      },
+      reset() {
+        this.formData.time = [];
+        this.formData.keyWord = '';
+        this.search();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  #inventoryBalance {
+    height: 100%;
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    .ele-form-actions {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+</style>

+ 343 - 0
src/views/warehouseManagement/statisticalReports/transceiverDetails/index copy.vue

@@ -0,0 +1,343 @@
+<template>
+  <div class="stockOrOutgoingManagement_index">
+    <el-card shadow="never">
+      <item-search @search="reload" ref="refSeavch" :type="type"></item-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        @cell-click="cellClick"
+        cache-key="systemRoleTable"
+      >
+        <!-- <template v-slot:selection="{ row }">
+          <el-radio class="radio" v-model="currentId" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template> -->
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar="{ row }">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-download"
+            class="ele-btn-icon"
+            @click="downLoad"
+          >
+            导出收发明细表
+          </el-button>
+        </template>
+        <!-- 状态 -->
+        <template v-slot:verifyStatus="{ row }">
+          <span :class="status[row.verifyStatus].class">
+            {{ status[row.verifyStatus].label }}
+          </span>
+        </template>
+        <template v-slot:bizType="{ row }">
+          {{ handleBizType(row.bizType, row.type) }}
+        </template>
+        <template v-slot:assetType="{ row }">
+          {{ handleAssetType(row.extInfo.assetType) }}
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import { sendReceiveExcel } from '@/api/warehouseManagement/statisticalReports';
+  import ItemSearch from './components/item-search.vue';
+  import * as XLSX from 'xlsx';
+  import storageApi from '@/api/warehouseManagement';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import {
+    warehousingType,
+    sceneState,
+    outputSceneState,
+    auditStatus,
+    useDict
+  } from '@/utils/dict/index';
+  export default {
+    components: { ItemSearch },
+    data() {
+      return {
+        type: '',
+        params: {},
+        auditStatus,
+        outputSceneState,
+        warehousingType,
+        sceneState,
+        codeList: [],
+        factoryList: [],
+        tableData: [],
+        formData: {
+          deptIds: '',
+          categoryCode: '',
+          categoryName: '',
+          sourceBizNo: '',
+          startTime: '',
+          endTime: '',
+          status: '',
+          factoryId: '',
+          time: []
+        },
+        total: 0,
+        status: [
+          { label: '未审核', class: 'ele-text-info' },
+          { label: '审核中', class: 'ele-text-primary' },
+          { label: '审核通过', class: 'ele-text-success' },
+          { label: '驳回', class: 'ele-text-danger' }
+        ],
+        currentId: '',
+        currentRow: {},
+        columns: [
+          {
+            type: 'index',
+            label: '序号',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'bizNo',
+            label: '单号',
+            align: 'center',
+            slot: 'bizNo',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'bizType',
+            slot: 'bizType',
+            label: '出入库类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'assetType',
+            slot: 'assetType',
+            label: '物品类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryNames',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryCodes',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'sourceBizNo',
+            label: '来源单据',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createUserName',
+            label: '操作人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            width: 160,
+            prop: 'storageTime',
+            label: '出入库时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyName',
+            label: '审核人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyStatus',
+            label: '状态',
+            align: 'center',
+            slot: 'verifyStatus',
+            showOverflowTooltip: true,
+            width: 100
+          }
+        ]
+      };
+    },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getTypeList();
+    },
+    methods: {
+      downLoad() {
+        const params = Object.assign({}, this.$refs.refSeavch.params);
+        if (params.time?.length) {
+          params.startTime = params.time[0];
+          params.endTime = params.time[1];
+        }
+        delete params.time;
+        sendReceiveExcel(params).then((data) => {
+          try {
+            let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
+            let elink = document.createElement('a');
+            elink.setAttribute(
+              'download',
+              decodeURI(decodeURI('收发明细.xlsx'))
+            );
+            elink.style.display = 'none';
+            elink.href = objectUrl1;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            window.URL.revokeObjectURL(elink.href);
+          } catch (err) {
+            this.$message.error('导出失败,请联系管理员!');
+          }
+        });
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      async getTypeList() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      handleBizType(code, type) {
+        if (type == 1) {
+          // 入库
+          for (const key in this.sceneState) {
+            if (this.sceneState[key].code == code) {
+              return this.sceneState[key].label;
+            }
+          }
+        } else {
+          // 出库
+          for (const key in this.outputSceneState) {
+            if (this.outputSceneState[key].code == code) {
+              return this.outputSceneState[key].label;
+            }
+          }
+        }
+      },
+      async datasource({ page, limit, where }) {
+        if (where.time && where.time.length > 0) {
+          where.startTime = where.time[0];
+          where.endTime = where.time[1];
+          delete where.time;
+        }
+        const res = await storageApi.getInboundList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+
+        return res;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
+      getAuditStatus: useDict(auditStatus),
+      getList() {
+        this.$refs.table.reload();
+      },
+      handleCurrentChange() {
+        this.getList();
+      },
+      handleSizeChange() {
+        this.formData.page = 1;
+        this.getList();
+      },
+      search() {
+        this.formData.page = 1;
+        this.getList();
+      },
+      reset() {
+        this.$refs.formName.resetFields();
+        this.search();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  #stockOrOutgoingManagement_index {
+    height: 100%;
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    // element-ui样式穿透
+    ::v-deep .el-card {
+      height: 100%;
+      .el-card__body {
+        height: 100%;
+        box-sizing: border-box;
+        display: flex;
+        flex-direction: column;
+        .ele-pro-table {
+          flex: 1;
+          display: flex;
+          flex-direction: column;
+          .el-table {
+            display: flex;
+            flex-direction: column;
+            .el-table__body-wrapper {
+              flex: 1;
+            }
+          }
+        }
+      }
+    }
+    .w100 {
+      width: 100% !important;
+    }
+    .p20 {
+      padding: 20px;
+    }
+    .mt20 {
+      margin-top: 20px;
+    }
+    .mt10 {
+      margin-top: 10px;
+    }
+    .el-form {
+      overflow: hidden;
+    }
+    .float-right {
+      float: right;
+      text-align: right;
+      margin-right: 20px;
+    }
+    .right {
+      text-align: right;
+    }
+    .col {
+      color: #aaa;
+    }
+    .pr10 {
+      padding-right: 10px;
+    }
+  }
+</style>

+ 121 - 251
src/views/warehouseManagement/statisticalReports/transceiverDetails/index.vue

@@ -1,102 +1,106 @@
 <template>
-  <div class="stockOrOutgoingManagement_index">
+  <div id="inventoryBalance">
     <el-card shadow="never">
-      <item-search @search="reload" ref="refSeavch" :type="type"></item-search>
+      <!-- 数据表格 -->
+      <div>
+        <el-form
+          label-width="60px"
+          label-position="left"
+          class="ele-form-search"
+          @keyup.enter.native="search"
+          @submit.native.prevent
+        >
+          <el-row :gutter="15">
+            <el-col :span="6">
+              <el-form-item label="关键词:" prop="keyWord">
+                <el-input
+                  clearable
+                  v-model="keyWord"
+                  placeholder="请输入关键词"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="18">
+              <div class="ele-form-actions">
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  class="ele-btn-icon"
+                  @click="search"
+                  size="small"
+                >
+                  查询
+                </el-button>
+                <el-button
+                  @click="reset"
+                  icon="el-icon-refresh-left"
+                  size="small"
+                  type="primary"
+                  >重置</el-button
+                >
+              </div>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
       <ele-pro-table
         ref="table"
+        class="table"
         :columns="columns"
         :datasource="datasource"
-        @cell-click="cellClick"
-        cache-key="systemRoleTable"
+        height="calc(100vh - 405px)"
+        full-height="calc(100vh - 116px)"
+        tool-class="ele-toolbar-form"
       >
-        <!-- <template v-slot:selection="{ row }">
-          <el-radio class="radio" v-model="currentId" :label="row.id"
-            ><i></i
-          ></el-radio>
-        </template> -->
-        <!-- 表头工具栏 -->
         <template v-slot:toolbar="{ row }">
           <el-button
             size="small"
             type="primary"
-            icon="el-icon-download"
+            icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="downLoad"
+            @click="add(false)"
           >
-            导出收发明细表
+            新增
           </el-button>
         </template>
-        <!-- 状态 -->
-        <template v-slot:verifyStatus="{ row }">
-          <span :class="status[row.verifyStatus].class">
-            {{ status[row.verifyStatus].label }}
-          </span>
-        </template>
-        <template v-slot:bizType="{ row }">
-          {{ handleBizType(row.bizType, row.type) }}
-        </template>
-        <template v-slot:assetType="{ row }">
-          {{ handleAssetType(row.extInfo.assetType) }}
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-view"
+            @click="add(true, row)"
+          >
+            详情
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-download"
+            @click="downLoad(row)"
+          >
+            下载
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>
+    <add ref="addRef" @reload="search" />
   </div>
 </template>
 
 <script>
-  import { sendReceiveExcel } from '@/api/warehouseManagement/statisticalReports';
+  import add from './add.vue';
   import ItemSearch from './components/item-search.vue';
-  import * as XLSX from 'xlsx';
-  import storageApi from '@/api/warehouseManagement';
-  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-  import { allCategoryLevel } from '@/api/classifyManage';
   import {
-    warehousingType,
-    sceneState,
-    outputSceneState,
-    auditStatus,
-    useDict
-  } from '@/utils/dict/index';
+    getStatementLogPage,
+    sendReceiveExcel
+  } from '@/api/warehouseManagement/statisticalReports';
+
   export default {
-    components: { ItemSearch },
+    components: { ItemSearch, add },
     data() {
       return {
-        type: '',
-        params: {},
-        auditStatus,
-        outputSceneState,
-        warehousingType,
-        sceneState,
-        codeList: [],
-        factoryList: [],
-        tableData: [],
-        formData: {
-          deptIds: '',
-          categoryCode: '',
-          categoryName: '',
-          sourceBizNo: '',
-          startTime: '',
-          endTime: '',
-          status: '',
-          factoryId: '',
-          time: []
-        },
-        total: 0,
-        status: [
-          { label: '未审核', class: 'ele-text-info' },
-          { label: '审核中', class: 'ele-text-primary' },
-          { label: '审核通过', class: 'ele-text-success' },
-          { label: '驳回', class: 'ele-text-danger' }
-        ],
-        currentId: '',
-        currentRow: {},
+        keyWord: '',
         columns: [
-          // {
-          //   slot: 'selection',
-          //   label: '选择',
-          //   width: 50,
-          //   align: 'center'
-          // },
           {
             type: 'index',
             label: '序号',
@@ -104,103 +108,63 @@
             align: 'center'
           },
           {
-            prop: 'bizNo',
-            label: '单号',
+            prop: 'code',
+            label: '编码',
             align: 'center',
-            slot: 'bizNo',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'bizType',
-            slot: 'bizType',
-            label: '出入库类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'assetType',
-            slot: 'assetType',
-            label: '物品类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'categoryNames',
-            label: '物品名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'categoryCodes',
-            label: '物品编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
+            showOverflowTooltip: true
           },
           {
-            prop: 'sourceBizNo',
-            label: '来源单据',
+            prop: 'name',
+            label: '名称',
             align: 'center',
             showOverflowTooltip: true
           },
-
           {
             prop: 'createUserName',
-            label: '操作人',
+            label: '创建人',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            width: 160,
-            prop: 'storageTime',
-            label: '出入库时间',
+            prop: 'startTime',
+            label: '开始时间',
+            slot: 'startTime',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'verifyName',
-            label: '审核人',
+            prop: 'endTime',
+            label: '结束时间',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'verifyStatus',
-            label: '状态',
+            columnKey: 'action',
+            label: '操作',
+            fixed: 'right',
+            width: 250,
             align: 'center',
-            slot: 'verifyStatus',
-            showOverflowTooltip: true,
-            width: 100
+            slot: 'action',
+            showOverflowTooltip: true
           }
         ]
       };
     },
-    computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      }
-    },
-    created() {
-      this.getTypeList();
-    },
     methods: {
-      downLoad() {
-        const params = Object.assign({}, this.$refs.refSeavch.params);
-        if (params.time?.length) {
-          params.startTime = params.time[0];
-          params.endTime = params.time[1];
-        }
-        delete params.time;
-        sendReceiveExcel(params).then((data) => {
+      downLoad(row) {
+        sendReceiveExcel({
+          code: row.code,
+          name: row.name,
+          startTime: row.startTime,
+          endTime: row.endTime,
+          exportStatus: 1
+        }).then((data) => {
           try {
             let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
             let elink = document.createElement('a');
             elink.setAttribute(
               'download',
-              decodeURI(decodeURI('收发明细.xlsx'))
+              decodeURI(decodeURI('收发明细表.xlsx'))
             );
             elink.style.display = 'none';
             elink.href = objectUrl1;
@@ -208,142 +172,48 @@
             elink.click();
             document.body.removeChild(elink);
             window.URL.revokeObjectURL(elink.href);
+            this.search();
           } catch (err) {
             this.$message.error('导出失败,请联系管理员!');
           }
         });
       },
-      // 单击获取id
-      cellClick(row) {
-        this.currentRow = row;
-        this.currentId = row.id;
+      add(isView, row) {
+        console.log('isView--', isView);
+        console.log('row-----', row);
+        this.$refs.addRef.open(isView, row);
       },
-      async getTypeList() {
-        const { data } = await allCategoryLevel();
-        this.codeList = data.map((item) => {
-          return { dictCode: item.id, dictValue: item.name };
-        });
-      },
-      handleAssetType(r) {
-        const code = this.codeList.find((item) => item.dictCode == r);
-        return code?.dictValue;
-      },
-      handleBizType(code, type) {
-        if (type == 1) {
-          // 入库
-          for (const key in this.sceneState) {
-            if (this.sceneState[key].code == code) {
-              return this.sceneState[key].label;
-            }
-          }
-        } else {
-          // 出库
-          for (const key in this.outputSceneState) {
-            if (this.outputSceneState[key].code == code) {
-              return this.outputSceneState[key].label;
-            }
-          }
-        }
-      },
-      async datasource({ page, limit, where }) {
-        if (where.time && where.time.length > 0) {
-          where.startTime = where.time[0];
-          where.endTime = where.time[1];
-          delete where.time;
-        }
-        const res = await storageApi.getInboundList({
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        const data = getStatementLogPage({
+          ...where,
+          ...order,
+          type: 3,
+          keyWord: this.keyWord,
           pageNum: page,
-          size: limit,
-          ...where
+          size: limit
         });
-
-        return res;
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$nextTick(() => {
-          this.$refs.table.reload({ page: 1, where });
-        });
-      },
-      getAuditStatus: useDict(auditStatus),
-      getList() {
-        this.$refs.table.reload();
-      },
-      handleCurrentChange() {
-        this.getList();
-      },
-      handleSizeChange() {
-        this.formData.page = 1;
-        this.getList();
+        return data;
       },
       search() {
-        this.formData.page = 1;
-        this.getList();
+        this.$refs.table.reload();
       },
       reset() {
-        this.$refs.formName.resetFields();
+        this.keyWord = '';
         this.search();
       }
     }
   };
 </script>
-
 <style lang="scss" scoped>
-  #stockOrOutgoingManagement_index {
+  #inventoryBalance {
     height: 100%;
     width: 100%;
     padding: 10px;
     box-sizing: border-box;
-    // element-ui样式穿透
-    ::v-deep .el-card {
-      height: 100%;
-      .el-card__body {
-        height: 100%;
-        box-sizing: border-box;
-        display: flex;
-        flex-direction: column;
-        .ele-pro-table {
-          flex: 1;
-          display: flex;
-          flex-direction: column;
-          .el-table {
-            display: flex;
-            flex-direction: column;
-            .el-table__body-wrapper {
-              flex: 1;
-            }
-          }
-        }
-      }
-    }
-    .w100 {
-      width: 100% !important;
-    }
-    .p20 {
-      padding: 20px;
-    }
-    .mt20 {
-      margin-top: 20px;
-    }
-    .mt10 {
-      margin-top: 10px;
-    }
-    .el-form {
-      overflow: hidden;
-    }
-    .float-right {
-      float: right;
-      text-align: right;
-      margin-right: 20px;
-    }
-    .right {
-      text-align: right;
-    }
-    .col {
-      color: #aaa;
-    }
-    .pr10 {
-      padding-right: 10px;
+    .ele-form-actions {
+      display: flex;
+      justify-content: flex-end;
     }
   }
 </style>

+ 461 - 0
src/views/warehouseManagement/statisticalReports/transceiverSummary/add.vue

@@ -0,0 +1,461 @@
+<template>
+  <el-dialog
+    top="5vh"
+    :visible.sync="visible"
+    :title="isView ? '查看收发汇总表明细' : '选择收发汇总表明细'"
+    width="90vw"
+  >
+    <el-card shadow="never">
+      <!-- 数据表格 -->
+      <div>
+        <el-form
+          label-position="left"
+          class="ele-form-search"
+          :model="formData"
+          :rules="rules"
+          @keyup.enter.native="search"
+          @submit.native.prevent
+        >
+          <el-row :gutter="15">
+            <el-col :span="5">
+              <el-form-item label-width="60px" label="编码:" prop="code">
+                <el-input
+                  disabled
+                  v-model="formData.code"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label-width="60px" label="名称:" prop="name">
+                <el-input
+                  :disabled="isView"
+                  v-model="formData.name"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label-width="90px" label="起止时间:" prop="time">
+                <el-date-picker
+                  :disabled="isView"
+                  style="width: 100%"
+                  class="w100"
+                  size="small"
+                  v-model="formData.time"
+                  type="daterange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="yyyy-MM-dd"
+                  :picker-options="pickerOptions"
+                ></el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label-width="60px" label="关键词:" prop="keyWord">
+                <el-input
+                  :disabled="isView"
+                  v-model="formData.keyWord"
+                  placeholder="请输入关键词"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="!isView" :span="3">
+              <div class="ele-form-actions">
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  class="ele-btn-icon"
+                  @click="search"
+                  size="small"
+                >
+                  查询
+                </el-button>
+                <el-button
+                  @click="reset"
+                  icon="el-icon-refresh-left"
+                  size="small"
+                  type="primary"
+                  >重置</el-button
+                >
+              </div>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <ele-pro-table
+        ref="table"
+        class="table"
+        :needPage="!isView"
+        :columns="columns"
+        :datasource="datasource"
+        height="calc(100vh - 405px)"
+        full-height="calc(100vh - 116px)"
+        tool-class="ele-toolbar-form"
+      >
+        <!-- 状态 -->
+        <!-- <template v-slot:verifyStatus="{ row }">
+          <span :class="status[row.verifyStatus].class">
+            {{ status[row.verifyStatus].label }}
+          </span>
+        </template> -->
+        <template v-slot:bizType="{ row }">
+          {{ handleBizType(row.bizType, row.type) }}
+        </template>
+        <template v-slot:assetType="{ row }">
+          {{ handleAssetType(row.extInfo.assetType) }}
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <div slot="footer" class="dialog-footer" style="margin-right: 2%">
+      <el-button
+        v-if="!isView"
+        size="small"
+        @click="downLoad"
+        :loading="loading"
+        type="primary"
+        >提交并导出</el-button
+      >
+      <el-button v-else size="small" @click="visible = false" type="primary"
+        >确定</el-button
+      >
+      <el-button size="small" @click="visible = false">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { getCode } from '@/api/codeManagement/index.js';
+  import ItemSearch from './components/item-search.vue';
+  import { sendReceiveGatherExcel } from '@/api/warehouseManagement/statisticalReports';
+  import storageApi from '@/api/warehouseManagement';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import {
+    warehousingType,
+    sceneState,
+    outputSceneState,
+    auditStatus,
+    useDict
+  } from '@/utils/dict/index';
+  export default {
+    components: { ItemSearch },
+    data() {
+      return {
+        auditStatus,
+        outputSceneState,
+        warehousingType,
+        sceneState,
+        status: [
+          { label: '未审核', class: 'ele-text-info' },
+          { label: '审核中', class: 'ele-text-primary' },
+          { label: '审核通过', class: 'ele-text-success' },
+          { label: '驳回', class: 'ele-text-danger' }
+        ],
+        loading: false,
+        isView: false,
+        formData: {
+          code: '',
+          name: '',
+          time: [],
+          status: 2,
+          keyWord: ''
+        },
+        // 表单验证规则
+        rules: {
+          name: [
+            { required: true, message: '请输入库存余额名称', trigger: 'blur' }
+          ],
+          time: [
+            { required: true, message: '请选择起止时间', trigger: 'change' }
+          ]
+        },
+        pickerOptions: {
+          shortcuts: [
+            {
+              text: '最近一周',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近一个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近三个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近一年',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
+                picker.$emit('pick', [start, end]);
+              }
+            }
+          ]
+        },
+        visible: false
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        let arr = [
+          {
+            type: 'index',
+            label: '序号',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'bizNo',
+            label: '单号',
+            align: 'center',
+            slot: 'bizNo',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'bizType',
+            slot: 'bizType',
+            label: '出入库类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'assetType',
+            slot: 'assetType',
+            label: '物品类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryNames',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryCodes',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'sourceBizNo',
+            label: '来源单据',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createUserName',
+            label: '操作人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            width: 160,
+            prop: 'storageTime',
+            label: '出入库时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyName',
+            label: '审核人',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+          // {
+          //   prop: 'verifyStatus',
+          //   label: '状态',
+          //   align: 'center',
+          //   slot: 'verifyStatus',
+          //   showOverflowTooltip: true,
+          //   width: 100
+          // }
+        ];
+        return arr.filter((item) => item != '');
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getTypeList();
+    },
+    methods: {
+      async getTypeList() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      handleBizType(code, type) {
+        if (type == 1) {
+          // 入库
+          for (const key in this.sceneState) {
+            if (this.sceneState[key].code == code) {
+              return this.sceneState[key].label;
+            }
+          }
+        } else {
+          // 出库
+          for (const key in this.outputSceneState) {
+            if (this.outputSceneState[key].code == code) {
+              return this.outputSceneState[key].label;
+            }
+          }
+        }
+      },
+      // 获取时间函数
+      getDate(date) {
+        console.log(date);
+        let obj = {
+          year: date.getFullYear(), //获取完整的年份(4位)
+          month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+          strDate: date.getDate() // 获取当前日(1-31)
+        };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      downLoad() {
+        if (!this.formData.name) {
+          return this.$message.error('请输入名称');
+        }
+        if (this.formData.time.length <= 0) {
+          return this.$message.error('请选择时间');
+        }
+        this.loading = true;
+        const params = Object.assign({}, this.formData);
+        if (params.time?.length) {
+          params.startTime = params.time[0];
+          params.endTime = params.time[1];
+        }
+        delete params.time;
+        sendReceiveGatherExcel(params).then((data) => {
+          try {
+            let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
+            let elink = document.createElement('a');
+            elink.setAttribute(
+              'download',
+              decodeURI(decodeURI('收发明细表.xlsx'))
+            );
+            elink.style.display = 'none';
+            elink.href = objectUrl1;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            window.URL.revokeObjectURL(elink.href);
+            this.loading = false;
+            this.visible = false;
+            this.$emit('reload');
+          } catch (err) {
+            this.$message.error('导出失败,请联系管理员!');
+          }
+        });
+      },
+      async open(isView, row) {
+        console.log(row);
+        if (isView) {
+          this.tableList = row.info.map((item) => {
+            return {
+              ...item,
+              startTime: this.getDate(new Date(Number(item.startTime)))
+            };
+          });
+          this.formData.code = row.code;
+          this.formData.name = row.name;
+          this.formData.status = 2;
+          this.formData.time =
+            row.startTime && row.endTime ? [row.startTime, row.endTime] : [];
+          this.formData.keyWord = row.keyWord;
+        } else {
+          this.tableList = [];
+          this.formData = {
+            code: await getCode('statistics_log_code'),
+            name: '',
+            status: 2,
+            time: [],
+            keyWord: ''
+          };
+        }
+        this.isView = isView;
+        this.visible = true;
+        this.$nextTick(() => {
+          this.$refs.table.reload();
+        });
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        if (this.isView) {
+          return this.tableList;
+        } else {
+          const params = Object.assign({}, this.formData);
+          if (params.time?.length) {
+            params.startTime = params.time[0];
+            params.endTime = params.time[1];
+          }
+          delete params.time;
+          const data = await storageApi.getInboundList({
+            ...params,
+            ...where,
+            ...order,
+            pageNum: page,
+            size: limit
+          });
+          console.log(data);
+          this.tableList = data;
+          return data;
+        }
+      },
+      search() {
+        this.$refs.table.reload();
+      },
+      reset() {
+        this.formData.time = [];
+        this.formData.keyWord = '';
+        this.search();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  #inventoryBalance {
+    height: 100%;
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    .ele-form-actions {
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+</style>

+ 354 - 0
src/views/warehouseManagement/statisticalReports/transceiverSummary/index copy.vue

@@ -0,0 +1,354 @@
+<template>
+  <div class="stockOrOutgoingManagement_index">
+    <el-card shadow="never">
+      <item-search @search="reload" ref="refSeavch"></item-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        @cell-click="cellClick"
+        cache-key="systemRoleTable"
+      >
+        <!-- <template v-slot:selection="{ row }">
+          <el-radio class="radio" v-model="currentId" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template> -->
+        <!-- 表头工具栏 -->
+        <!-- <template v-slot:toolbar>
+          <el-button icon="el-icon-plus" type="primary" @click="downLoad"
+            >导出</el-button
+          >
+        </template> -->
+        <template v-slot:toolbar="{ row }">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-download"
+            class="ele-btn-icon"
+            @click="downLoad"
+          >
+            导出收发汇总表
+          </el-button>
+        </template>
+        <!-- 状态 -->
+        <template v-slot:verifyStatus="{ row }">
+          <span :class="status[row.verifyStatus].class">
+            {{ status[row.verifyStatus].label }}
+          </span>
+        </template>
+        <template v-slot:bizType="{ row }">
+          {{ handleBizType(row.bizType, row.type) }}
+        </template>
+        <template v-slot:assetType="{ row }">
+          {{ handleAssetType(row.extInfo.assetType) }}
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import { sendReceiveGatherExcel } from '@/api/warehouseManagement/statisticalReports';
+  import ItemSearch from './components/item-search.vue';
+  import * as XLSX from 'xlsx';
+  import storageApi from '@/api/warehouseManagement';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { allCategoryLevel } from '@/api/classifyManage';
+  import {
+    warehousingType,
+    sceneState,
+    outputSceneState,
+    auditStatus,
+    useDict
+  } from '@/utils/dict/index';
+  export default {
+    components: { ItemSearch },
+    data() {
+      return {
+        type: '',
+        params: {},
+        auditStatus,
+        outputSceneState,
+        warehousingType,
+        sceneState,
+        codeList: [],
+        factoryList: [],
+        tableData: [],
+        formData: {
+          deptIds: '',
+          categoryCode: '',
+          categoryName: '',
+          sourceBizNo: '',
+          startTime: '',
+          endTime: '',
+          status: '',
+          factoryId: '',
+          time: []
+        },
+        total: 0,
+        status: [
+          { label: '未审核', class: 'ele-text-info' },
+          { label: '审核中', class: 'ele-text-primary' },
+          { label: '审核通过', class: 'ele-text-success' },
+          { label: '驳回', class: 'ele-text-danger' }
+        ],
+        currentId: '',
+        currentRow: {},
+        columns: [
+          // {
+          //   slot: 'selection',
+          //   label: '选择',
+          //   width: 50,
+          //   align: 'center'
+          // },
+          {
+            type: 'index',
+            label: '序号',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'bizNo',
+            label: '单号',
+            align: 'center',
+            slot: 'bizNo',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'bizType',
+            slot: 'bizType',
+            label: '出入库类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'assetType',
+            slot: 'assetType',
+            label: '物品类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryNames',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'categoryCodes',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'sourceBizNo',
+            label: '来源单据',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createUserName',
+            label: '操作人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            width: 160,
+            prop: 'storageTime',
+            label: '出入库时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyName',
+            label: '审核人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'verifyStatus',
+            label: '状态',
+            align: 'center',
+            slot: 'verifyStatus',
+            showOverflowTooltip: true,
+            width: 100
+          }
+        ]
+      };
+    },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    created() {
+      this.getTypeList();
+    },
+    methods: {
+      downLoad() {
+        const params = Object.assign({}, this.$refs.refSeavch.params);
+        if (params.time?.length) {
+          params.startTime = params.time[0];
+          params.endTime = params.time[1];
+        }
+        delete params.time;
+        sendReceiveGatherExcel(params).then((data) => {
+          try {
+            let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
+            let elink = document.createElement('a');
+            elink.setAttribute(
+              'download',
+              decodeURI(decodeURI('收发汇总表.xlsx'))
+            );
+            elink.style.display = 'none';
+            elink.href = objectUrl1;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            window.URL.revokeObjectURL(elink.href);
+          } catch (err) {
+            this.$message.error('导出失败,请联系管理员!');
+          }
+        });
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      async getTypeList() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data.map((item) => {
+          return { dictCode: item.id, dictValue: item.name };
+        });
+      },
+      handleAssetType(r) {
+        const code = this.codeList.find((item) => item.dictCode == r);
+        return code?.dictValue;
+      },
+      handleBizType(code, type) {
+        if (type == 1) {
+          // 入库
+          for (const key in this.sceneState) {
+            if (this.sceneState[key].code == code) {
+              return this.sceneState[key].label;
+            }
+          }
+        } else {
+          // 出库
+          for (const key in this.outputSceneState) {
+            if (this.outputSceneState[key].code == code) {
+              return this.outputSceneState[key].label;
+            }
+          }
+        }
+      },
+      async datasource({ page, limit, where }) {
+        if (where.time && where.time.length > 0) {
+          where.startTime = where.time[0];
+          where.endTime = where.time[1];
+          delete where.time;
+        }
+        const res = await storageApi.getInboundList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+
+        return res;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
+      getAuditStatus: useDict(auditStatus),
+      getList() {
+        this.$refs.table.reload();
+      },
+      handleCurrentChange() {
+        this.getList();
+      },
+      handleSizeChange() {
+        this.formData.page = 1;
+        this.getList();
+      },
+      search() {
+        this.formData.page = 1;
+        this.getList();
+      },
+      reset() {
+        this.$refs.formName.resetFields();
+        this.search();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  #stockOrOutgoingManagement_index {
+    height: 100%;
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    // element-ui样式穿透
+    ::v-deep .el-card {
+      height: 100%;
+      .el-card__body {
+        height: 100%;
+        box-sizing: border-box;
+        display: flex;
+        flex-direction: column;
+        .ele-pro-table {
+          flex: 1;
+          display: flex;
+          flex-direction: column;
+          .el-table {
+            display: flex;
+            flex-direction: column;
+            .el-table__body-wrapper {
+              flex: 1;
+            }
+          }
+        }
+      }
+    }
+    .w100 {
+      width: 100% !important;
+    }
+    .p20 {
+      padding: 20px;
+    }
+    .mt20 {
+      margin-top: 20px;
+    }
+    .mt10 {
+      margin-top: 10px;
+    }
+    .el-form {
+      overflow: hidden;
+    }
+    .float-right {
+      float: right;
+      text-align: right;
+      margin-right: 20px;
+    }
+    .right {
+      text-align: right;
+    }
+    .col {
+      color: #aaa;
+    }
+    .pr10 {
+      padding-right: 10px;
+    }
+  }
+</style>

+ 120 - 255
src/views/warehouseManagement/statisticalReports/transceiverSummary/index.vue

@@ -1,107 +1,106 @@
 <template>
-  <div class="stockOrOutgoingManagement_index">
+  <div id="inventoryBalance">
     <el-card shadow="never">
-      <item-search @search="reload" ref="refSeavch"></item-search>
+      <!-- 数据表格 -->
+      <div>
+        <el-form
+          label-width="60px"
+          label-position="left"
+          class="ele-form-search"
+          @keyup.enter.native="search"
+          @submit.native.prevent
+        >
+          <el-row :gutter="15">
+            <el-col :span="6">
+              <el-form-item label="关键词:" prop="keyWord">
+                <el-input
+                  clearable
+                  v-model="keyWord"
+                  placeholder="请输入关键词"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="18">
+              <div class="ele-form-actions">
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  class="ele-btn-icon"
+                  @click="search"
+                  size="small"
+                >
+                  查询
+                </el-button>
+                <el-button
+                  @click="reset"
+                  icon="el-icon-refresh-left"
+                  size="small"
+                  type="primary"
+                  >重置</el-button
+                >
+              </div>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
       <ele-pro-table
         ref="table"
+        class="table"
         :columns="columns"
         :datasource="datasource"
-        @cell-click="cellClick"
-        cache-key="systemRoleTable"
+        height="calc(100vh - 405px)"
+        full-height="calc(100vh - 116px)"
+        tool-class="ele-toolbar-form"
       >
-        <!-- <template v-slot:selection="{ row }">
-          <el-radio class="radio" v-model="currentId" :label="row.id"
-            ><i></i
-          ></el-radio>
-        </template> -->
-        <!-- 表头工具栏 -->
-        <!-- <template v-slot:toolbar>
-          <el-button icon="el-icon-plus" type="primary" @click="downLoad"
-            >导出</el-button
-          >
-        </template> -->
         <template v-slot:toolbar="{ row }">
           <el-button
             size="small"
             type="primary"
-            icon="el-icon-download"
+            icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="downLoad"
+            @click="add(false)"
           >
-            导出收发汇总表
+            新增
           </el-button>
         </template>
-        <!-- 状态 -->
-        <template v-slot:verifyStatus="{ row }">
-          <span :class="status[row.verifyStatus].class">
-            {{ status[row.verifyStatus].label }}
-          </span>
-        </template>
-        <template v-slot:bizType="{ row }">
-          {{ handleBizType(row.bizType, row.type) }}
-        </template>
-        <template v-slot:assetType="{ row }">
-          {{ handleAssetType(row.extInfo.assetType) }}
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-view"
+            @click="add(true, row)"
+          >
+            详情
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-download"
+            @click="downLoad(row)"
+          >
+            下载
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>
+    <add ref="addRef" @reload="search" />
   </div>
 </template>
 
 <script>
-  import { sendReceiveGatherExcel } from '@/api/warehouseManagement/statisticalReports';
+  import add from './add.vue';
   import ItemSearch from './components/item-search.vue';
-  import * as XLSX from 'xlsx';
-  import storageApi from '@/api/warehouseManagement';
-  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-  import { allCategoryLevel } from '@/api/classifyManage';
   import {
-    warehousingType,
-    sceneState,
-    outputSceneState,
-    auditStatus,
-    useDict
-  } from '@/utils/dict/index';
+    getStatementLogPage,
+    sendReceiveGatherExcel
+  } from '@/api/warehouseManagement/statisticalReports';
+
   export default {
-    components: { ItemSearch },
+    components: { ItemSearch, add },
     data() {
       return {
-        type: '',
-        params: {},
-        auditStatus,
-        outputSceneState,
-        warehousingType,
-        sceneState,
-        codeList: [],
-        factoryList: [],
-        tableData: [],
-        formData: {
-          deptIds: '',
-          categoryCode: '',
-          categoryName: '',
-          sourceBizNo: '',
-          startTime: '',
-          endTime: '',
-          status: '',
-          factoryId: '',
-          time: []
-        },
-        total: 0,
-        status: [
-          { label: '未审核', class: 'ele-text-info' },
-          { label: '审核中', class: 'ele-text-primary' },
-          { label: '审核通过', class: 'ele-text-success' },
-          { label: '驳回', class: 'ele-text-danger' }
-        ],
-        currentId: '',
-        currentRow: {},
+        keyWord: '',
         columns: [
-          // {
-          //   slot: 'selection',
-          //   label: '选择',
-          //   width: 50,
-          //   align: 'center'
-          // },
           {
             type: 'index',
             label: '序号',
@@ -109,97 +108,57 @@
             align: 'center'
           },
           {
-            prop: 'bizNo',
-            label: '单号',
+            prop: 'code',
+            label: '编码',
             align: 'center',
-            slot: 'bizNo',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'bizType',
-            slot: 'bizType',
-            label: '出入库类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'assetType',
-            slot: 'assetType',
-            label: '物品类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'categoryNames',
-            label: '物品名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
-          },
-          {
-            prop: 'categoryCodes',
-            label: '物品编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 150
+            showOverflowTooltip: true
           },
           {
-            prop: 'sourceBizNo',
-            label: '来源单据',
+            prop: 'name',
+            label: '名称',
             align: 'center',
             showOverflowTooltip: true
           },
-
           {
             prop: 'createUserName',
-            label: '操作人',
+            label: '创建人',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            width: 160,
-            prop: 'storageTime',
-            label: '出入库时间',
+            prop: 'startTime',
+            label: '开始时间',
+            slot: 'startTime',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'verifyName',
-            label: '审核人',
+            prop: 'endTime',
+            label: '结束时间',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'verifyStatus',
-            label: '状态',
+            columnKey: 'action',
+            label: '操作',
+            fixed: 'right',
+            width: 250,
             align: 'center',
-            slot: 'verifyStatus',
-            showOverflowTooltip: true,
-            width: 100
+            slot: 'action',
+            showOverflowTooltip: true
           }
         ]
       };
     },
-    computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      }
-    },
-    created() {
-      this.getTypeList();
-    },
     methods: {
-      downLoad() {
-        const params = Object.assign({}, this.$refs.refSeavch.params);
-        if (params.time?.length) {
-          params.startTime = params.time[0];
-          params.endTime = params.time[1];
-        }
-        delete params.time;
-        sendReceiveGatherExcel(params).then((data) => {
+      downLoad(row) {
+        sendReceiveGatherExcel({
+          code: row.code,
+          name: row.name,
+          startTime: row.startTime,
+          endTime: row.endTime,
+          exportStatus: 1
+        }).then((data) => {
           try {
             let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
             let elink = document.createElement('a');
@@ -213,142 +172,48 @@
             elink.click();
             document.body.removeChild(elink);
             window.URL.revokeObjectURL(elink.href);
+            this.search();
           } catch (err) {
             this.$message.error('导出失败,请联系管理员!');
           }
         });
       },
-      // 单击获取id
-      cellClick(row) {
-        this.currentRow = row;
-        this.currentId = row.id;
-      },
-      async getTypeList() {
-        const { data } = await allCategoryLevel();
-        this.codeList = data.map((item) => {
-          return { dictCode: item.id, dictValue: item.name };
-        });
-      },
-      handleAssetType(r) {
-        const code = this.codeList.find((item) => item.dictCode == r);
-        return code?.dictValue;
-      },
-      handleBizType(code, type) {
-        if (type == 1) {
-          // 入库
-          for (const key in this.sceneState) {
-            if (this.sceneState[key].code == code) {
-              return this.sceneState[key].label;
-            }
-          }
-        } else {
-          // 出库
-          for (const key in this.outputSceneState) {
-            if (this.outputSceneState[key].code == code) {
-              return this.outputSceneState[key].label;
-            }
-          }
-        }
+      add(isView, row) {
+        console.log('isView--', isView);
+        console.log('row-----', row);
+        this.$refs.addRef.open(isView, row);
       },
-      async datasource({ page, limit, where }) {
-        if (where.time && where.time.length > 0) {
-          where.startTime = where.time[0];
-          where.endTime = where.time[1];
-          delete where.time;
-        }
-        const res = await storageApi.getInboundList({
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        const data = getStatementLogPage({
+          ...where,
+          ...order,
+          type: 2,
+          keyWord: this.keyWord,
           pageNum: page,
-          size: limit,
-          ...where
+          size: limit
         });
-
-        return res;
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$nextTick(() => {
-          this.$refs.table.reload({ page: 1, where });
-        });
-      },
-      getAuditStatus: useDict(auditStatus),
-      getList() {
-        this.$refs.table.reload();
-      },
-      handleCurrentChange() {
-        this.getList();
-      },
-      handleSizeChange() {
-        this.formData.page = 1;
-        this.getList();
+        return data;
       },
       search() {
-        this.formData.page = 1;
-        this.getList();
+        this.$refs.table.reload();
       },
       reset() {
-        this.$refs.formName.resetFields();
+        this.keyWord = '';
         this.search();
       }
     }
   };
 </script>
-
 <style lang="scss" scoped>
-  #stockOrOutgoingManagement_index {
+  #inventoryBalance {
     height: 100%;
     width: 100%;
     padding: 10px;
     box-sizing: border-box;
-    // element-ui样式穿透
-    ::v-deep .el-card {
-      height: 100%;
-      .el-card__body {
-        height: 100%;
-        box-sizing: border-box;
-        display: flex;
-        flex-direction: column;
-        .ele-pro-table {
-          flex: 1;
-          display: flex;
-          flex-direction: column;
-          .el-table {
-            display: flex;
-            flex-direction: column;
-            .el-table__body-wrapper {
-              flex: 1;
-            }
-          }
-        }
-      }
-    }
-    .w100 {
-      width: 100% !important;
-    }
-    .p20 {
-      padding: 20px;
-    }
-    .mt20 {
-      margin-top: 20px;
-    }
-    .mt10 {
-      margin-top: 10px;
-    }
-    .el-form {
-      overflow: hidden;
-    }
-    .float-right {
-      float: right;
-      text-align: right;
-      margin-right: 20px;
-    }
-    .right {
-      text-align: right;
-    }
-    .col {
-      color: #aaa;
-    }
-    .pr10 {
-      padding-right: 10px;
+    .ele-form-actions {
+      display: flex;
+      justify-content: flex-end;
     }
   }
 </style>

Разница между файлами не показана из-за своего большого размера
+ 452 - 283
src/views/warehouseManagement/stockManagement/add.vue


+ 6 - 0
src/views/warehouseManagement/stockManagement/index.vue

@@ -368,6 +368,12 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'startTime',
+            label: '开始时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             prop: 'verifyStatus',
             label: '状态',

Некоторые файлы не были показаны из-за большого количества измененных файлов