lilei 11 月之前
父节点
当前提交
626d5f7a83

+ 1 - 1
src/views/allocationManagement/transfersPrint/recordModal.vue

@@ -45,7 +45,7 @@
         bordered>
       </s-table>
       <div class="btn-box">
-        <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button :id="'record-cancel-'+record.id" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
       </div>
     </a-spin>
   </a-modal>

+ 11 - 11
src/views/inventoryManagement/inventoryCheck/addModal.vue

@@ -17,12 +17,12 @@
           <p>确定创建新的盘点单吗?</p>
           <p v-show="isShowWarehouse">
             仓库:<warehouse
-                    style="width:200px;"
-                    v-model="form.warehouseSn"
-                    isPermission
-                    id="inventoryCheckAddModal-warehouseSn"
-                    placeholder="请选择仓库"
-                  />
+              style="width:200px;"
+              v-model="form.warehouseSn"
+              isPermission
+              id="inventoryCheckAddModal-warehouseSn"
+              placeholder="请选择仓库"
+            />
           </p>
         </div>
         <div class="btn-cont">
@@ -41,7 +41,7 @@ import warehouse from '@/views/common/chooseWarehouse.js'
 export default {
   name: 'ProductInfoDetailModal',
   mixins: [commonMixin],
-  components:{warehouse},
+  components: { warehouse },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -51,14 +51,14 @@ export default {
   data () {
     return {
       spinning: false,
-      form:{warehouseSn:undefined},
+      form: { warehouseSn: undefined }, // 仓库sn
       isShow: this.openModal //  是否打开弹框
     }
   },
   methods: {
     // 确定
     handleSave () {
-      if(this.isShowWarehouse && !this.form.warehouseSn){
+      if (this.isShowWarehouse && !this.form.warehouseSn) {
         this.$message.error('请选择仓库')
         return
       }
@@ -83,10 +83,10 @@ export default {
       if (!newValue) {
         this.form.warehouseSn = undefined
         this.$emit('close')
-      }else{
+      } else {
         // 默认仓库
         const defWareHouse = this.$store.state.app.defWarehouse
-        this.form.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+        this.form.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
       }
     }
   }

+ 15 - 13
src/views/inventoryManagement/inventoryCheck/detail.vue

@@ -7,7 +7,7 @@
           <a id="inventoryCheckDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span class="billno">单号:{{ detail&&detail.checkWarehouseNo }}</span>
           <span class="state-c" v-if="detail&&detail.state=='DELETE'">已作废</span>
-          <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button size="small" type="link" class="button-default" id="inventoryCheckDetail-desc-btn" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -47,7 +47,7 @@
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品编码">
-                      <a-input v-model.trim="queryParam.productCode" allowClear placeholder="输入产品编码" />
+                      <a-input id="inventoryCheckDetail-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="输入产品编码" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
@@ -59,7 +59,7 @@
             </a-col>
             <a-col :span="6">
               <div style="float:right;overflow: hidden;margin-top:6px;">
-                <a-checkbox v-model="foldState" @change="foldStateChange"><span style="display: inline-block;margin-top: 1px;">折叠列表</span></a-checkbox>
+                <a-checkbox id="inventoryCheckDetail-foldState" v-model="foldState" @change="foldStateChange"><span style="display: inline-block;margin-top: 1px;">折叠列表</span></a-checkbox>
               </div>
             </a-col>
           </a-row>
@@ -118,7 +118,7 @@ export default {
       loading: false,
       showDetail: false,
       queryParam: {
-        productCode: ''
+        productCode: '' // 产品编码
       },
       // 表头
       columns: [
@@ -134,13 +134,13 @@ export default {
         { title: '盘点数量', dataIndex: 'checkQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '监盘数量', dataIndex: 'checkSuperviseQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-      list: [],
+      list: [], // 列表数据
       paginationProps: {
         total: 0, //  分页总条数
         current: 1,
         pageSize: 20
       },
-      expandedRowKeys: [],
+      expandedRowKeys: [], // 展开行
       detail: null, //  详情数据
       foldState: false, //  是否折叠列表
       productTotal: null //  合计
@@ -149,7 +149,7 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/inventoryManagement/inventoryCheck/list/0', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'inventoryCheckList', params: { type: 0 } })
     },
     // 重置
     resetSearchForm () {
@@ -169,11 +169,9 @@ export default {
           checkWarehouseDelete({ checkWarehouseSn: _this.$route.params.sn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.spinning = false
-              _this.$router.push({ path: '/inventoryManagement/inventoryCheck/list/1', query: { closeLastOldTab: true } })
-            } else {
-              _this.spinning = false
+              _this.$router.push({ name: 'inventoryCheckList', params: { type: 1 } })
             }
+            _this.spinning = false
           })
         }
       })
@@ -186,8 +184,7 @@ export default {
         pageNo: this.paginationProps.current,
         pageSize: this.paginationProps.pageSize,
         checkWarehouseSn: this.$route.params.sn,
-        productCode: this.queryParam.productCode,
-        // checkWarehouseSn: this.detail.warehouseSn
+        productCode: this.queryParam.productCode
       }
       this.loading = true
       checkWarehouseDetailList(params).then(res => {
@@ -195,9 +192,11 @@ export default {
         if (res.status == 200) {
           this.getCount(params)
           const data = res.data
+          // 分页总记录数
           this.paginationProps.total = Number(res.data.count) || 0
           this.paginationProps.current = data.pageNo
           const no = (data.pageNo - 1) * data.pageSize
+          // 可展开行
           this.expandedRowKeys = []
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -215,6 +214,7 @@ export default {
         }
       })
     },
+    // 统计数据
     getCount (params) {
       checkWarehouseDetailCount(params).then(res => {
         if (res.status == 200) {
@@ -261,9 +261,11 @@ export default {
     },
     // 折叠列表
     foldStateChange (e) {
+      // 收起
       if (e.target.checked) {
         this.expandedRowKeys = []
       } else {
+        // 展开
         this.expandedRowKeys = []
         this.list.map(item => {
           this.expandedRowKeys.push(item.id + item.type)

+ 130 - 133
src/views/inventoryManagement/inventoryCheck/list.vue

@@ -1,109 +1,109 @@
 <template>
   <div>
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="盘点单号">
-              <a-input id="inventoryCheckList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24" v-show="isShowWarehouse">
-            <a-form-item label="仓库">
-              <warehouse
-                v-model="queryParam.warehouseSn"
-                isPermission
-                id="inventoryCheckList-warehouseSn"
-                placeholder="请选择仓库"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-form-item label="盘点状态">
-              <v-select
-                v-model="queryParam.checkState"
-                ref="checkState"
-                id="inventoryCheckList-checkState"
-                code="CHECK_WAREHOUSE_STATE"
-                placeholder="请选择盘点状态"
-                allowClear
-              ></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-form-item label="监盘状态">
-              <v-select
-                v-model="queryParam.checkSuperviseState"
-                ref="checkSuperviseState"
-                id="inventoryCheckList-checkSuperviseState"
-                code="CHECK_WAREHOUSE_SUPERVISE_STATE"
-                placeholder="请选择监盘状态"
-                allowClear
-              ></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </a-card>
-  <a-card size="small" :bordered="false" class="inventoryCheckList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 操作按钮 -->
-      <div class="table-operator flex-center" style="justify-content: space-between;">
-        <div class="flex-center">
-          <a-button v-if="$hasPermissions('B_inventoryCheckAdd')" id="inventoryCheckList-add" type="primary" @click="handleAdd">新增</a-button>
-        </div>
-        <div>
-          <a-radio-group v-model="queryParam.deleteFlag" @change="handleTabChange">
-            <a-radio-button v-for="item in tabPaneData" :key="item.type" :value="item.type">
-              {{ item.name }}
-            </a-radio-button>
-          </a-radio-group>
-        </div>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="盘点单号">
+                <a-input id="inventoryCheckList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24" v-show="isShowWarehouse">
+              <a-form-item label="仓库">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  isPermission
+                  id="inventoryCheckList-warehouseSn"
+                  placeholder="请选择仓库"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="盘点状态">
+                <v-select
+                  v-model="queryParam.checkState"
+                  ref="checkState"
+                  id="inventoryCheckList-checkState"
+                  code="CHECK_WAREHOUSE_STATE"
+                  placeholder="请选择盘点状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="监盘状态">
+                <v-select
+                  v-model="queryParam.checkSuperviseState"
+                  ref="checkSuperviseState"
+                  id="inventoryCheckList-checkSuperviseState"
+                  code="CHECK_WAREHOUSE_SUPERVISE_STATE"
+                  placeholder="请选择监盘状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+70+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :pageSize="30"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            v-if="$hasPermissions('B_inventoryCheckDetail')"
-            class="button-success"
-            @click="handleDetail(record)"
-            id="inventoryCheckList-audit-btn">详情</a-button>
-          <span v-else>--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 新增盘点单 -->
-    <inventory-check-add-modal :openModal="openAddModal" @ok="handleAddOk" @close="openAddModal=false" />
-    <!-- 盘点校验 -->
-    <common-modal
-      :openModal="openCommonModal"
-      :modalHtml="modalHtml"
-      okText="好的"
-      :isCancel="false"
-      @ok="openCommonModal=false"
-      @cancel="openCommonModal=false" />
-  </a-card>
+    </a-card>
+    <a-card size="small" :bordered="false" class="inventoryCheckList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator flex-center" style="justify-content: space-between;">
+          <div class="flex-center">
+            <a-button v-if="$hasPermissions('B_inventoryCheckAdd')" id="inventoryCheckList-add" type="primary" @click="handleAdd">新增</a-button>
+          </div>
+          <div>
+            <a-radio-group v-model="queryParam.deleteFlag" @change="handleTabChange" id="inventoryCheckList-radio-tab">
+              <a-radio-button v-for="item in tabPaneData" :key="item.type" :id="item.type" :value="item.type">
+                {{ item.name }}
+              </a-radio-button>
+            </a-radio-group>
+          </div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :pageSize="30"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_inventoryCheckDetail')"
+              class="button-success"
+              @click="handleDetail(record)"
+              :id="'inventoryCheckList-audit-'+record.id">详情</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 新增盘点单 -->
+      <inventory-check-add-modal :openModal="openAddModal" @ok="handleAddOk" @close="openAddModal=false" />
+      <!-- 盘点校验 -->
+      <common-modal
+        :openModal="openCommonModal"
+        :modalHtml="modalHtml"
+        okText="好的"
+        :isCancel="false"
+        @ok="openCommonModal=false"
+        @cancel="openCommonModal=false" />
+    </a-card>
   </div>
 </template>
 
@@ -123,11 +123,11 @@ export default {
       spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        deleteFlag: this.$route.params.type,
-        checkWarehouseNo: '',
-        checkState: undefined,
-        warehouseSn: undefined,
-        checkSuperviseState: undefined
+        deleteFlag: this.$route.params.type, // 类型
+        checkWarehouseNo: '', // 盘点单号
+        checkState: undefined, // 盘点状态
+        warehouseSn: undefined, // 仓库
+        checkSuperviseState: undefined // 监盘状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       tabPaneData: [
@@ -153,25 +153,25 @@ export default {
         })
       },
       openModal: false,
-      itemSn: '',
-      openAddModal: false,
-      openCommonModal: false,
-      modalHtml: ''
+      itemSn: '', // 当前编辑sn
+      openAddModal: false, // 新增盘点单弹框
+      openCommonModal: false, // 盘点校验提示弹框
+      modalHtml: '' // 盘点校验弹框内容
     }
   },
   computed: {
     columns () {
       let arr = [
-          { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-          { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '10%', align: 'center' },
-          // { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '盘点状态', dataIndex: 'checkStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '监盘状态', dataIndex: 'checkSuperviseStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '盘点人', dataIndex: 'checkPersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '盘点提交时间', dataIndex: 'checkTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '监盘人', dataIndex: 'checkSupervisePersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '监盘提交时间', dataIndex: 'checkSuperviseTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        ]
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '10%', align: 'center' },
+        // { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '盘点状态', dataIndex: 'checkStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘状态', dataIndex: 'checkSuperviseStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '盘点人', dataIndex: 'checkPersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '盘点提交时间', dataIndex: 'checkTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘人', dataIndex: 'checkSupervisePersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '监盘提交时间', dataIndex: 'checkSuperviseTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
 
       if (this.queryParam.deleteFlag == '0') { // 正常
         arr = arr.concat([
@@ -187,8 +187,8 @@ export default {
         ])
       }
 
-      if(this.isShowWarehouse){
-        arr.splice(2,0,{ title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
+      if (this.isShowWarehouse) {
+        arr.splice(2, 0, { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }
@@ -200,7 +200,8 @@ export default {
     },
     // 新增 成功
     handleAddOk (data) {
-      this.$router.push({ path: `/inventoryManagement/inventoryCheck/detail/${data.checkWarehouseSn}` })
+      this.openAddModal = false
+      this.handleDetail(data)
     },
     // 选择类型
     handleTabChange (event) {
@@ -209,10 +210,9 @@ export default {
     },
     // 详情
     handleDetail (row) {
-      if (this.$hasPermissions('B_inventoryCheckDetail')) {
-        this.$router.push({ path: `/inventoryManagement/inventoryCheck/detail/${row.checkWarehouseSn}` })
-      }
+      this.$router.push({ name: 'inventoryCheckDetail', params: { sn: row.checkWarehouseSn } })
     },
+    // 重置列表
     resetSearchForm () {
       this.queryParam.checkWarehouseNo = ''
       this.queryParam.checkState = undefined
@@ -220,16 +220,13 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
     },
-    closeModal () {
-      this.itemSn = ''
-      this.openModal = false
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       this.tableHeight = window.innerHeight - 283
     }
@@ -272,6 +269,6 @@ export default {
 
 <style lang="less">
   .inventoryCheckList-wrap{
-    
+
   }
 </style>

+ 1 - 0
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -133,6 +133,7 @@ export default {
         }
       })
     },
+    // 重置
     resetPage () {
       this.currentStock = { // 合计信息
         currentQty: '',

+ 4 - 5
src/views/inventoryManagement/inventoryQuery/exportExcelModal.vue

@@ -18,9 +18,9 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="导出库存" prop="exportType">
-          <a-radio-group v-model="form.exportType">
-            <a-radio value="all">所有</a-radio>
-            <a-radio value="type">分类汇总导出</a-radio>
+          <a-radio-group v-model="form.exportType" id="export-excel-radio">
+            <a-radio value="all" id="export-excel-radio-all">所有</a-radio>
+            <a-radio value="type" id="export-excel-radio-type">分类汇总导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
       </a-form-model>
@@ -50,7 +50,7 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       form: {
-        exportType: 'all'
+        exportType: 'all' // 导出方式
       },
       rules: {
         exportType: [{ required: true, message: '请选择导出方式', trigger: 'change' }]
@@ -72,7 +72,6 @@ export default {
           _this.$emit('ok', _this.form.exportType)
           _this.isShow = false
         } else {
-          console.log('error submit!!')
           return false
         }
       })

+ 126 - 125
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -1,119 +1,119 @@
 <template>
   <div>
-   <a-card size="small" :bordered="false" class="searchBoxNormal">
-     <!-- 搜索条件 -->
-     <div ref="tableSearch" class="table-page-search-wrapper">
-       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-         <a-row :gutter="15">
-           <a-col :md="6" :sm="24">
-             <a-form-item label="产品编码">
-               <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-             </a-form-item>
-           </a-col>
-           <a-col :md="6" :sm="24">
-             <a-form-item label="原厂编码">
-               <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
-             </a-form-item>
-           </a-col>
-           <a-col :md="5" :sm="24">
-             <a-form-item label="产品名称">
-               <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-             </a-form-item>
-           </a-col>
-           <template v-if="advanced">
-             <a-col :md="6" :sm="24">
-               <a-form-item label="产品品牌">
-                 <ProductBrand id="inventoryQueryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
-               </a-form-item>
-             </a-col>
-             <a-col :md="6" :sm="24">
-               <a-form-model-item label="产品分类">
-                 <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-               </a-form-model-item>
-             </a-col>
-             <a-col :md="6" :sm="24">
-               <a-form-item label="仓库">
-                 <warehouse
-                   isPermission
-                   v-model="queryParam.warehouseSn"
-                   id="inventoryQueryList-warehouseSn"
-                   placeholder="请选择仓库"
-                 />
-               </a-form-item>
-             </a-col>
-             <a-col :md="4" :sm="24">
-               <a-form-item label="库存情况">
-                 <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
-               </a-form-item>
-             </a-col>
-           </template>
-           <a-col :md="7" :sm="24">
-             <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
-             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
-             <a-button
-               v-if="$hasPermissions('B_inventoryQuery_export')"
-               type="primary"
-               style="margin-left: 5px"
-               class="button-warning"
-               @click="openExcelModal=true"
-               :disabled="disabled"
-               :loading="exportLoading"
-               id="inventoryQueryList-export">导出</a-button>
-             <a @click="advanced=!advanced" style="margin-left: 5px">
-               {{ advanced ? '收起' : '展开' }}
-               <a-icon :type="advanced ? 'up' : 'down'"/>
-             </a>
-           </a-col>
-         </a-row>
-       </a-form>
-     </div>
-  </a-card>
-  
-  <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 合计 -->
-      <div class="ftext tongji-bar">
-        可用库存总数量:<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}个</strong>;
-        <span v-if="$hasPermissions('M_inventoryQueryList_costPrice')">可用库存总成本:<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? toThousands(currentStock.currentStockCost) : '--' }}</strong>。</span>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="原厂编码">
+                <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <ProductBrand id="inventoryQueryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="仓库">
+                  <warehouse
+                    isPermission
+                    v-model="queryParam.warehouseSn"
+                    id="inventoryQueryList-warehouseSn"
+                    placeholder="请选择仓库"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="库存情况">
+                  <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
+              <a-button
+                v-if="$hasPermissions('B_inventoryQuery_export')"
+                type="primary"
+                style="margin-left: 5px"
+                class="button-warning"
+                @click="openExcelModal=true"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryQueryList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="inventoryQueryList-advanced">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+68+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :pageSize="30"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            v-if="$hasPermissions('B_inventoryQuery_detail')"
-            size="small"
-            type="link"
-            class="button-success"
-            @click="goDetail(record)"
-            id="inventoryQueryList-detail-btn">库存详情</a-button>
-          <a-button
-            v-if="$hasPermissions('B_inventoryQuery_rkDetail')"
-            size="small"
-            type="link"
-            class="button-warning"
-            @click="goWarehouseDetail(record)"
-            id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
-          <span v-if="!$hasPermissions('B_inventoryQuery_detail')&&!$hasPermissions('B_inventoryQuery_rkDetail')">--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 库存详情 -->
-    <inventory-query-detail-modal v-drag :openModal="openModal" :itemId="itemId" @close="closeModal" />
-    <!-- 导出Excel -->
-    <export-excel-modal :openModal="openExcelModal" @ok="handleExcelOk" @close="openExcelModal=false" />
-  </a-card>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 合计 -->
+        <div class="ftext tongji-bar">
+          可用库存总数量:<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}个</strong>;
+          <span v-if="$hasPermissions('M_inventoryQueryList_costPrice')">可用库存总成本:<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? toThousands(currentStock.currentStockCost) : '--' }}</strong>。</span>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+68+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              v-if="$hasPermissions('B_inventoryQuery_detail')"
+              size="small"
+              type="link"
+              class="button-success"
+              @click="goDetail(record)"
+              :id="'inventoryQueryList-detail-'+record.id">库存详情</a-button>
+            <a-button
+              v-if="$hasPermissions('B_inventoryQuery_rkDetail')"
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="goWarehouseDetail(record)"
+              :id="'inventoryQueryList-whousedetail-'+record.id">出入库明细</a-button>
+            <span v-if="!$hasPermissions('B_inventoryQuery_detail')&&!$hasPermissions('B_inventoryQuery_rkDetail')">--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 库存详情 -->
+      <inventory-query-detail-modal v-drag :openModal="openModal" :itemId="itemId" @close="closeModal" />
+      <!-- 导出Excel -->
+      <export-excel-modal :openModal="openExcelModal" @ok="handleExcelOk" @close="openExcelModal=false" />
+    </a-card>
   </div>
 </template>
 
@@ -135,7 +135,7 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -147,7 +147,7 @@ export default {
         productTypeSn3: '', //  产品分类3
         zeroQtyFlag: false //  库存情况
       },
-      productType: [],
+      productType: [], // 产品分类
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       zeroQtyData: [ //  库存情况
@@ -158,22 +158,21 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        console.log(parameter)
         // 排序
-        if (parameter.sortOrder&&parameter.sortField == 'currentStockQty') {
+        if (parameter.sortOrder && parameter.sortField == 'currentStockQty') {
           parameter.sortField = 'qty'
           parameter.sortAlias = ''
         }
-        if (parameter.sortOrder&&parameter.sortField == 'currentStockCost') {
+        if (parameter.sortOrder && parameter.sortField == 'currentStockCost') {
           parameter.sortField = 'currentStockCost'
           parameter.sortAlias = 'stock'
         }
-        
-        if(!parameter.sortOrder){
+        // 没有排序
+        if (!parameter.sortOrder) {
           parameter.sortField = ''
           parameter.sortAlias = ''
         }
-        
+
         const params = Object.assign(parameter, this.queryParam)
         if (params.zeroQtyFlag) {
           params.zeroQtyFlag = '0'
@@ -198,8 +197,8 @@ export default {
       },
       openModal: false, //  查看库存详情  弹框
       itemId: '', //  当前库存记录id
-      currentStock: null,
-      openExcelModal: false
+      currentStock: null, // 可用库存合计
+      openExcelModal: false // 导出Excel弹框
     }
   },
   computed: {
@@ -261,7 +260,7 @@ export default {
     },
     //  出入库明细
     goWarehouseDetail (row) {
-      this.$router.push({ path: `/inventoryManagement/inventoryQuery/warehouseDetail/${row.productSn}/${row.warehouseSn}` })
+      this.$router.push({ name: 'inventoryQueryWarehouseDetail', params: { sn: row.productSn, warehouseSn: row.warehouseSn } })
     },
     // 导出Excel
     handleExcelOk (exportType) {
@@ -287,12 +286,14 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 226
@@ -338,4 +339,4 @@ export default {
       margin-top: 10px;
     }
   }
-</style>
+</style>

+ 12 - 12
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -79,7 +79,7 @@
                   :disabled="disabled"
                   :loading="exportLoading"
                   id="inventoryQueryList-export">导出</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 5px">
+                <a @click="advanced=!advanced" style="margin-left: 5px" id="inventoryQueryList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -142,15 +142,15 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        bizType: undefined,
-        flowType: undefined,
-        unitName: '',
-        bizNo: '',
-        bizSubNo: '',
-        warehouseSn: undefined,
-        state: undefined
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
+        bizType: undefined, // 单据类型
+        flowType: undefined, // 变动类型
+        unitName: '', // 单位
+        bizNo: '', // 关联单号
+        bizSubNo: '', // 下推单号
+        warehouseSn: undefined, // 仓库sn
+        state: undefined // 单据状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -178,7 +178,7 @@ export default {
           return data
         })
       },
-      exportLoading: false,
+      exportLoading: false, // 导出按钮loading
       productTotal: null //  合计
     }
   },
@@ -257,7 +257,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/inventoryManagement/inventoryQuery/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'inventoryQueryList', query: { closeLastOldTab: true } })
     },
     pageInit () {
       const _this = this