Ver Fonte

Merge branch 'develop_yh26' of jianguan-web/qpls-md-html into pre-release

李磊 há 1 ano atrás
pai
commit
7a270d77d7

+ 247 - 0
src/views/bulkManagement/bulkImport/chooseImportModal.vue

@@ -0,0 +1,247 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="72%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="chooseImport-con">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          style="height: 500px"
+          size="small"
+          :rowClassName="(record, index) => record.isError==1 ? 'redBg-row':''"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y:430 ,x: 1990}"
+          :defaultLoadData="false"
+          bordered>
+        </s-table>
+        <!-- 按钮 -->
+        <div class="btn-con">
+          <a-button
+            type="primary"
+            id="chooseImport-submit"
+            size="large"
+            class="button-primary"
+            @click="handleConfirm"
+            style="padding: 0 40px;">确认导入</a-button>
+          <a-button
+            id="chooseImport-cancel"
+            size="large"
+            class="button-cancel"
+            @click="handleCancel"
+            style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+          <a-button
+            type="primary"
+            id="chooseImport-error"
+            size="large"
+            class="button-error"
+            @click="handleExportError"
+            style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+        </div>
+      </div>
+      <common-modal
+        :openModal="openTipsModal"
+        :modalHtml="modalHtml"
+        modalTit="操作提示"
+        okText="确定"
+        :isCancel="false"
+        @ok="operationEnd"
+        @close="openTipsModal=false" />
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, Upload } from '@/components'
+import { stockImportList, stockImportFinish, stockImportCancel, stockImportExportError } from '@/api/stockImport'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import commonModal from '@/views/common/commonModal.vue'
+export default {
+  name: 'StockImportList',
+  components: { STable, Upload, commonModal },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openTipsModal: false,
+      modalHtml: '',
+      spinning: false,
+      exportLoading: false, // 导出loading
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.listData = data.list
+            if (this.uploadData && data.list.length == 0) {
+              this.$message.info('没有可导入数据,请检查模板是否为空')
+              this.resetSearchForm()
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      isAllError: false, // 是否全部错误
+      listData: [],
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 30, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', width: 100, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: 100, customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', width: 120, customRender: function (text) { return text || '--' } },
+        { title: '产品一级分类', dataIndex: 'productTypeName1', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品二级分类', dataIndex: 'productTypeName2', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品三级分类', dataIndex: 'productTypeName3', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'cost', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '售价', dataIndex: 'terminalPrice', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '错误原因', dataIndex: 'errorMsg', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+    }
+  },
+  methods: {
+    resetSearchForm () {
+      this.$refs.table.clearTable() //  清空列表数据
+      this.uploadData = null //  清空上传数据
+    },
+    // 确认导入
+    handleConfirm () {
+      const _this = this
+      if (this.isAllError) {
+        this.$message.error('没有可导入的数据!')
+        return false
+      }
+      _this.spinning = true
+      stockImportFinish({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.showSuccessModal(res.data)
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    showSuccessModal (data) {
+      if (data) {
+        this.openTipsModal = true
+        this.modalHtml = `<div><div>库存导入成功</div><div>入库类型:散件导入</div><div>库存批次:${data.stockBatchNo}</div><div>总导入款数:${data.productTotalCategory}</div><div>总入库数量:${data.productTotalQty}</div><div>总入库成本:${data.productTotalCost}</div></div>`
+      }
+    },
+    // 操作完成
+    operationEnd () {
+      this.$emit('ok')
+      this.openTipsModal = false
+      this.isShow = false
+      this.resetSearchForm()
+    },
+    // 取消导入
+    handleCancel () {
+      const _this = this
+      _this.spinning = true
+      stockImportCancel({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.spinning = false
+          _this.isShow = false
+          _this.resetSearchForm()
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    // 导出错误项
+    handleExportError () {
+      const _this = this
+      _this.spinning = true
+      stockImportExportError({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          downloadExcel(res, '散件导入错误项')
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        if (this.paramsData) {
+          this.uploadData = this.paramsData
+          const _this = this
+          this.$nextTick(() => {
+            _this.$refs.table.refresh(true)
+          })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      /deep/.redBg-row{
+        background-color: #F39494 !important;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 194 - 0
src/views/bulkManagement/bulkImport/importGuideModal.vue

@@ -0,0 +1,194 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="散件导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的EXCEL文件中必须包含名为"供应商"、"产品品牌"、"产品编码"、"原厂编码"、"产品名称"、"产品一级分类"、"产品二级分类"、"产品三级分类"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价";列顺序可忽略、行顺序可忽略。其中"供应商"、"产品品牌"、"产品编码"、"产品名称"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价"内容不能为空。</li>
+            <li>2) 红色底为错误项,错误项忽略不能导入,正确项可直接导入。</li>
+            <li>3) 供应商/产品品牌为必填项且不能包含箭冠、箭牌、冠牌等文字,产品名称为必填项。</li>
+            <li>4) 支持上传文件格式:.xls、.xlsx。</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { Upload, ChooseImportModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/stockImport/importForSpareParts',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      filePath: location.protocol + '//' + location.host + '/templ/散件产品导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
+      } else {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk () {
+      this.$emit('ok')
+      this.isShow = false
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 165 - 247
src/views/bulkManagement/bulkImport/list.vue

@@ -1,253 +1,229 @@
 <template>
 <template>
-  <a-card size="small" :bordered="false" class="bulkImportList-wrap">
+  <a-card size="small" :bordered="false" class="warehouseList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div ref="tableSearch" class="table-page-search-wrapper">
-        <Upload
-          id="bulkImportList-attachList"
-          ref="importUpload"
-          :maxNums="1"
-          fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
-          uploadType="attach"
-          :action="attachAction"
-          :uploadParams="uploadParams"
-          upText="选择导入文件"
-          @remove="resetSearchForm"
-          @change="changeImport"></Upload>
-        <a :href="filePath" style="margin: 5px 0 0 15px;display: block;float: left;">
-          <a-icon type="download" style="padding-right: 5px;" />下载导入模板
-        </a>
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="inventoryImport-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="导入时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="导入单号">
+                <a-input id="inventoryImport-no" v-model.trim="queryParam.stockImportNo" allowClear placeholder="请输入导入单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryImport-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryImport-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
       </div>
-      <div class="importGuide-con">
-        <div class="explain-con">
-          <div class="explain-item">
-            <div class="explain-tit">导入文件说明</div>
-            <ul>
-              <li>1) 导入的EXCEL文件中必须包含名为"供应商"、"产品品牌"、"产品编码"、"原厂编码"、"产品名称"、"产品一级分类"、"产品二级分类"、"产品三级分类"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价";列顺序可忽略、行顺序可忽略。其中"供应商"、"产品品牌"、"产品编码"、"产品名称"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价"内容不能为空。</li>
-              <li>2) 红色底为错误项,错误项忽略不能导入,正确项可直接导入。</li>
-              <li>3) 供应商/产品品牌为必填项且不能包含箭冠、箭牌、冠牌等文字,产品名称为必填项。</li>
-              <li>4) 支持上传文件格式:.xls、.xlsx。</li>
-            </ul>
+      <!-- 导入按钮 -->
+      <!-- v-if="$hasPermissions('B_inventory_warehouse_add')" -->
+      <div class="table-operator">
+        <a-button id="inventoryImport-add" type="primary" class="button-error" @click="openGuideModal=true">散件导入</a-button>
+      </div>
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
+          产品总数量:<strong>{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}</strong>;
+          <div v-if="$hasPermissions('M_ShowAllCost')" style="display: inline-block;">
+            总成本:<strong>{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? toThousands(totalData.productTotalCost) : '--' }}</strong>。
           </div>
           </div>
         </div>
         </div>
-      </div>
+      </a-alert>
       <!-- 列表 -->
       <!-- 列表 -->
       <s-table
       <s-table
-        class="sTable fixPagination"
+        class="sTable"
         ref="table"
         ref="table"
-        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         size="small"
-        :rowClassName="(record, index) => record.isError==1 ? 'redBg-row':''"
-        :rowKey="(record) => record.id"
+        :style="{ height: tableHeight+84.5+'px' }"
+        :rowKey="(record) => record.stockImportSn"
+        rowKeyName="stockImportSn"
         :columns="columns"
         :columns="columns"
         :data="loadData"
         :data="loadData"
-        :scroll="{ x: 1680, y: tableHeight }"
         :defaultLoadData="false"
         :defaultLoadData="false"
         bordered>
         bordered>
+        <!-- 导入单号 -->
+        <template slot="stockImportNo" slot-scope="text, record">
+          <span class="table-td-link" @click="handleDetail(record)">{{ record.stockImportNo }}</span>
+        </template>
       </s-table>
       </s-table>
-      <div class="btn-con" v-if="uploadData && uploadData.stockImportSn && listData.length">
-        <a-button
-          id="productInfoList-batchAudit"
-          type="primary"
-          class="button-warning"
-          @click="handleConfirm"
-          style="margin: 0 15px;">确认导入</a-button>
-        <a-button
-          id="productInfoList-batchLaunch"
-          type="primary"
-          class="button-primary"
-          @click="handleCancel"
-          style="margin: 0 15px;">取消导入</a-button>
-        <a-button
-          id="productInfoList-batchDownline"
-          type="primary"
-          class="button-grey"
-          @click="handleExportError"
-          style="margin: 0 15px;">导出错误项</a-button>
-      </div>
     </a-spin>
     </a-spin>
-    <common-modal
-      :openModal="openTipsModal"
-      :modalHtml="modalHtml"
-      modalTit="操作提示"
-      okText="确定"
-      :isCancel="false"
-      @ok="openTipsModal=false"
-      @close="openTipsModal=false" />
+    <!-- 散件导入 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+    <!-- 散件导入详情 -->
+    <a-modal
+      centered
+      class="chooseImport-modal"
+      :footer="null"
+      title="散件导入明细"
+      v-model="openBulkImportDetail"
+      @cancel="openBulkImportDetail=false;detailSn=undefined;"
+      width="70%">
+      <detailList ref="bulkImportDeail" typeInfo="SPARE_PARTS_IMPORT" :detailSn="detailSn"></detailList>
+    </a-modal>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
-import { STable, Upload } from '@/components'
-import { stockImportList, stockImportFinish, stockImportCancel, stockImportExportError } from '@/api/stockImport'
-import { downloadExcel } from '@/libs/JGPrint.js'
-import commonModal from '@/views/common/commonModal.vue'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import detailList from '@/views/inventoryManagement/inventoryImport/detailList.vue'
+import getDate from '@/libs/getDate.js'
+import importGuideModal from './importGuideModal.vue'
+import { reportStockImportList, reportStockImportCount } from '@/api/reportData'
 export default {
 export default {
-  name: 'StockImportList',
-  components: { STable, Upload, commonModal },
+  components: { STable, VSelect, rangeDate, importGuideModal, detailList },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
-    const _this = this
     return {
     return {
-      openTipsModal: false,
-      modalHtml: '',
       spinning: false,
       spinning: false,
-      exportLoading: false, // 导出loading
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
       tableHeight: 0,
       tableHeight: 0,
-      queryParam: {}, // 查询参数
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'supplierName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品一级分类', dataIndex: 'productTypeName1', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品二级分类', dataIndex: 'productTypeName2', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品三级分类', dataIndex: 'productTypeName3', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'putQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'cost', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '售价', dataIndex: 'terminalPrice', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '错误原因', dataIndex: 'errorMsg', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
-      ],
+      queryParam: { //  查询条件
+        time: [
+          getDate.getThreeMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: '',
+        endDate: '',
+        stockImportNo: undefined,
+        importType: 'SPARE_PARTS_IMPORT'
+      },
+      openGuideModal: false,
+      detailSn: undefined,
+      rules: {
+        'time': [{ required: true, message: '请选择导入时间', trigger: 'change' }]
+      },
+      openBulkImportDetail: false, // 明细弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         this.spinning = true
-        return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
+        delete params.time
+        return reportStockImportList(params).then(res => {
           let data
           let data
           if (res.status == 200) {
           if (res.status == 200) {
             data = res.data
             data = res.data
+            // 总计
+            this.getCount(params)
             const no = (data.pageNo - 1) * data.pageSize
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].no = no + i + 1
             }
             }
-            this.listData = data.list
-            if (this.uploadData && data.list.length == 0) {
-              this.$message.info('没有可导入数据,请检查模板是否为空')
-              this.resetSearchForm()
-            }
+            this.disabled = false
           }
           }
           this.spinning = false
           this.spinning = false
           return data
           return data
         })
         })
       },
       },
-      listData: [],
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/stockImport/importForSpareParts',
-      uploadParams: {
-        savePathType: 'local'
-      },
-      uploadData: null,
-      filePath: location.protocol + '//' + location.host + '/templ/散件产品导入模板.xlsx'
+      totalData: null //  合计
     }
     }
   },
   },
-  methods: {
-    // 上传文件  change
-    changeImport (file) {
-      if (file && JSON.parse(file).length > 0) {
-        this.uploadData = JSON.parse(file)[0] || null
-        if (this.uploadData && this.uploadData.stockImportSn) {
-          this.$refs.table.refresh(true)
-        }
-      } else {
-        this.uploadData = null
-      }
-    },
-    resetSearchForm () {
-      this.$refs.table.clearTable() //  清空列表数据
-      this.$refs.importUpload.setFileList() //  清空导入文件
-      this.uploadData = null //  清空上传数据
-    },
-    // 确认导入
-    handleConfirm () {
+  computed: {
+    columns () {
       const _this = this
       const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '您是否确认导入产品信息?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          stockImportFinish({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.resetSearchForm()
-              _this.showSuccessModal(res.data)
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
-    },
-    showSuccessModal (data) {
-      if (data) {
-        this.openTipsModal = true
-        this.modalHtml = `<div><div>库存导入成功</div><div>入库类型:散件导入</div><div>库存批次:${data.stockBatchNo}</div><div>总导入款数:${data.productTotalCategory}</div><div>总入库数量:${data.productTotalQty}</div><div>总入库成本:${data.productTotalCost}</div></div>`
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '导入时间', dataIndex: 'importTime', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '导入单号', dataIndex: 'stockImportNo', width: '18%', align: 'center', scopedSlots: { customRender: 'stockImportNo' } },
+        { title: '款数', dataIndex: 'productTotalCategory', width: '18%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'productTotalQty', width: '18%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本', dataIndex: 'productTotalCost', width: '20%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       }
+      return arr
+    }
+  },
+  methods: {
+    // 详情
+    handleDetail (row) {
+      this.openBulkImportDetail = true
+      this.detailSn = row.stockImportNo
+      this.$nextTick(() => {
+        this.$refs.bulkImportDeail.handleSearch()
+      })
     },
     },
-    // 取消导入
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '您确认取消导入产品的信息?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          stockImportCancel({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.resetSearchForm()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+    // 合计
+    getCount (params) {
+      reportStockImportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
         }
         }
       })
       })
     },
     },
-    // 导出错误项
-    handleExportError () {
-      const _this = this
-      _this.spinning = true
-      stockImportExportError({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
-          })
-          reader.readAsText(res)
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
         } else {
         } else {
-          downloadExcel(res, '散件导入错误项')
+          console.log('error submit!!')
+          return false
         }
         }
       })
       })
     },
     },
+    // 库存导入成功
+    hanldeImprotOk () {
+      this.$refs.table.refresh(true)
+    },
+    //  重置
+    resetSearchForm (flag) {
+      this.queryParam.time = [
+        getDate.getThreeMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.stockImportNo = undefined
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+      this.handleSearch()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 276
+    },
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
         _this.setTableH()
       })
       })
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 400
     }
     }
   },
   },
   watch: {
   watch: {
-    advanced (newValue, oldValue) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
       this.setTableH()
     }
     }
@@ -270,61 +246,3 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
-<style lang="less">
-  .bulkImportList-wrap{
-    .table-page-search-wrapper{
-      overflow: hidden;
-      .upload-file{
-        height: auto;
-        margin-bottom: 10px;
-        .ant-btn{
-          background-color: #f30;
-          border-color: #f30;
-          margin: 0 5px;
-          font-size: 12px;
-          color: #fff;
-        }
-      }
-    }
-    .importGuide-con{
-      .explain-con{
-        .explain-item{
-          margin-bottom: 10px;
-          .explain-tit{
-            font-weight: bold;
-            span{
-              display: inline-block;
-              width: 18px;
-              height: 18px;
-              line-height: 16px;
-              text-align: center;
-              margin-right: 5px;
-              border-radius: 50%;
-              border: 1px solid rgba(0, 0, 0, 0.3);
-            }
-          }
-          p{
-            margin: 8px 0;
-            padding-left: 23px;
-          }
-          ul{
-            list-style: none;
-            padding: 0;
-            padding-left: 23px;
-            margin: 0;
-            li{
-              line-height: 26px;
-              font-size: 12px;
-            }
-          }
-        }
-      }
-    }
-    .redBg-row{
-      background-color: #F39494;
-    }
-    .btn-con{
-      text-align: center;
-    }
-  }
-</style>

+ 248 - 0
src/views/inventoryManagement/inventoryImport/chooseImportModal.vue

@@ -0,0 +1,248 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="72%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="chooseImport-con">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          style="height: 500px"
+          size="small"
+          :rowClassName="(record, index) => record.isError==1 ? 'redBg-row':''"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y:430}"
+          :defaultLoadData="false"
+          bordered>
+        </s-table>
+        <!-- 按钮 -->
+        <div class="btn-con">
+          <a-button
+            type="primary"
+            id="chooseImport-submit"
+            size="large"
+            class="button-primary"
+            @click="handleConfirm"
+            style="padding: 0 40px;">确认导入</a-button>
+          <a-button
+            id="chooseImport-cancel"
+            size="large"
+            class="button-cancel"
+            @click="handleCancel"
+            style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+          <a-button
+            type="primary"
+            id="chooseImport-error"
+            size="large"
+            class="button-error"
+            @click="handleExportError"
+            style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+        </div>
+      </div>
+      <common-modal
+        :openModal="openTipsModal"
+        :modalHtml="modalHtml"
+        modalTit="操作提示"
+        okText="确定"
+        :isCancel="false"
+        @ok="operationEnd"
+        @close="openTipsModal=false" />
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, Upload } from '@/components'
+import { stockImportList, stockImportFinish, stockImportCancel, stockImportKCExportError } from '@/api/stockImport'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import commonModal from '@/views/common/commonModal.vue'
+export default {
+  name: 'StockImportList',
+  components: { STable, Upload, commonModal },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openTipsModal: false,
+      modalHtml: '',
+      spinning: false,
+      exportLoading: false, // 导出loading
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            const ret = data.list.filter(item => item.isError == 1)
+            this.isAllError = ret.length == data.count
+            this.listData = data.list
+            if (this.uploadData && data.list.length == 0) {
+              this.$message.info('没有可导入数据,请检查模板是否为空')
+              this.resetSearchForm()
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      isAllError: false, // 是否全部错误
+      listData: []
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    resetSearchForm () {
+      this.$refs.table.clearTable() //  清空列表数据
+      this.uploadData = null //  清空上传数据
+    },
+    // 确认导入
+    handleConfirm () {
+      const _this = this
+      if (this.isAllError) {
+        this.$message.error('没有可导入的数据!')
+        return false
+      }
+      _this.spinning = true
+      stockImportFinish({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.showSuccessModal(res.data)
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    showSuccessModal (data) {
+      if (data) {
+        this.openTipsModal = true
+        this.modalHtml = `<div><div>库存导入成功</div><div>入库类型:库存导入</div><div>库存批次:${data.stockBatchNo}</div><div>总导入款数:${data.productTotalCategory}</div><div>总入库数量:${data.productTotalQty}</div><div>总入库成本:${data.productTotalCost}</div></div>`
+      }
+    },
+    // 操作完成
+    operationEnd () {
+      this.$emit('ok')
+      this.openTipsModal = false
+      this.isShow = false
+      this.resetSearchForm()
+    },
+    // 取消导入
+    handleCancel () {
+      const _this = this
+      _this.spinning = true
+      stockImportCancel({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.spinning = false
+          _this.isShow = false
+          _this.resetSearchForm()
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    // 导出错误项
+    handleExportError () {
+      const _this = this
+      _this.spinning = true
+      stockImportKCExportError({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          downloadExcel(res, '库存导入错误项')
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        if (this.paramsData) {
+          this.uploadData = this.paramsData
+          const _this = this
+          this.$nextTick(() => {
+            _this.$refs.table.refresh(true)
+          })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      /deep/.redBg-row{
+        background-color: #F39494 !important;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 220 - 0
src/views/inventoryManagement/inventoryImport/detailList.vue

@@ -0,0 +1,220 @@
+<template>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="salesDetailReportList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
+            <a-form-model-item label="产品编码">
+              <a-input v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
+            <a-form-model-item label="产品名称">
+              <a-input v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24" v-if="typeInfo != 'STOCK_IMPORT'">
+            <a-form-model-item label="供应商">
+              <supplier
+                v-model="supplierSn"
+                placeholder="请选择供应商"
+                @change="supplierChange"
+              ></supplier>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
+            <a-form-item label="仓库名称">
+              <a-input id="warehouseList-name" v-model.trim="queryParam.warehouseName" allowClear placeholder="请输入仓库名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?4:6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        导入单号:<strong>{{ detailSn ||'--' }}</strong>;
+        款数:<strong>{{ (countInfo || countInfo==0) ? countInfo : '--' }}</strong>;
+        数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        <div v-if="$hasPermissions('M_ShowAllCost')" style="display: inline-block;">
+          成本:<strong>{{ (totalData && (totalData.cost || totalData.cost==0)) ? toThousands(totalData.cost) : '--' }}</strong>。
+        </div>
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.no"
+      rowKeyName="no"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import supplier from '@/views/common/supplier'
+import { reportStockImportDetailList, reportStockImportDetailCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand, supplier },
+  mixins: [commonMixin],
+  props: {
+    detailSn: {
+      type: String,
+      default: null
+    },
+    typeInfo: {
+      type: String,
+      default: null
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      supplierSn: undefined,
+      queryParam: { //  查询条件
+        importType: undefined,
+        productEntity: {
+          code: '', //  产品编码
+          name: '' //  产品名称
+        },
+        stockImportNo: '',
+        supplierName: '',
+        warehouseName: ''// 仓库名称
+      },
+      countInfo: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        if (this.detailSn) {
+          params.stockImportNo = this.detailSn
+          params.importType = this.typeInfo
+        }
+        return reportStockImportDetailList(params).then(res => {
+          let data
+          this.countInfo = res.data.count
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].totalCost = data.list[i].putQty * data.list[i].cost
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null //  合计
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'putQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.typeInfo != 'STOCK_IMPORT') { // 散件导入
+        arr.splice(1, 0, { title: '供应商', dataIndex: 'supplierName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+        arr.splice(10, 0, { title: '售价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(11, 0, { title: '批发价', dataIndex: 'wholesalePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(12, 0, { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      }
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本价', dataIndex: 'cost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(9, 0, { title: '总成本', dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    supplierChange (val, row) {
+      this.queryParam.supplierName = row ? row.supplierName : ''
+    },
+    // 合计
+    getCount (params) {
+      reportStockImportDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.table.refresh(true)
+    },
+    //  重置
+    resetSearchForm () {
+      this.supplierSn = undefined
+      this.queryParam.stockImportNo = this.detailSn
+      this.queryParam.importType = this.typeInfo
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.warehouseName = ''
+      this.queryParam.supplierName = ''
+      this.handleSearch()
+    },
+    pageInit () {
+      this.disabled = false
+      this.spinning = false
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 195 - 0
src/views/inventoryManagement/inventoryImport/importGuideModal.vue

@@ -0,0 +1,195 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="库存导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的EXCEL文件中必须包含名为"产品编码"、"仓库"、"仓位"、"入库数量"、"成本价";列顺序可忽略、行顺序可忽略。以产品编码,仓库,仓位,成本价作为导入的是否有效判断依据。</li>
+            <li>2) 红色底为错误项,错误项忽略不能导入,正确项可直接导入。</li>
+            <li>3) 入库数量必须大于0,且为正整数,为了保证数据的正确性,请检查上传文件数据无误后再上传操作。</li>
+            <li>4) 成本价为必填项,必须填写大于等于零的数字。</li>
+            <li>5) 支持上传文件格式:.xls、.xlsx。</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { Upload, ChooseImportModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/stockImport/importForStock',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      filePath: location.protocol + '//' + location.host + '/templ/库存导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
+      } else {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk () {
+      this.$emit('ok')
+      this.isShow = false
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 155 - 243
src/views/inventoryManagement/inventoryImport/list.vue

@@ -1,259 +1,229 @@
 <template>
 <template>
-  <a-card size="small" :bordered="false" class="bulkImportList-wrap">
+  <a-card size="small" :bordered="false" class="warehouseList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div ref="tableSearch" class="table-page-search-wrapper">
-        <Upload
-          id="bulkImportList-attachList"
-          ref="importUpload"
-          :maxNums="1"
-          fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
-          uploadType="attach"
-          :action="attachAction"
-          :uploadParams="uploadParams"
-          upText="选择导入文件"
-          @remove="resetSearchForm"
-          @change="changeImport"></Upload>
-        <a :href="filePath" style="margin: 5px 0 0 15px;display: block;float: left;">
-          <a-icon type="download" style="padding-right: 5px;" />下载导入模板
-        </a>
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="inventoryImport-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="导入时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="导入单号">
+                <a-input id="inventoryImport-no" v-model.trim="queryParam.stockImportNo" allowClear placeholder="请输入导入单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryImport-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryImport-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
       </div>
-      <div class="importGuide-con">
-        <div class="explain-con">
-          <div class="explain-item">
-            <div class="explain-tit">导入文件说明</div>
-            <ul>
-              <li>1) 导入的EXCEL文件中必须包含名为"产品编码"、"仓库"、"仓位"、"入库数量"、"成本价";列顺序可忽略、行顺序可忽略。以产品编码,仓库,仓位,成本价作为导入的是否有效判断依据。</li>
-              <li>2) 红色底为错误项,错误项忽略不能导入,正确项可直接导入。</li>
-              <li>3) 入库数量必须大于0,且为正整数,为了保证数据的正确性,请检查上传文件数据无误后再上传操作。</li>
-              <li>4) 成本价为必填项,必须填写大于等于零的数字。</li>
-              <li>5) 支持上传文件格式:.xls、.xlsx。</li>
-            </ul>
+      <!-- 导入按钮 -->
+      <!-- v-if="$hasPermissions('B_inventory_warehouse_add')" -->
+      <div class="table-operator">
+        <a-button id="inventoryImport-add" type="primary" class="button-error" @click="openGuideModal=true">库存导入</a-button>
+      </div>
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
+          产品总数量:<strong>{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}</strong>;
+          <div v-if="$hasPermissions('M_ShowAllCost')" style="display: inline-block;">
+            总成本:<strong>{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? toThousands(totalData.productTotalCost) : '--' }}</strong>。
           </div>
           </div>
         </div>
         </div>
-      </div>
+      </a-alert>
       <!-- 列表 -->
       <!-- 列表 -->
       <s-table
       <s-table
-        class="sTable fixPagination"
+        class="sTable"
         ref="table"
         ref="table"
-        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         size="small"
-        :rowClassName="(record, index) => record.isError==1 ? 'redBg-row':''"
-        :rowKey="(record) => record.id"
+        :style="{ height: tableHeight+84.5+'px' }"
+        :rowKey="(record) => record.stockImportSn"
+        rowKeyName="stockImportSn"
         :columns="columns"
         :columns="columns"
         :data="loadData"
         :data="loadData"
-        :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         :defaultLoadData="false"
         bordered>
         bordered>
+        <!-- 导入单号 -->
+        <template slot="stockImportNo" slot-scope="text, record">
+          <span class="table-td-link" @click="handleDetail(record)">{{ record.stockImportNo }}</span>
+        </template>
       </s-table>
       </s-table>
-      <div class="btn-con" v-if="uploadData && uploadData.stockImportSn">
-        <a-button
-          id="productInfoList-batchAudit"
-          type="primary"
-          class="button-warning"
-          @click="handleConfirm"
-          style="margin: 0 15px;">确认导入</a-button>
-        <a-button
-          id="productInfoList-batchLaunch"
-          type="primary"
-          class="button-primary"
-          @click="handleCancel"
-          style="margin: 0 15px;">取消导入</a-button>
-        <a-button
-          id="productInfoList-batchDownline"
-          type="primary"
-          class="button-grey"
-          @click="handleExportError"
-          style="margin: 0 15px;">导出错误项</a-button>
-      </div>
     </a-spin>
     </a-spin>
-    <common-modal
-      :openModal="openTipsModal"
-      :modalHtml="modalHtml"
-      modalTit="操作提示"
-      okText="确定"
-      :isCancel="false"
-      @ok="openTipsModal=false"
-      @close="openTipsModal=false" />
+    <!-- 库存导入 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+    <!-- 库存导入详情 -->
+    <a-modal
+      centered
+      class="chooseImport-modal"
+      :footer="null"
+      title="库存导入明细"
+      v-model="openInventoryImportDetail"
+      @cancel="openInventoryImportDetail=false;detailSn=undefined;"
+      width="70%">
+      <detailList ref="inventoryImportDeail" typeInfo="STOCK_IMPORT" :detailSn="detailSn"></detailList>
+    </a-modal>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
-import { STable, Upload } from '@/components'
-import { stockImportList, stockImportFinish, stockImportCancel, stockImportKCExportError } from '@/api/stockImport'
-import { downloadExcel } from '@/libs/JGPrint.js'
-import commonModal from '@/views/common/commonModal.vue'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
+import importGuideModal from './importGuideModal.vue'
+import detailList from './detailList.vue'
+import { reportStockImportList, reportStockImportCount } from '@/api/reportData'
 export default {
 export default {
-  name: 'StockImportList',
-  components: { STable, Upload, commonModal },
+  components: { STable, VSelect, rangeDate, importGuideModal, detailList },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
     return {
     return {
-      openTipsModal: false,
-      modalHtml: '',
       spinning: false,
       spinning: false,
-      exportLoading: false, // 导出loading
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
       tableHeight: 0,
       tableHeight: 0,
-      queryParam: {}, // 查询参数
-      isAllError: false, // 是否全部错误
-      listData: [],
+      queryParam: { //  查询条件
+        time: [
+          getDate.getThreeMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: '',
+        endDate: '',
+        stockImportNo: undefined,
+        importType: 'STOCK_IMPORT'
+      },
+      openGuideModal: false,
+      detailSn: undefined,
+      openInventoryImportDetail: false,
+      rules: {
+        'time': [{ required: true, message: '请选择导入时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         this.spinning = true
-        return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
+        delete params.time
+        return reportStockImportList(params).then(res => {
           let data
           let data
           if (res.status == 200) {
           if (res.status == 200) {
             data = res.data
             data = res.data
+            // 总计
+            this.getCount(params)
             const no = (data.pageNo - 1) * data.pageSize
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].no = no + i + 1
             }
             }
-            const ret = data.list.filter(item => item.isError == 1)
-            this.isAllError = ret.length == data.count
-            this.listData = data.list
-            if (this.uploadData && data.list.length == 0) {
-              this.$message.info('没有可导入数据,请检查模板是否为空')
-              this.resetSearchForm()
-            }
+            this.disabled = false
           }
           }
           this.spinning = false
           this.spinning = false
           return data
           return data
         })
         })
       },
       },
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/stockImport/importForStock',
-      uploadParams: {
-        savePathType: 'local'
-      },
-      uploadData: null,
-      filePath: location.protocol + '//' +location.host + '/templ/库存导入模板.xlsx'
+      totalData: null //  合计
     }
     }
   },
   },
   computed: {
   computed: {
     columns () {
     columns () {
+      const _this = this
       const arr = [
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '导入时间', dataIndex: 'importTime', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '导入单号', dataIndex: 'stockImportNo', width: '18%', align: 'center', scopedSlots: { customRender: 'stockImportNo' } },
+        { title: '款数', dataIndex: 'productTotalCategory', width: '18%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'productTotalQty', width: '18%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
       ]
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(5, 0, { title: '成本', dataIndex: 'productTotalCost', width: '20%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       }
       return arr
       return arr
     }
     }
   },
   },
   methods: {
   methods: {
-    // 上传文件  change
-    changeImport (file) {
-      if (file && JSON.parse(file).length > 0) {
-        this.uploadData = JSON.parse(file)[0] || null
-        if (this.uploadData && this.uploadData.stockImportSn) {
-          this.$refs.table.refresh(true)
-        }
-      } else {
-        this.uploadData = null
-      }
-    },
-    resetSearchForm () {
-      this.$refs.table.clearTable() //  清空列表数据
-      this.$refs.importUpload.setFileList() //  清空导入文件
-      this.uploadData = null //  清空上传数据
-    },
-    // 确认导入
-    handleConfirm () {
-      const _this = this
-      if (this.isAllError) {
-        this.$message.error('没有可导入的数据!')
-        return false
-      }
-      this.$confirm({
-        title: '提示',
-        content: '您是否确认导入库存?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          stockImportFinish({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.resetSearchForm()
-              _this.showSuccessModal(res.data)
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
+    // 详情
+    handleDetail (row) {
+      this.openInventoryImportDetail = true
+      this.detailSn = row.stockImportNo
+      this.$nextTick(() => {
+        this.$refs.inventoryImportDeail.handleSearch()
       })
       })
     },
     },
-    showSuccessModal (data) {
-      if (data) {
-        this.openTipsModal = true
-        this.modalHtml = `<div><div>库存导入成功</div><div>入库类型:库存导入</div><div>库存批次:${data.stockBatchNo}</div><div>总导入款数:${data.productTotalCategory}</div><div>总入库数量:${data.productTotalQty}</div><div>总入库成本:${data.productTotalCost}</div></div>`
-      }
-    },
-    // 取消导入
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '您确认取消导入库存?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          stockImportCancel({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.resetSearchForm()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+    // 合计
+    getCount (params) {
+      reportStockImportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
         }
         }
       })
       })
     },
     },
-    // 导出错误项
-    handleExportError () {
-      const _this = this
-      _this.spinning = true
-      stockImportKCExportError({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
-          })
-          reader.readAsText(res)
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
         } else {
         } else {
-          downloadExcel(res, '库存导入错误项')
+          console.log('error submit!!')
+          return false
         }
         }
       })
       })
     },
     },
+    // 库存导入
+    hanldeImprotOk () {
+      this.$refs.table.refresh(true)
+    },
+    //  重置
+    resetSearchForm (flag) {
+      this.queryParam.time = [
+        getDate.getThreeMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.$refs.ruleForm.resetFields()
+      this.queryParam.stockImportNo = undefined
+      this.totalData = null
+      this.$refs.table.clearTable()
+      this.handleSearch()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 276
+    },
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
         _this.setTableH()
       })
       })
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 400
     }
     }
   },
   },
   watch: {
   watch: {
-    advanced (newValue, oldValue) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
       this.setTableH()
     }
     }
@@ -276,61 +246,3 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
-<style lang="less">
-  .bulkImportList-wrap{
-    .table-page-search-wrapper{
-      overflow: hidden;
-      .upload-file{
-        height: auto;
-        margin-bottom: 10px;
-        .ant-btn{
-          background-color: #f30;
-          border-color: #f30;
-          margin: 0 5px;
-          font-size: 12px;
-          color: #fff;
-        }
-      }
-    }
-    .importGuide-con{
-      .explain-con{
-        .explain-item{
-          margin-bottom: 10px;
-          .explain-tit{
-            font-weight: bold;
-            span{
-              display: inline-block;
-              width: 18px;
-              height: 18px;
-              line-height: 16px;
-              text-align: center;
-              margin-right: 5px;
-              border-radius: 50%;
-              border: 1px solid rgba(0, 0, 0, 0.3);
-            }
-          }
-          p{
-            margin: 8px 0;
-            padding-left: 23px;
-          }
-          ul{
-            list-style: none;
-            padding: 0;
-            padding-left: 23px;
-            margin: 0;
-            li{
-              line-height: 26px;
-              font-size: 12px;
-            }
-          }
-        }
-      }
-    }
-    .redBg-row{
-      background-color: #F39494;
-    }
-    .btn-con{
-      text-align: center;
-    }
-  }
-</style>

+ 1 - 1
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -15,7 +15,7 @@
               <span>基础信息</span>
               <span>基础信息</span>
               <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
               <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
             </template>
             </template>
-            <a-descriptions :column="4">
+            <a-descriptions :column="3">
               <a-descriptions-item label="货架名称">{{ basicInfoData&&basicInfoData.shelfName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="货架名称">{{ basicInfoData&&basicInfoData.shelfName || '--' }}</a-descriptions-item>
               <a-descriptions-item>
               <a-descriptions-item>
                 <template slot="label">
                 <template slot="label">

+ 2 - 1
src/views/reportData/stockImportReport/detailList.vue

@@ -22,7 +22,8 @@
             <a-form-model-item label="导入类型">
             <a-form-model-item label="导入类型">
               <a-select
               <a-select
                 placeholder="请选择导入类型"
                 placeholder="请选择导入类型"
-                v-model="queryParam.importType">
+                v-model="queryParam.importType"
+                allowClear>
                 <a-select-option value="STOCK_IMPORT">
                 <a-select-option value="STOCK_IMPORT">
                   库存导入
                   库存导入
                 </a-select-option>
                 </a-select-option>

+ 2 - 1
src/views/reportData/stockImportReport/list.vue

@@ -17,7 +17,8 @@
             <a-form-model-item label="导入类型">
             <a-form-model-item label="导入类型">
               <a-select
               <a-select
                 placeholder="请选择导入类型"
                 placeholder="请选择导入类型"
-                v-model="queryParam.importType">
+                v-model="queryParam.importType"
+                allowClear>
                 <a-select-option value="STOCK_IMPORT">
                 <a-select-option value="STOCK_IMPORT">
                   库存导入
                   库存导入
                 </a-select-option>
                 </a-select-option>