Jelajahi Sumber

库存盘点

chenrui 3 tahun lalu
induk
melakukan
b5993252c4

+ 157 - 0
src/api/checkWarehouse.js

@@ -0,0 +1,157 @@
+import { axios } from '@/utils/request'
+
+//  库存盘点  列表  分页
+export const checkWarehouseList = (params) => {
+  const url = `/checkWarehouse/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  保存
+export const checkWarehouseSave = (params) => {
+  return axios({
+    url: '/checkWarehouse/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  校验是否有未完结的盘点单
+export const checkWarehouseValidate = (params) => {
+  return axios({
+    url: '/checkWarehouse/validate',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情  保存
+export const checkWarehouseDetailSave = (params) => {
+  return axios({
+    url: '/checkWarehouse/detail/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情  批量保存
+export const checkWarehouseDetailSaveBatch = (params) => {
+  return axios({
+    url: '/checkWarehouse/detail/saveBatch',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  提交
+export const checkWarehouseSubmit = (params) => {
+  return axios({
+    url: '/checkWarehouse/submit',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情
+export const checkWarehouseDetail = (params) => {
+  return axios({
+    url: `/checkWarehouse/queryBySn/${params.sn}`,
+    method: 'get'
+  })
+}
+//  库存盘点  删除
+export const checkWarehouseDel = (params) => {
+  return axios({
+    url: '/checkWarehouse/delete',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情  删除
+export const checkWarehouseDetailDel = (params) => {
+  return axios({
+    url: '/checkWarehouse/detail/delete',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  审核
+export const checkWarehouseAudit = (params) => {
+  return axios({
+    url: '/checkWarehouse/audit',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  仓库列表
+export const checkWarehouseWarehouse = (params) => {
+  return axios({
+    url: '/checkWarehouse/queryWarehouseList',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情  列表  分页
+export const checkWarehouseDetailList = (params) => {
+  const url = `/checkWarehouse/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  详情  合计
+export const checkWarehouseDetailCount = (params) => {
+  return axios({
+    url: '/checkWarehouse/detail/queryPageCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  自选盘点 选择产品  列表  分页
+export const checkWarehouseDetailStockList = (params) => {
+  const url = `/checkWarehouse/queryStockPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  盘点  整单盘零
+export const checkWarehouseCheckZero = (params) => {
+  return axios({
+    url: '/checkWarehouse/detail/checkZero',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  盘点  盘点完成
+export const checkWarehouseInventory = (params) => {
+  return axios({
+    url: '/checkWarehouse/inventory',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  财务审核
+export const checkWarehouseFinanceAudit = (params) => {
+  return axios({
+    url: '/checkWarehouse/financeAudit',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存盘点  盘点审核  列表  分页
+export const checkWarehouseAuditList = (params) => {
+  const url = `/checkWarehouse/queryAuditPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 83 - 128
src/config/router.config.js

@@ -508,42 +508,31 @@ export const asyncRouterMap = [
               }
             ]
           },
-          // {
-          //   path: '/financialManagement/inventoryReview',
-          //   redirect: '/financialManagement/inventoryReview/list',
-          //   name: 'inventoryReview',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '盘点审核',
-          //     icon: 'laptop'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'inventoryReviewList',
-          //       component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/inventoryReview/list.vue'),
-          //       meta: {
-          //         title: '盘点审核列表',
-          //         icon: 'laptop',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     },
-          //     {
-          //       path: 'detail/:id',
-          //       name: 'inventoryReviewDetail',
-          //       component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/inventoryReview/detail.vue'),
-          //       meta: {
-          //         title: '盘点审核详情',
-          //         icon: 'laptop',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     }
-          //   ]
-          // },
+          {
+            path: '/financialManagement/inventoryCheckAudit',
+            redirect: '/financialManagement/inventoryCheckAudit/list',
+            name: 'inventoryCheckAudit',
+            component: RouteView,
+            meta: {
+              title: '盘点审核',
+              icon: 'laptop',
+              permission: 'M_inventoryCheckAuditList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'inventoryCheckAuditList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/inventoryCheckAudit/list.vue'),
+                meta: {
+                  title: '盘点审核列表',
+                  icon: 'laptop',
+                  hidden: true,
+                  permission: 'M_inventoryCheckAuditList'
+                }
+              }
+            ]
+          },
           {
             path: '/financialManagement/financialPayment',
             redirect: '/financialManagement/financialPayment/list',
@@ -1077,6 +1066,64 @@ export const asyncRouterMap = [
               permission: 'M_satelliteWarehouseInventoryList'
             }
           },
+          {
+            path: '/inventoryManagement/inventoryChecking',
+            redirect: '/inventoryManagement/inventoryChecking/list',
+            name: 'inventoryChecking',
+            component: RouteView,
+            meta: {
+              title: '库存盘点',
+              icon: 'reconciliation',
+              permission: 'M_inventoryCheckingList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'inventoryCheckingList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/list.vue'),
+                meta: {
+                  title: '库存盘点列表',
+                  icon: 'reconciliation',
+                  hidden: true,
+                  permission: 'M_inventoryCheckingList'
+                }
+              },
+              {
+                path: 'overall/:id/:sn',
+                name: 'inventoryCheckingOverall',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/overall.vue'),
+                meta: {
+                  title: '编辑库存盘点【全盘】',
+                  icon: 'reconciliation',
+                  hidden: true,
+                  permission: 'B_inventoryCheckingEdit'
+                }
+              },
+              {
+                path: 'selfDisk/:id/:sn',
+                name: 'inventoryCheckingSelfDisk',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/selfDisk.vue'),
+                meta: {
+                  title: '编辑库存盘点【自选盘点】',
+                  icon: 'reconciliation',
+                  hidden: true,
+                  permission: 'B_inventoryCheckingEdit'
+                }
+              },
+              {
+                path: 'makeInventory/:id/:sn',
+                name: 'inventoryCheckingMakeInventory',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/makeInventory.vue'),
+                meta: {
+                  title: '盘点',
+                  icon: 'reconciliation',
+                  hidden: true,
+                  permission: 'B_inventoryCheckingInventory'
+                }
+              }
+            ]
+          },
           {
             path: '/inventoryManagement/warehouse',
             redirect: '/inventoryManagement/warehouse/list',
@@ -1113,98 +1160,6 @@ export const asyncRouterMap = [
               }
             ]
           }
-          // 二期
-          // {
-          //   path: '/inventoryManagement/inventoryChecking',
-          //   redirect: '/inventoryManagement/inventoryChecking/list',
-          //   name: 'inventoryChecking',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '库存盘点',
-          //     icon: 'reconciliation'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'inventoryCheckingList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/list.vue'),
-          //       meta: {
-          //         title: '库存盘点列表',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     },
-          //     {
-          //       path: 'overall/:id',
-          //       name: 'inventoryCheckingOverall',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/overall.vue'),
-          //       meta: {
-          //         title: '盘点人盘点【全盘】',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'selfDisk/:id',
-          //       name: 'inventoryCheckingSelfDisk',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/selfDisk.vue'),
-          //       meta: {
-          //         title: '盘点人盘点【自选盘点】',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'detail/:id',
-          //       name: 'inventoryCheckingDetail',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/detail.vue'),
-          //       meta: {
-          //         title: '库存盘点详情',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'makeInventory/:id',
-          //       name: 'inventoryCheckingMakeInventory',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/makeInventory.vue'),
-          //       meta: {
-          //         title: '待盘点【盘点】',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'makeInventory/detail/:id', /* 待盘点【盘点】详情  */
-          //       name: 'inventoryCheckingMakeInventoryDetail',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/makeInventoryDetail.vue'),
-          //       meta: {
-          //         title: '库存盘点详情',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'financialAudit/detail/:id', /* 财务审核详情  */
-          //       name: 'inventoryCheckingFinancialAuditDetail',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/inventoryChecking/financialAuditDetail.vue'),
-          //       meta: {
-          //         title: '库存盘点详情',
-          //         icon: 'reconciliation',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     }
-          //   ]
-          // }
         ]
       },
       // 散件管理

+ 199 - 0
src/views/financialManagement/inventoryCheckAudit/list.vue

@@ -0,0 +1,199 @@
+<template>
+  <a-card size="small" :bordered="false" class="inventoryCheckAuditList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <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="inventoryCheckAuditList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="盘点完成时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckAuditList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="inventoryCheckAuditList-reset">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1150, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="checkWarehouseNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
+          <span v-else>{{ record.checkWarehouseNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            v-if="record.state=='WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckAuditAudit')"
+            type="link"
+            class="button-info"
+            @click="handleExamine(record, true)"
+            id="warehousingAudit-adopt-btn">通过</a-button>
+          <a-button
+            size="small"
+            v-if="record.state=='WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckAuditAudit')"
+            type="link"
+            class="button-warning"
+            @click="handleExamine(record, false)"
+            id="warehousingAudit-unadopt-btn">不通过</a-button>
+          <span v-if="!(record.state=='WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckAuditAudit'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 详情 -->
+    <inventoryChecking-detail-modal :openModal="openDetailModal" :itemSn="itemSn" @close="handleDetailClose" />
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import inventoryCheckingDetailModal from '@/views/inventoryManagement/inventoryChecking/detailModal.vue'
+import { checkWarehouseAuditList, checkWarehouseFinanceAudit } from '@/api/checkWarehouse'
+export default {
+  components: { STable, VSelect, rangeDate, inventoryCheckingDetailModal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        beginDate: undefined,
+        endDate: undefined,
+        checkWarehouseNo: ''
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, align: 'center' },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'totalStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘盈数量', dataIndex: 'totalProfitQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘亏数量', dataIndex: 'totalLossQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点完成时间', dataIndex: 'financeFinishTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务审核时间', dataIndex: 'financeAuditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务审核状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 110, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return checkWarehouseAuditList(Object.assign(parameter, this.queryParam)).then(res => {
+          const 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
+            data.list[i].financeFinishTime = data.list[i].financeAuditTime
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
+      },
+      productTotal: null,
+      openDetailModal: false,
+      itemSn: null
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  详情
+    handleDetail (row) {
+      this.itemSn = row.checkWarehouseSn
+      this.openDetailModal = true
+    },
+    handleDetailClose () {
+      this.itemSn = null
+      this.openDetailModal = false
+    },
+    //  审核
+    handleExamine (row, type) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要进行' + (type ? ' 通过 ' : ' 不通过 ') + '操作吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          checkWarehouseFinanceAudit({ id: row.id, auditFlag: type }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
+      this.queryParam.checkWarehouseNo = ''
+      this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 238
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    }
+  }
+}
+</script>
+<style lang="less">
+  .inventoryCheckAuditList-wrap{
+    .sTable{
+      margin-top: 15px;
+    }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
+  }
+</style>

+ 1 - 0
src/views/financialManagement/ledgerRecord/list.vue

@@ -73,6 +73,7 @@ export default {
     return {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       createDate: [
         getDate.getRecentday().starttime,
         getDate.getRecentday().endtime

+ 1 - 0
src/views/financialManagement/withdrawalManagement/list.vue

@@ -61,6 +61,7 @@ export default {
     return {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       // 查询参数
       queryParam: {
         beginDate: '',

+ 161 - 0
src/views/inventoryManagement/inventoryChecking/basicInfoModal.vue

@@ -0,0 +1,161 @@
+<template>
+  <a-modal
+    centered
+    class="chainTransferOut-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增盘点单"
+    v-model="isShow"
+    @cancle="isShow = false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chainTransferOut-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="盘点类型" prop="checkType">
+          <a-radio-group v-model="form.checkType" @change="checkTypeChange">
+            <a-radio v-for="(item,index) in checkTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="是否区分仓库" prop="warehouseFlag" v-if="form.checkType=='SELECT'">
+          <a-radio-group v-model="form.warehouseFlag" @change="warehouseFlagChange">
+            <a-radio v-for="(item,index) in warehouseFlagList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="盘点仓库" prop="warehouseSnList" v-if="form.checkType=='SELECT' && form.warehouseFlag=='1'">
+          <a-checkbox-group v-model="form.warehouseSnList">
+            <a-checkbox v-for="(item,index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-checkbox>
+          </a-checkbox-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="chainTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="chainTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { checkWarehouseSave, checkWarehouseWarehouse } from '@/api/checkWarehouse'
+export default {
+  name: 'ChainTransferOutBasicInfoModal',
+  components: { VSelect },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 20 }
+      },
+      form: {
+        checkType: 'ALL',
+        warehouseFlag: '0',
+        warehouseSnList: undefined
+      },
+      rules: {
+        checkType: [{ required: true, message: '请选择盘点类型', trigger: 'change' }],
+        warehouseFlag: [{ required: true, message: '请选择是否区分仓库', trigger: 'change' }],
+        warehouseSnList: [{ required: true, message: '请选择盘点仓库', trigger: 'change' }]
+      },
+      checkTypeList: [
+        { dispName: '全盘', code: 'ALL' },
+        { dispName: '自选盘点', code: 'SELECT' }
+      ],
+      warehouseFlagList: [
+        { dispName: '不区分仓库', code: '0' },
+        { dispName: '区分仓库', code: '1' }
+      ],
+      warehouseList: []
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          if (form.checkType == 'ALL') {
+            delete form.warehouseFlag
+          }
+          if (form.warehouseSnList) {
+            form.warehouseSnList = form.warehouseSnList.join(',')
+          }
+          _this.spinning = true
+          checkWarehouseSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    checkTypeChange (e) {
+      this.form.warehouseFlag = '0'
+      this.form.warehouseSnList = undefined
+    },
+    warehouseFlagChange (e) {
+      this.form.warehouseSnList = undefined
+    },
+    // 获取仓库列表
+    getWarehouseList () {
+      checkWarehouseWarehouse({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data || []
+        } else {
+          this.warehouseList = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getWarehouseList()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.chainTransferOut-basicInfo-modal {
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 0 - 199
src/views/inventoryManagement/inventoryChecking/checkingTipsModal.vue

@@ -1,199 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="checkingTipsEdit-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="提示"
-    v-model="isShow"
-    @cancle="isShow=false"
-    width="80%">
-    <div class="checkingTipsEdit-header">
-      <strong>以下为影响出入库的未完成单据</strong>
-      <a-button type="danger" @click="handleExport" :loading="exportLoading" id="checkingTipsEdit-export">导出</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-    </s-table>
-    <a-divider />
-    <div class="checkingTipsEdit-explain">
-      <strong>盘点说明:</strong>
-      <ul class="checkingTipsEdit-explain-list">
-        <li>1、以上影响出入库的未完成单据,不处理也可进行盘点,但建议处理完再进行盘点。</li>
-        <li>2、开始盘点到盘点结束期间,所有出入库单据将不能操作。</li>
-      </ul>
-    </div>
-    <div class="btn-cont">
-      <a-button type="primary" id="checking-tips-edit-modal-check" @click="handleCheck">开始盘点</a-button>
-      <a-button id="checking-tips-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
-    <checking-type-modal :openModal="openTypeModal" :nowData="nowTypeData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
-  </a-modal>
-</template>
-
-<script>
-import { STable } from '@/components'
-import checkingTypeModal from './checkingTypeModal.vue'
-// import { checkingTipsSave } from '@/api/checkingTips'
-export default {
-  name: 'CheckingTipsEditModal',
-  components: { STable, checkingTypeModal },
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    itemId: {
-      type: [Number, String],
-      default: ''
-    },
-    nowData: {
-      type: Object,
-      default: null
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      exportLoading: false, // 导出loading
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单号', dataIndex: 'nsso', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'sort', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'name', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return warehouseAllList( this.queryParam ).then(res => {
-        //   const data = res.data
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
-      },
-      openTypeModal: false, //  新增编辑  弹框
-      nowTypeData: null //  当前记录数据
-    }
-  },
-  methods: {
-    //  详情
-    getDetail () {
-
-    },
-    //  开始盘点
-    handleCheck () {
-      this.openTypeModal = true
-    },
-    //  新增/编辑  成功
-    handleOk (type) {
-      this.$emit('ok', type)
-      this.isShow = false
-    },
-    //  关闭弹框
-    closeModal () {
-      this.openTypeModal = false
-    },
-    //  导出
-    handleExport () {
-      this.exportLoading = true
-      customerBundleExportDelay({}).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '未完成单据_盘点' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-      } else {
-        this.form = {
-          name: '',
-          sort: ''
-        }
-      }
-    },
-    itemId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .checkingTipsEdit-modal{
-    .ant-modal-body {
-    	padding: 40px 40px 24px;
-    }
-    .checkingTipsEdit-header{
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      margin-bottom: 20px;
-      strong{
-        font-size: 15px;
-      }
-    }
-    .checkingTipsEdit-explain{
-      strong{
-        display: block;
-        margin-bottom: 5px;
-      }
-      .checkingTipsEdit-explain-list{
-        list-style: none;
-        margin: 0;
-        padding: 0;
-        li{
-          padding: 3px 0;
-        }
-      }
-    }
-    .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
-    }
-  }
-</style>

+ 0 - 155
src/views/inventoryManagement/inventoryChecking/checkingTypeModal.vue

@@ -1,155 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="checkingTypeEdit-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="选择盘点类型"
-    v-model="isShow"
-    @cancle="isShow=false"
-    :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="checkingTypeEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="" prop="type">
-          <a-radio-group v-model="form.type" size="large" class="radio-group">
-            <a-radio-button value="a" class="radio-button">
-              全盘<a-icon class="radio-button-icon" type="check" v-show="form.type=='a'" />
-            </a-radio-button>
-            <a-radio-button value="b" class="radio-button">
-              自选盘点<a-icon class="radio-button-icon" type="check" v-show="form.type=='b'" />
-            </a-radio-button>
-          </a-radio-group>
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="checkingType-edit-modal-save" @click="handleSubmit">确定</a-button>
-        <a-button id="checkingType-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-      </div>
-    </div>
-  </a-modal>
-</template>
-
-<script>
-// import { checkingTypeSave } from '@/api/checkingType'
-export default {
-  name: 'checkingTypeEditModal',
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    itemId: {
-      type: [Number, String],
-      default: ''
-    },
-    nowData: {
-      type: Object,
-      default: null
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      formItemLayout: {
-        labelCol: { span: 0 },
-        wrapperCol: { span: 24 }
-      },
-      form: {
-        type: '', // 盘点类型
-      },
-      rules: {
-        type: [
-          { required: true, message: '请先选择盘点类型', trigger: 'change' }
-        ],
-      }
-    }
-  },
-  methods: {
-    //  确定
-    handleSubmit(){
-      const _this = this
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          _this.$emit('ok', _this.form.type)
-          _this.isShow = false
-          // const params = {
-          //   id: this.itemId ? this.itemId : undefined,
-          //   name: this.form.name,  //  仓库名称
-          //   sort: this.form.sort,  //  排序
-          //   isDefault: 0  //  是否为默认仓库   0为非默认,1为默认
-          // }
-          // checkingTipsSave(params).then(res => {
-          //   if(res.status == 200){
-          //     _this.$message.success(res.message)
-          //     _this.$emit('ok')
-          //     setTimeout(function () {
-          //       _this.isShow = false
-          //       _this.$refs.ruleForm.resetFields()
-          //     }, 300)
-          //   }else{
-              
-          //   }
-          // })
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
-    },
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-      }else{
-        this.form = {
-          name: '',
-          sort: ''
-        }
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .checkingTypeEdit-modal{
-    .ant-modal-body {
-    	padding: 40px 40px 24px;
-    }
-    .radio-group{
-      display: block;
-      margin: 30px auto;
-      width: 80%;
-      .radio-button{
-        width: 50%;
-        height: 100px;
-        line-height: 100px;
-        text-align: center;
-        position: relative;
-        &-icon{
-          position: absolute;
-          right: 30px;
-          top: 42px;
-        }
-      }
-    }
-    .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
-    }
-  }
-</style>

+ 0 - 183
src/views/inventoryManagement/inventoryChecking/detail.vue

@@ -1,183 +0,0 @@
-<template>
-  <div class="inventoryCheckingDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="inventoryCheckingDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="inventoryCheckingDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="1" type="danger" @click="handleExport" :loading="exportLoading" id="inventoryCheckingDetail-export-btn">导出</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="盘点单号">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="监盘审核状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div slot="message">
-          库存总数量:
-          <strong>6</strong>
-          ,盈亏总数量:
-          <strong>6</strong>
-        </div>
-      </a-alert>
-      <!-- 筛选条件 -->
-      <div 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-select placeholder="请选择" id="inventoryCheckingDetail-type" allowClear v-model="queryParam.dataSourceNo">
-                  <a-select-option v-for="item in brandData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckingDetail-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckingDetail-reset">重置</a-button>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="record => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 820 }"
-        bordered>
-        <!-- 采购数量 -->
-        <template slot="purchaseNum" slot-scope="text, record">
-          <span>{{ record.purchaseNum }}</span>
-        </template>
-        <!-- 缺货数量 -->
-        <template slot="outOfStockNum" slot-scope="text, record">
-          <span>{{ record.outOfStockNum }}</span>
-        </template>
-      </s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      queryParam: {
-        dataSourceNo: undefined
-      },
-      exportLoading: false, // 导出loading
-      disabled: false, //  查询、重置按钮是否可操作
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点数量', dataIndex: 'qtsy', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盈亏数量', dataIndex: 'qdty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const 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.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
-      },
-      brandData: []
-    }
-  },
-  methods: {
-    //  重置
-    resetSearchForm () {},
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.oldTime && this.oldTime.length > 0) {
-        params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
-        params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginOldExpiryDate = ''
-        params.endOldExpirydDate = ''
-      }
-      if (this.newTime && this.newTime.length > 0) {
-        params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      customerBundleExportDelay(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      if (!data) {
-        return
-      }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '仓库调拨' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
-  }
-}
-</script>
-
-<style lang="less">
-.inventoryCheckingDetail-cont,
-.inventoryCheckingDetail-back {
-  margin-bottom: 10px;
-}
-</style>

+ 228 - 0
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -0,0 +1,228 @@
+<template>
+  <a-modal
+    centered
+    class="inventoryCheckingDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancle="isShow = false"
+    :width="960">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
+        <a-descriptions size="small" :column="3">
+          <a-descriptions-item label="盘点单号" :span="3">
+            {{ (basicInfoData&&basicInfoData.checkWarehouseNo) || '--' }}
+            <div style="display: inline-block;margin-left: 10px;">
+              <a-tag color="red" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
+            </div>
+          </a-descriptions-item>
+          <a-descriptions-item label="盘点类型">{{ (basicInfoData&&basicInfoData.checkTypeDictValue) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="是否区分仓库" v-if="basicInfoData&&basicInfoData.checkType=='SELECT'">{{ (basicInfoData&&basicInfoData.warehouseFlagDictValue) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="盘点仓库" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">{{ (basicInfoData&&basicInfoData.warehouseNameList) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="创建人">{{ (basicInfoData&&basicInfoData.creatorName) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="创建时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="审核时间">{{ (basicInfoData&&basicInfoData.checkSuperviseTime) || '--' }}</a-descriptions-item>
+        </a-descriptions>
+      </a-card>
+      <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            <div style="display: flex;justify-content: space-between;align-items: center;">
+              <div>
+                总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+                总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
+                盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
+              </div>
+              <div>
+                <span style="color: red;display: inline-block;margin-right: 8px;">红色代表盘盈</span>
+                <span style="color: green;">绿色代表盘亏</span>
+              </div>
+            </div>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="7" :sm="24">
+                <a-form-item label="产品编码/产品名称" prop="productName">
+                  <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                <a-form-item label="仓库">
+                  <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                    <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :scroll="{ x: 990, y: 450 }"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 盈亏数量 -->
+          <template slot="checkProfitLossQty" slot-scope="text, record">
+            <span :style="{ color: record.checkProfitLossQty>0?'red':record.checkProfitLossQty<0?'green':'' }">{{ (record.checkProfitLossQty || record.checkProfitLossQty==0) ? record.checkProfitLossQty : '--' }}</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import ProductType from '@/views/common/productType.js'
+import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount } from '@/api/checkWarehouse'
+export default {
+  name: 'InventoryCheckingDetailModal',
+  components: { STable, ProductType },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String || Number,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      queryParam: {
+        productName: '',
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warehouseSn: undefined
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return checkWarehouseDetailList(Object.assign(parameter, { checkWarehouseSn: this.itemSn })).then(res => {
+          this.getDetailCount()
+          const 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.disabled = false
+          return data
+        })
+      },
+      basicInfoData: null, //  基本信息
+      productTotal: null,
+      productType: []
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140 },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'stockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点数量', dataIndex: 'checkQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏数量', scopedSlots: { customRender: 'checkProfitLossQty' }, width: 80, align: 'center' }
+      ]
+      if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
+        arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 详情
+    getDetail () {
+      checkWarehouseDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data || null
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      checkWarehouseDetailCount(Object.assign(this.queryParam, { checkWarehouseSn: this.itemSn })).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        const _this = this
+        setTimeout(() => (
+          _this.$refs.table.refresh(true)
+        ), 300)
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>

+ 0 - 145
src/views/inventoryManagement/inventoryChecking/financialAuditDetail.vue

@@ -1,145 +0,0 @@
-<template>
-  <div class="financialAuditDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="financialAuditDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="financialAuditDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <!-- <template slot="extra">
-        <a-button key="1" type="primary" id="financialAuditDetail-print-btn">快速打印</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="financialAuditDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="盘点单号">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="监盘审核状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="库存总数量">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="库存总成本(¥)">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 详情 -->
-    <a-card size="small" :bordered="false" class="financialAuditDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="详情">
-          <!-- 总计 -->
-          <a-alert type="info" style="margin-bottom:10px">
-            <div slot="message">盘盈总数量: <strong>6</strong> ,库存总成本(¥): <strong>6</strong> ,盘亏总数量: <strong>6</strong> ,盘亏总成本(¥): <strong>6</strong>,盈亏总数量: <strong>6</strong> ,盈亏总成本(¥): <strong>6</strong> </div>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <div 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-select placeholder="请选择" id="financialAuditDetail-type" allowClear v-model="queryParam.dataSourceNo">
-                      <a-select-option v-for="item in brandData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialAuditDetail-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="financialAuditDetail-reset">重置</a-button>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            bordered>
-            <!-- 采购数量 -->
-            <template slot="purchaseNum" slot-scope="text, record">
-              <span>{{record.purchaseNum}}</span>
-            </template>
-            <!-- 缺货数量 -->
-            <template slot="outOfStockNum" slot-scope="text, record">
-              <span>{{record.outOfStockNum}}</span>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-  </div>
-</template>
-
-<script>
-  import { STable, VSelect } from '@/components'
-  export default{
-    components: { STable, VSelect },
-    data(){
-      return{
-        queryParam: {
-          dataSourceNo: undefined
-        },
-        disabled: false, //  查询、重置按钮是否可操作
-        // 表头
-        columns: [
-          { title: '序号', dataIndex: 'no', align: 'center' },
-          { title: '产品编码', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '单位', dataIndex: 'mementPay', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '库存数量', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
-          { title: '盘点数量', dataIndex: 'tostalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盈亏数量', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        ],
-        // 加载数据方法 必须为 Promise 对象
-        loadData: parameter => {
-          this.disabled = true
-          // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-          //   const 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.disabled = false
-          //   return data
-          // })
-          const _this = this
-          return new Promise(function(resolve, reject){
-            const data = {
-              pageNo: 1,
-              pageSize: 10,
-              list: [
-                { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-              ],
-              count: 10
-            }
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            _this.disabled = false
-            resolve(data)
-          })
-        },
-        brandData: []
-      }
-    },
-    methods: {
-      //  重置
-      resetSearchForm(){},
-      //  返回列表
-      handleBack(){
-        this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true }})
-      },
-    }
-  }
-</script>
-
-<style lang="less">
-  .financialAuditDetail-cont, .financialAuditDetail-back{
-    margin-bottom: 10px;
-  }
-</style>

+ 198 - 130
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -1,199 +1,225 @@
 <template>
   <a-card size="small" :bordered="false" class="inventoryCheckingList-wrap">
     <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
+    <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-range-picker
-                style="width:100%"
-                id="inventoryCheckingList-creatTime"
-                :disabledDate="disabledDate"
-                @change="creatTimechange"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+            <a-form-item label="盘点单号">
+              <a-input id="inventoryCheckingList-checkWarehouseNo" v-model="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="状态">
-              <v-select code="ENABLED_FLAG" id="inventoryCheckingList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
+            <a-form-item label="盘点类型">
+              <v-select code="CHECK_WAREHOUSE_TYPE" id="inventoryCheckingList-checkType" v-model="queryParam.checkType" allowClear placeholder="请选择盘点类型"></v-select>
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="是否区分仓库">
+              <v-select code="FLAG" id="inventoryCheckingList-warehouseFlag" v-model="queryParam.warehouseFlag" allowClear placeholder="请选择"></v-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select code="CHECK_WAREHOUSE_STATE" id="inventoryCheckingList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="[queryParam.beginDate, queryParam.endDate]" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+          </template>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckingList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckingList-reset">重置</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckingList-reset">重置</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>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="inventoryCheckingList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+      <a-button id="inventoryCheckingList-add" v-if="$hasPermissions('B_inventoryCheckingAdd')" type="primary" class="button-error" @click="handleAdd">新增</a-button>
     </div>
     <!-- 列表 -->
     <s-table
-      class="sTable"
+      class="sTable fixPagination"
       ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
       size="small"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :showPagination="false"
-      :scroll="{ x: 1480 }"
+      :scroll="{ x: 1160, y: tableHeight }"
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待单据审核' }}</a-tag>
+      <!-- 单号 -->
+      <template slot="checkWarehouseNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
+        <span v-else>{{ record.checkWarehouseNo }}</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-warning" @click="handleEexamine(record)" id="inventoryCheckingList-eexamine-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleInventory(record)" id="inventoryCheckingList-inventory-btn">盘点</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="inventoryCheckingList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="inventoryCheckingList-detail-btn">详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="inventoryCheckingList-del-btn">删除</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'AUDIT_REJECT') && $hasPermissions('B_inventoryCheckingEdit')"
+          class="button-info"
+          @click="handleEdit(record)"
+        >编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_inventoryCheckingAudit')"
+          class="button-warning"
+          @click="handleEexamine(record)"
+        >审核</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state == 'WAIT_CHECK_WAREHOUSE' && $hasPermissions('B_inventoryCheckingInventory')"
+          class="button-warning"
+          @click="handleWarehouse(record)"
+        >盘点</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'AUDIT_REJECT') && $hasPermissions('B_inventoryCheckingDel')"
+          class="button-error"
+          @click="handleDel(record)"
+        >删除</a-button>
+        <span v-if="!((record.state == 'WAIT_SUBMIT') || (record.state == 'AUDIT_REJECT') && ($hasPermissions('B_inventoryCheckingEdit') || $hasPermissions('B_inventoryCheckingDel'))) && !(record.state == 'WAIT_AUDIT' && $hasPermissions('B_inventoryCheckingAudit')) && !(record.state == 'WAIT_CHECK_WAREHOUSE' && $hasPermissions('B_inventoryCheckingInventory'))">--</span>
       </template>
     </s-table>
-    <!-- 新增/编辑盘点单 -->
-    <inventory-checking-tips-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
+    <!-- 基础信息 -->
+    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+    <!-- 审核 -->
+    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder(true)" @fail="auditOrder(false)" />
+    <!-- 详情 -->
+    <inventoryChecking-detail-modal :openModal="openDetailModal" :itemSn="itemSn" @close="handleDetailClose" />
   </a-card>
 </template>
 
 <script>
-import { warehouseAllList, warehouseDel } from '@/api/warehouse'
 import { STable, VSelect } from '@/components'
-import inventoryCheckingTipsModal from './checkingTipsModal.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+import auditModal from '@/views/common/auditModal.vue'
+import basicInfoModal from './basicInfoModal.vue'
+import inventoryCheckingDetailModal from './detailModal.vue'
+import { checkWarehouseList, checkWarehouseDel, checkWarehouseAudit, checkWarehouseValidate } from '@/api/checkWarehouse'
 export default {
-  components: { STable, VSelect, inventoryCheckingTipsModal },
+  components: { STable, VSelect, rangeDate, auditModal, basicInfoModal, inventoryCheckingDetailModal },
   data () {
     return {
       queryParam: { //  查询条件
-        enabledFlag: undefined, //  状态
+        checkWarehouseNo: '',
+        checkType: undefined,
+        warehouseFlag: undefined,
+        state: undefined,
         beginDate: '', //  创建时间  开始时间
         endDate: '' //  创建时间  结束时间
       },
+      tableHeight: 0,
+      advanced: true,
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '盘点单号', dataIndex: 'nsso', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存总款数', dataIndex: 'no3', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存总数量', dataIndex: 'n4o', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单人', dataIndex: 'neo', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单据审核时间', dataIndex: 'shcreateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
-        { title: '盘点类型', dataIndex: 'sort', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 260, align: 'center', fixed: 'right' }
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, align: 'center' },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'totalStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点类型', dataIndex: 'checkTypeDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否区分仓库', dataIndex: 'warehouseFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return warehouseAllList( this.queryParam ).then(res => {
-        //   const data = res.data
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', state: 1, purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '2', state: 2, purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '3', state: 3, purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '4', state: 4, purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '5', state: 5, purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.spinning = true
+        return checkWarehouseList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
       openModal: false, //  新增编辑  弹框
       itemId: '', //  当前id
-      nowData: null //  当前记录数据
+      nowData: null, //  当前记录数据
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false,
+      openDetailModal: false,
+      itemSn: null
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
-    //  创建时间  change
-    creatTimechange (dates, dateStrings) {
-      this.queryParam.beginDate = dateStrings[0]
-      this.queryParam.endDate = dateStrings[1]
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.name = ''
+      this.queryParam.checkWarehouseNo = ''
+      this.queryParam.checkType = undefined
+      this.queryParam.warehouseFlag = undefined
+      this.queryParam.state = undefined
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.$refs.table.refresh(true)
     },
-    //  新增/编辑
-    handleEdit (row) {
-      this.itemId = row ? row.id : null
-      this.nowData = row || null
-      this.openModal = true
-    },
-    //  新增/编辑  成功
-    handleOk (type) {
-      if (type == 'a') {
-        this.$router.push({ path: `/inventoryManagement/inventoryChecking/overall/${this.itemId}` })
-      } else if (type == 'b') {
-        this.$router.push({ path: `/inventoryManagement/inventoryChecking/selfDisk/${this.itemId}` })
-      }
-    },
-    //  关闭弹框
-    closeModal () {
-      this.itemId = ''
-      this.openModal = false
-    },
-    //  详情
-    handleDetail (row) {
-      if (row.state == 3) { //  待盘点  详情
-        this.$router.push({ path: `/inventoryManagement/inventoryChecking/makeInventory/detail/${row.id}` })
-      } else if (row.state == 4) { //  待财务审核  详情
-        this.$router.push({ path: `/inventoryManagement/inventoryChecking/financialAudit/detail/${row.id}` })
-      } else { //  其他状态  详情
-        this.$router.push({ path: `/inventoryManagement/inventoryChecking/detail/${row.id}` })
-      }
-    },
-    //  审核
-    handleEexamine (row) {
+    // 新增
+    handleAdd () {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要审核通过吗?',
-        okText: row.state == 2 ? '确定' : '审核通过',
-        cancelText: row.state == 2 ? '取消' : '驳回重盘',
+        content: '如果开始盘点,不能再进行其他与产品出入库相关的操作。确认开始盘点吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          checkWarehouseValidate({}).then(res => {
+            if (res.status == 200) {
+              if (res.data) {
+                _this.openModal = true
+              } else {
+                _this.$message.info('存在未完结的盘点单,不能新增,请先完成盘点后再新增')
+              }
+            }
+          })
         }
       })
     },
-    //  盘点
-    handleInventory (row) {
-      this.$router.push({ path: `/inventoryManagement/inventoryChecking/makeInventory/${row.id}` })
+    //  编辑
+    handleEdit (row) {
+      if (row.checkType == 'ALL') { // 全盘
+        this.$router.push({ path: `/inventoryManagement/inventoryChecking/overall/${row.id}/${row.checkWarehouseSn}` })
+      } else if (row.checkType == 'SELECT') { // 自选盘点
+        this.$router.push({ path: `/inventoryManagement/inventoryChecking/selfDisk/${row.id}/${row.checkWarehouseSn}` })
+      }
+    },
+    //  详情
+    handleDetail (row) {
+      this.itemSn = row.checkWarehouseSn
+      this.openDetailModal = true
+    },
+    // 盘点
+    handleWarehouse (row) {
+      this.$router.push({ path: `/inventoryManagement/inventoryChecking/makeInventory/${row.id}/${row.checkWarehouseSn}` })
+    },
+    //  基本信息  保存
+    handleOk (data) {
+      this.handleEdit(data)
     },
     //  删除
     handleDel (row) {
@@ -203,16 +229,58 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
-          // warehouseDel({
-          //   id: row.id
-          // }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          checkWarehouseDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
+    },
+    //  审核
+    handleEexamine (row) {
+      this.auditInfo = row
+      this.visibleAudit = true
+    },
+    auditOrder (billStatus) {
+      this.spinningAudit = true
+      checkWarehouseAudit({
+        id: this.auditInfo.id,
+        auditFlag: billStatus
+      }).then(res => {
+        if (res.status == 200) {
+          this.visibleAudit = false
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinningAudit = false
+        } else {
+          this.visibleAudit = false
+          this.spinningAudit = false
+        }
+      })
+    },
+    handleDetailClose () {
+      this.itemSn = null
+      this.openDetailModal = false
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   }
 }

+ 293 - 146
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -1,187 +1,334 @@
 <template>
-  <div class="makeInventory-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="makeInventory-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="makeInventory-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <!-- <template slot="extra">
-        <a-button key="1" type="primary" id="makeInventory-print-btn">快速打印</a-button>
-        <a-button key="2" id="makeInventory-preview-btn">打印预览</a-button>
-        <a-button key="3" type="danger" @click="handleExport" :loading="exportLoading" id="makeInventory-export-btn">导出</a-button>
-        <a-button key="4" @click="handleImport" id="makeInventory-import-btn">导入</a-button>
-        <a-button key="5" type="link" @click="handleDownImport" id="makeInventory-down-import-btn">下载导入模板</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 详情 -->
-    <a-card size="small" :bordered="false" class="makeInventory-cont">
-      <!-- 筛选条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+  <div class="inventoryCheckMakeInventoryList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="inventoryCheckMakeInventoryList-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="inventoryCheckMakeInventoryList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span class="billno">单号:{{ basicInfoData&&basicInfoData.checkWarehouseNo }}</span>
+          <a-tag color="blue">{{ basicInfoData&&basicInfoData.stateDictValue }}</a-tag>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="inventoryCheckMakeInventoryList-cont">
+        <a-collapse>
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="盘点类型">{{ (basicInfoData&&basicInfoData.checkTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="是否区分仓库" v-if="basicInfoData&&basicInfoData.checkType=='SELECT'">{{ (basicInfoData&&basicInfoData.warehouseFlagDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="盘点仓库" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">{{ (basicInfoData&&basicInfoData.warehouseNameList) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建人">{{ (basicInfoData&&basicInfoData.creatorName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ (basicInfoData&&basicInfoData.checkSuperviseTime) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="inventoryCheckMakeInventoryList-cont">
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            <div style="display: flex;justify-content: space-between;align-items: center;">
+              <div>
+                总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+                总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
+                盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
+              </div>
+              <div>
+                <span style="color: red;display: inline-block;margin-right: 8px;">红色代表盘盈</span>
+                <span style="color: green;">绿色代表盘亏</span>
+              </div>
+            </div>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper">
           <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品编码">
-                <a-input id="makeInventory-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品名称">
-                <a-input id="makeInventory-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
-              </a-form-item>
+            <a-col :span="18">
+              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                <a-row :gutter="15">
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="产品编码/产品名称" prop="productName">
+                      <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品分类">
+                      <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    <a-form-item label="仓库">
+                      <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品类别">
-                <a-cascader :options="typeData" expand-trigger="hover" id="makeInventory-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="makeInventory-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="makeInventory-reset">重置</a-button>
+            <a-col :span="6">
+              <div style="float:right;overflow: hidden;">
+                <a-button size="small" type="primary" class="button-info" id="inventoryCheckMakeInventoryList-checkZero-btn" @click="handleCheckZero">整单盘零</a-button>
+              </div>
             </a-col>
           </a-row>
-        </a-form>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1070 }"
-        bordered>
-        <!-- 盘点数量 -->
-        <template slot="outOfStockNum" slot-scope="text, record">
-          <a-input-number
-            id="makeInventory-outOfStockNum"
-            :value="record.outOfStockNum"
-            :precision="0"
-            :min="0"
-            :max="999999"
-            placeholder="请输入" />
-        </template>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="makeInventory-submit" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 990 }"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 数量 -->
+          <template slot="checkQty" slot-scope="text, record">
+            <a-input-number
+              size="small"
+              id="inventoryCheckMakeInventoryList-choose-checkQty"
+              v-model="record.checkQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              @blur="e => checkQtyBlur(e.target.value, record)"
+              style="width: 100%;" />
+          </template>
+          <!-- 盈亏数量 -->
+          <template slot="checkProfitLossQty" slot-scope="text, record">
+            <span :style="{ color: record.checkProfitLossQty>0?'red':record.checkProfitLossQty<0?'green':'' }">{{ (record.checkProfitLossQty || record.checkProfitLossQty==0) ? record.checkProfitLossQty : '--' }}</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        id="inventoryCheckMakeInventoryList-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">盘点完成</a-button>
+    </div>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
+import ProductType from '@/views/common/productType.js'
+import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseInventory, checkWarehouseDetail, checkWarehouseDetailSave, checkWarehouseCheckZero } from '@/api/checkWarehouse'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType },
+  props: {},
   data () {
     return {
+      spinning: false,
+      disabled: false,
       queryParam: {
-        dataSourceNo: undefined
+        productName: '',
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warehouseSn: undefined
       },
-      exportLoading: false, // 导出loading
-      disabled: false, //  查询、重置按钮是否可操作
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'mementPay', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'memsentPay', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'memendtPay', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'tostalP', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点数量', scopedSlots: { customRender: 'outOfStockNum' }, width: 150, align: 'center' },
-        { title: '盈亏数量', dataIndex: 'totalNums', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
+      basicInfoData: null, // 基础信息
+      productTotal: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const 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.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.spinning = true
+        return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+          const 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
+            data.list[i].checkQtyBackups = data.list[i].checkQty
           }
-          _this.disabled = false
-          resolve(data)
+          this.getProduceTotal()
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      typeData: []
+      productType: []
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140 },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'stockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点数量', scopedSlots: { customRender: 'checkQty' }, width: 100, align: 'center' },
+        { title: '盈亏数量', scopedSlots: { customRender: 'checkProfitLossQty' }, width: 80, align: 'center' }
+      ]
+      if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
+        arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
     }
   },
   methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    //  盘点完成
+    handleSubmit () {
+      const _this = this
+      _this.spinning = true
+      checkWarehouseInventory({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+            _this.spinning = false
+          }, 1000)
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    // 数量  blur
+    checkQtyBlur (val, record) {
+      if (val != record.checkQtyBackups) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      if (!isEdit && !row.checkQty) {
+        this.$message.warning('请输入盘点数量!')
+        return
+      }
+      const params = {
+        checkWarehouseSn: this.$route.params.sn,
+        id: row.id,
+        checkCost: row.checkCost,
+        checkQty: row.checkQty,
+        productSn: row.productSn,
+        productCode: row.productCode,
+        productOrigCode: row.productOrigCode || undefined,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: row.brandSn,
+        stockQty: row.stockQty,
+        lastStockTime: row.lastStockTime,
+        checkProfitLossCost: row.checkProfitLossCost,
+        stockBatchNo: row.stockBatchNo || undefined,
+        productProduceDate: row.productProduceDate || undefined,
+        productExpiryDate: row.productExpiryDate || undefined,
+        warehouseSn: row.warehouseSn || undefined,
+        warehouseLocationSn: row.warehouseLocationSn || undefined
+      }
+      if (isEdit) { // 编辑
+        // 清空数量时,值应保持未清空前的值,因数量都不可为空
+        if (!row.checkQty) {
+          row.checkQty = row.checkQtyBackups
+          return
+        }
+      }
+      this.spinning = true
+      checkWarehouseDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 整单盘零
+    handleCheckZero () {
+      checkWarehouseCheckZero({ checkWarehouseSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh(true)
+        }
+      })
+    },
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true } })
     },
-    //  导入
-    handleImport () {},
-    //  下载导入模板
-    handleDownImport () {},
-    //  提交
-    handleSubmit () {},
-    //  重置
-    resetSearchForm () {},
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.oldTime && this.oldTime.length > 0) {
-        params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
-        params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginOldExpiryDate = ''
-        params.endOldExpirydDate = ''
-      }
-      if (this.newTime && this.newTime.length > 0) {
-        params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      customerBundleExportDelay(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
+    // 查询基础信息
+    getDetail () {
+      checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data || null
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 已选产品总计查询
+    getProduceTotal () {
+      checkWarehouseDetailCount(Object.assign(this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '仓库调拨' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+    })
   }
 }
 </script>
 
 <style lang="less">
-  .makeInventory-cont, .makeInventory-back{
-    margin-bottom: 10px;
+  .inventoryCheckMakeInventoryList-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    .inventoryCheckMakeInventoryList-cont, .inventoryCheckMakeInventoryList-back{
+      margin-bottom: 10px;
+    }
+    .billno{
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 15px;
+    }
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
   }
 </style>

+ 0 - 143
src/views/inventoryManagement/inventoryChecking/makeInventoryDetail.vue

@@ -1,143 +0,0 @@
-<template>
-  <div class="makeInventoryDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="makeInventoryDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="makeInventoryDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="1" type="primary" id="makeInventoryDetail-print-btn">快速打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="makeInventoryDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="盘点单号">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="监盘审核状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 详情 -->
-    <a-card size="small" :bordered="false" class="makeInventoryDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="详情">
-          <!-- 总计 -->
-          <a-alert type="info" style="margin-bottom:10px">
-            <div slot="message">库存总数量: <strong>6</strong> ,盈亏总数量: <strong>6</strong></div>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <div 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-select placeholder="请选择" id="makeInventoryDetail-type" allowClear v-model="queryParam.dataSourceNo">
-                      <a-select-option v-for="item in brandData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="makeInventoryDetail-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="makeInventoryDetail-reset">重置</a-button>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            bordered>
-            <!-- 采购数量 -->
-            <template slot="purchaseNum" slot-scope="text, record">
-              <span>{{record.purchaseNum}}</span>
-            </template>
-            <!-- 缺货数量 -->
-            <template slot="outOfStockNum" slot-scope="text, record">
-              <span>{{record.outOfStockNum}}</span>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-  </div>
-</template>
-
-<script>
-  import { STable, VSelect } from '@/components'
-  export default{
-    components: { STable, VSelect },
-    data(){
-      return{
-        queryParam: {
-          dataSourceNo: undefined
-        },
-        disabled: false, //  查询、重置按钮是否可操作
-        // 表头
-        columns: [
-          { title: '序号', dataIndex: 'no', align: 'center' },
-          { title: '产品编码', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '单位', dataIndex: 'mementPay', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '库存数量', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
-          { title: '盘点数量', dataIndex: 'tostalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盈亏数量', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        ],
-        // 加载数据方法 必须为 Promise 对象
-        loadData: parameter => {
-          this.disabled = true
-          // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-          //   const 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.disabled = false
-          //   return data
-          // })
-          const _this = this
-          return new Promise(function(resolve, reject){
-            const data = {
-              pageNo: 1,
-              pageSize: 10,
-              list: [
-                { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-              ],
-              count: 10
-            }
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            _this.disabled = false
-            resolve(data)
-          })
-        },
-        brandData: []
-      }
-    },
-    methods: {
-      //  重置
-      resetSearchForm(){},
-      //  返回列表
-      handleBack(){
-        this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true }})
-      },
-    }
-  }
-</script>
-
-<style lang="less">
-  .makeInventoryDetail-cont, .makeInventoryDetail-back{
-    margin-bottom: 10px;
-  }
-</style>

+ 152 - 69
src/views/inventoryManagement/inventoryChecking/overall.vue

@@ -1,108 +1,191 @@
 <template>
-  <div class="inventoryCheckingOverall-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="inventoryCheckingOverall-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="inventoryChecking-overall-submit" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="inventoryCheckingOverall-cont">
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-checkbox-group @change="onChange" v-model="queryParam.keyword" :disabled="disabled" id="inventoryCheckingOverall-type">
-          <a-checkbox value="A">不含废品仓</a-checkbox>
-          <a-checkbox value="B">有库存</a-checkbox>
-        </a-checkbox-group>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :showPagination="false"
-        bordered>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="inventoryChecking-overall-submit" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+  <div class="inventoryCheckOverallList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="inventoryCheckOverallList-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="inventoryCheckOverallList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span class="billno">单号:{{ basicInfoData&&basicInfoData.checkWarehouseNo }}</span>
+          <a-tag color="blue">{{ basicInfoData&&basicInfoData.stateDictValue }}</a-tag>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="inventoryCheckOverallList-cont">
+        <a-collapse>
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="盘点类型">{{ (basicInfoData&&basicInfoData.checkTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建人">{{ (basicInfoData&&basicInfoData.creatorName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ (basicInfoData&&basicInfoData.checkSuperviseTime) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="inventoryCheckOverallList-cont">
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+            总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+            总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="8" :sm="24">
+                <a-form-item label="产品编码/产品名称" prop="productName">
+                  <a-input id="inventoryCheckOverallList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckOverallList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckOverallList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          bordered>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        id="inventoryCheckOverallList-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
   </div>
 </template>
 
 <script>
-import { warehouseAllList, warehouseDel } from '@/api/warehouse'
 import { STable, VSelect } from '@/components'
+import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseSubmit, checkWarehouseDetail } from '@/api/checkWarehouse'
 export default {
   components: { STable, VSelect },
+  props: {},
   data () {
     return {
-      queryParam: { //  查询条件
-        keyword: [] //
+      spinning: false,
+      disabled: false,
+      queryParam: {
+        productName: ''
       },
-      disabled: false, //  查询、重置按钮是否可操作
+      basicInfoData: null, // 基础信息
+      productTotal: null,
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'createDate', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'nsso', width: 70, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'no3', width: 70, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'n4o', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'stockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return warehouseAllList( this.queryParam ).then(res => {
-        //   const data = res.data
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.spinning = true
+        return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.getProduceTotal()
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       }
-
     }
   },
   methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.$refs.table.refresh(true)
+    },
     //  提交
     handleSubmit () {
-
+      const _this = this
+      _this.spinning = true
+      checkWarehouseSubmit({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+            _this.spinning = false
+          }, 1000)
+        } else {
+          _this.spinning = false
+        }
+      })
     },
-    //  返回
+    //  返回列表
     handleBack () {
       this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true } })
     },
-    //
-    onChange () {}
+    // 查询基础信息
+    getDetail () {
+      checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data || null
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 已选产品总计查询
+    getProduceTotal () {
+      checkWarehouseDetailCount(Object.assign(this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+    })
   }
 }
 </script>
 
 <style lang="less">
-  .inventoryCheckingOverall-wrap{
-    padding: 10px 0 30px;
-    .table-operator{
-      margin-bottom: 25px;
-    }
-    .inventoryCheckingOverall-cont, .inventoryCheckingOverall-back{
+  .inventoryCheckOverallList-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    .inventoryCheckOverallList-cont, .inventoryCheckOverallList-back{
       margin-bottom: 10px;
     }
+    .billno{
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 15px;
+    }
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
   }
 </style>

+ 599 - 240
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -1,326 +1,685 @@
 <template>
-  <div class="selfDisk-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="selfDisk-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="selfDisk-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="selfDisk-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">选择产品</template>
-          <!-- 选择产品 -->
-          <div>
-            <!-- 搜索条件 -->
-            <div class="table-page-search-wrapper">
+  <div class="inventoryCheckSelfDiskList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="inventoryCheckSelfDiskList-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="inventoryCheckSelfDiskList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span class="billno">单号:{{ basicInfoData&&basicInfoData.checkWarehouseNo }}</span>
+          <a-tag color="blue">{{ basicInfoData&&basicInfoData.stateDictValue }}</a-tag>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="inventoryCheckSelfDiskList-cont">
+        <a-collapse>
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="盘点类型">{{ (basicInfoData&&basicInfoData.checkTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="是否区分仓库">{{ (basicInfoData&&basicInfoData.warehouseFlagDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="盘点仓库" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">{{ (basicInfoData&&basicInfoData.warehouseNameList) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建人">{{ (basicInfoData&&basicInfoData.creatorName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ (basicInfoData&&basicInfoData.checkSuperviseTime) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="inventoryCheckSelfDiskList-cont">
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper">
+          <a-row>
+            <a-col :md="20" :sm="24">
               <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="selfDisk-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="产品名称/产品编码/原厂编码"/>
+                    <a-form-item label="产品编码/产品名称" prop="productCode">
+                      <a-input id="inventoryCheckSelfDiskList-productCode" v-model="queryParam.productCode" placeholder="请输入" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择"
-                        id="selfDisk-state"
-                        allowClear
-                        v-model="queryParam.dataSourceNo"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
-                      </a-select>
+                      <ProductBrand id="inventoryCheckSelfDiskList-productBrand" v-model="queryParam.brandSn"></ProductBrand>
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品分类">
-                      <a-cascader :options="typeData" expand-trigger="hover" id="selfDisk-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+                      <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeProductType" v-model="productType"></ProductType>
                     </a-form-item>
                   </a-col>
-                  <template v-if="advanced">
-                    <a-col :md="6" :sm="24">
-                      <a-form-item label="库存">
-                        <a-select
-                          placeholder="请选择"
-                          id="selfDisk-state"
-                          allowClear
-                          v-model="queryParam.dataSourceNo"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col>
+                  <template v-if="advanced && basicInfoData&&basicInfoData.warehouseFlag=='1'">
                     <a-col :md="6" :sm="24">
                       <a-form-item label="仓库">
-                        <a-select
-                          placeholder="请选择"
-                          id="selfDisk-state"
-                          allowClear
-                          v-model="queryParam.dataSourceNo"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                        <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
+                  </template>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckSelfDiskList-reset">重置</a-button>
+                    <a v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'" @click="advanced=!advanced" style="margin-left: 5px">
+                      {{ advanced ? '收起' : '展开' }}
+                      <a-icon :type="advanced ? 'up' : 'down'"/>
+                    </a>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </a-col>
+            <a-col :md="4" :sm="24" style="text-align: right;">
+              <a-button size="small" type="primary" class="button-info" @click.stop="handleBatchAdd('batch')" id="chainTransferOutEdit-del-all-btn">批量添加</a-button>
+              <a-button
+                size="small"
+                type="primary"
+                class="button-info"
+                style="margin-left: 5px"
+                @click.stop="handleBatchAdd('all')"
+                id="chainTransferOutEdit-del-all-btn">全部添加</a-button>
+            </a-col>
+          </a-row>
+        </div>
+        <!-- 列表 -->
+        <!-- <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :row-selection="$hasPermissions('B_inventoryWarningBatchSave') ? {
+            selectedRowKeys: selectedRowKeys,
+            onChange: onChange,
+            onSelect: onSelectChange,
+            onSelectAll: onSelectAllChange
+          } : null"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :customRow="handleClickRow"
+          :data="loadData"
+          :scroll="{ x: 1280, y: 300 }"
+          bordered> -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :row-selection="{
+            selectedRowKeys: selectedRowKeys,
+            onChange: onChange,
+            onSelect: onSelectChange,
+            onSelectAll: onSelectAllChange
+          }"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :customRow="handleClickRow"
+          :data="loadData"
+          :scroll="{ x: 1280, y: 300 }"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.dealerProduct.productTypeName2 || record.dealerProduct.productTypeName3">{{ record.dealerProduct.productTypeName2 }} {{ record.dealerProduct.productTypeName3 ? '>' : '' }} {{ record.dealerProduct.productTypeName3 }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="inventoryCheckSelfDiskList-add-btn">添加</a-button>
+          </template>
+        </s-table>
+      </a-card>
+      <a-card size="small" :bordered="false" class="inventoryCheckSelfDiskList-cont">
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+            总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+            总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper">
+          <a-row>
+            <a-col :md="20" :sm="24">
+              <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                <a-row :gutter="15">
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品编码/产品名称" prop="productCode">
+                      <a-input id="inventoryCheckSelfDiskList-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品品牌">
+                      <ProductBrand id="inventoryCheckSelfDiskList-productBrand" v-model="chooseQueryParam.brandSn"></ProductBrand>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品分类">
+                      <ProductType id="inventoryCheckSelfDiskList-productType" @change="changeChooseProductType" v-model="chooseProductType"></ProductType>
+                    </a-form-item>
+                  </a-col>
+                  <template v-if="chooseAdvanced && basicInfoData&&basicInfoData.warehouseFlag=='1'">
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="仓位">
-                        <a-select
-                          placeholder="请选择"
-                          id="selfDisk-state"
-                          allowClear
-                          v-model="queryParam.dataSourceNo"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                      <a-form-item label="仓库">
+                        <a-select id="inventoryCheckSelfDiskList-warehouseSn" allowClear placeholder="请选择仓库" v-model="chooseQueryParam.warehouseSn" >
+                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
                   </template>
-                  <a-col :md="6" :sm="24">
-                    <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="selfDisk-refresh">查询</a-button>
-                    <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="selfDisk-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 8px">
-                      {{ advanced ? '收起' : '展开' }}
-                      <a-icon :type="advanced ? 'up' : 'down'"/>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="inventoryCheckSelfDiskList-reset">重置</a-button>
+                    <a v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'" @click="chooseAdvanced=!chooseAdvanced" style="margin-left: 5px">
+                      {{ chooseAdvanced ? '收起' : '展开' }}
+                      <a-icon :type="chooseAdvanced ? 'up' : 'down'"/>
                     </a>
                   </a-col>
                 </a-row>
               </a-form>
-            </div>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="columns"
-              :data="loadData"
-              :scroll="{ x: 1420 }"
-              bordered>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" @click="handleAdd(record)" id="selfDisk-add-btn">添加</a-button>
-              </template>
-            </s-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="selfDisk-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            已选产品
-            <!-- <a-button size="small" class="import-btn" id="selfDisk-import-btn" @click.stop="handleImport">导入明细</a-button> -->
+            </a-col>
+            <a-col :md="4" :sm="24" style="text-align: right;">
+              <a-button size="small" type="primary" class="button-error" @click.stop="handleDel('', 'batch')" id="chainTransferOutEdit-del-all-btn">批量删除</a-button>
+              <a-button
+                size="small"
+                type="primary"
+                class="button-error"
+                style="margin-left: 5px"
+                @click.stop="handleDel('', 'all')"
+                id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+            </a-col>
+          </a-row>
+        </div>
+        <!-- 列表 -->
+        <!-- <s-table
+          class="sTable"
+          ref="chooseTable"
+          size="small"
+          :row-selection="$hasPermissions('B_inventoryWarningBatchSave') ? {
+            selectedRowKeys: selectedRowKeys,
+            onChange: onChange,
+            onSelect: onSelectChange,
+            onSelectAll: onSelectAllChange
+          } : null"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1280, y: 300 }"
+          bordered> -->
+        <s-table
+          class="sTable"
+          ref="chooseTable"
+          size="small"
+          :row-selection="{
+            selectedRowKeys: chooseSelectedRowKeys,
+            onChange: onChooseChange,
+            onSelect: onChooseSelectChange,
+            onSelectAll: onChooseSelectAllChange
+          }"
+          :rowKey="(record) => record.id"
+          :columns="chooseColumns"
+          :data="chooseLoadData"
+          :scroll="{ x: 1280, y: 300 }"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
           </template>
-          <!-- 已选产品 -->
-          <div>
-            <!-- 总计 -->
-            <a-alert type="info" style="margin-bottom:10px">
-              <div slot="message">产品款数 <strong>6</strong> ,采购数量合计 <strong>6</strong> ,采购金额合计¥<strong>6.33</strong></div>
-            </a-alert>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="chooseColumns"
-              :data="chooseLoadData"
-              :scroll="{ x: 1420 }"
-              bordered>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="selfDisk-del-btn">删除</a-button>
-              </template>
-            </s-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="warehouseAllocationEdit-submit" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="inventoryCheckSelfDiskList-del-btn">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        id="inventoryCheckSelfDiskList-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+import { checkWarehouseDetail, checkWarehouseDetailStockList, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseWarehouse, checkWarehouseDetailSave, checkWarehouseDetailSaveBatch, checkWarehouseDetailDel, checkWarehouseSubmit } from '@/api/checkWarehouse'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType, ProductBrand },
+  props: {},
   data () {
     return {
+      spinning: false,
+      advanced: false, // 高级搜索 展开/关闭
+      chooseAdvanced: false, // 高级搜索 展开/关闭
+      disabled: false,
+      chooseDisabled: false,
       queryParam: {
-
+        warehouseSn: undefined,
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
       },
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
-      advanced: false, //  高级搜索 展开/关闭
-      disabled: false, //  查询、重置按钮是否可操作
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'custssName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品级别', dataIndex: 'custsdName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'totalNums', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'totalNsums', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'storageQuantity', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', scopedSlots: { customRender: 'outOfStockNum' }, width: 100, align: 'center' },
-        { title: '最后入库时间', scopedSlots: { customRender: 'purchaseNum' }, width: 160, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
+      basicInfoData: null, // 基础信息
+      productTotal: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const 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.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.spinning = true
+        return checkWarehouseDetailStockList(Object.assign(parameter, this.queryParam, { checkWarehouseId: this.$route.params.id })).then(res => {
+          const 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.disabled = false
-          resolve(data)
+          this.listData = data.list || []
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'custName', align: 'center' },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center' },
-        { title: '产品品牌', dataIndex: 'custsNasme', width: 100, align: 'center' },
-        { title: '产品级别', dataIndex: 'custsNdme', width: 100, align: 'center' },
-        { title: '仓库', dataIndex: 'totalNums', width: 100, align: 'center' },
-        { title: '仓位', dataIndex: 'totalNsums', width: 100, align: 'center' },
-        { title: '库存数量', dataIndex: 'storageQuantity', width: 100, align: 'center' },
-        { title: '单位', scopedSlots: { customRender: 'outOfStockNum' }, width: 100, align: 'center' },
-        { title: '最后入库时间', scopedSlots: { customRender: 'purchaseNum' }, width: 160, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
+      chooseQueryParam: {
+        warehouseSn: undefined,
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
+      },
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const 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.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '2', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' },
-              { id: '3', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
+        this.chooseDisabled = true
+        return checkWarehouseDetailList(Object.assign(parameter, this.chooseQueryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+          const 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.disabled = false
-          resolve(data)
+          this.getDetailCount()
+          this.chooseDisabled = false
+          return data
         })
       },
-      openModal: false // 选择基本信息弹框是否显示
+      productType: [],
+      chooseProductType: [],
+      warehouseList: [], //  仓库  下拉数据
+      selectedRowKeys: [],
+      selectedRows: [],
+      chooseSelectedRowKeys: [],
+      chooseSelectedRows: [],
+      listData: []
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140 },
+        { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'currentQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
+        arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 180, align: 'center' },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'stockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
+        arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
       this.$refs.table.refresh(true)
     },
-    //  提交
-    handleSubmit () {},
     //  添加
-    handleAdd (row) {},
-    //  删除
-    handleDel (row) {},
-    //  编辑基本信息
-    handleEditInfo () {
-      this.openModal = true
+    handleAdd (row) {
+      const params = {
+        checkWarehouseSn: this.$route.params.sn,
+        checkCost: row.putCost,
+        productSn: row.productSn,
+        productCode: row.productCode,
+        productOrigCode: row.productOrigCode || undefined,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: row.brandSn,
+        stockQty: row.currentQty,
+        lastStockTime: row.lastStockTime,
+        checkProfitLossCost: row.lastStockCost,
+        stockBatchNo: row.stockBatchNo || undefined,
+        productProduceDate: row.productProduceDate || undefined,
+        productExpiryDate: row.productExpiryDate || undefined,
+        warehouseSn: row.warehouseSn || undefined,
+        warehouseLocationSn: row.warehouseLocationSn || undefined
+      }
+      this.spinning = true
+      checkWarehouseDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     },
-    //  基本信息  保存
-    handleOk () {
-
+    //  批量添加/全部添加
+    handleBatchAdd (type) {
+      const _this = this
+      let params = {}
+      if (type == 'batch') { //  批量添加
+        if (this.selectedRows.length == 0) {
+          this.$message.warning('请选择需要批量添加的选项值后再操作!')
+          return
+        }
+        params.checkWarehouseSn = _this.$route.params.sn
+        params.checkWarehouseDetailEntityList = []
+        this.selectedRows.map(item => {
+          params.checkWarehouseDetailEntityList.push({
+            checkWarehouseSn: _this.$route.params.sn,
+            checkCost: item.putCost,
+            productSn: item.productSn,
+            productCode: item.productCode,
+            productOrigCode: item.productOrigCode || undefined,
+            productTypeSn1: item.productTypeSn1,
+            productTypeSn2: item.productTypeSn2,
+            productTypeSn3: item.productTypeSn3,
+            brandSn: item.brandSn,
+            stockQty: item.currentQty,
+            lastStockTime: item.lastStockTime,
+            checkProfitLossCost: item.lastStockCost,
+            stockBatchNo: item.stockBatchNo || undefined,
+            productProduceDate: item.productProduceDate || undefined,
+            productExpiryDate: item.productExpiryDate || undefined,
+            warehouseSn: item.warehouseSn || undefined,
+            warehouseLocationSn: item.warehouseLocationSn || undefined
+          })
+        })
+      } else if (type == 'all') { //  全部添加
+        if (this.listData.length == 0) {
+          this.$message.warning('暂时没有可添加的产品')
+          return
+        }
+        params = {
+          checkWarehouseSn: _this.$route.params.sn,
+          allFlag: true,
+          stockDetailDTO: this.queryParam
+        }
+      }
+      this.spinning = true
+      checkWarehouseDetailSaveBatch(params).then(res => {
+        if (res.status == 200) {
+          this.selectedRowKeys = []
+          this.selectedRows = []
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     },
-    //  导入明细
-    handleImport () {
-      console.log(333)
+    //  删除
+    handleDel (row, isAll) {
+      const _this = this
+      let content
+      if (isAll == 'batch') { // 批量
+        if (this.chooseSelectedRowKeys.length == 0) {
+          this.$message.warning('请选择需要批量删除的选项值后再操作!')
+          return
+        }
+        content = '删除后不可恢复,确定要进行批量删除吗?'
+      } else if (isAll == 'all') { // 全部
+        content = '删除后不可恢复,确定要进行整单删除吗?'
+      } else { // 单个
+        content = '删除后不可恢复,确定要进行删除吗?'
+      }
+      this.$confirm({
+        title: '提示',
+        content: content,
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          const params = { checkWarehouseSn: _this.$route.params.sn }
+          if (isAll == 'batch') { // 批量
+            params.idList = _this.chooseSelectedRowKeys
+          } else if (isAll == 'all') { // 全部
+            params.allFlag = true
+          } else { // 单个
+            params.id = row.id
+          }
+          checkWarehouseDetailDel(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.$refs.chooseTable.refresh()
+              if (isAll == 'batch') { // 批量
+                _this.chooseSelectedRowKeys = []
+                _this.chooseSelectedRows = []
+              }
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
     },
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true } })
     },
-    filterOption (input, option) {
-      	return (
-      		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      	)
+    // 查询基础信息
+    getDetail () {
+      checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data || null
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.chooseQueryParam.warehouseSn = undefined
+      this.chooseQueryParam.brandSn = undefined
+      this.chooseQueryParam.productTypeSn1 = undefined
+      this.chooseQueryParam.productTypeSn2 = undefined
+      this.chooseQueryParam.productTypeSn3 = undefined
+      this.chooseProductType = []
+      this.$refs.chooseTable.refresh(true)
+    },
+    // 合计
+    getDetailCount (params) {
+      checkWarehouseDetailCount(Object.assign(this.chooseQueryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      _this.spinning = true
+      checkWarehouseSubmit({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+            _this.spinning = false
+          }, 1000)
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    changeChooseProductType (val, opt) {
+      this.chooseQueryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.chooseQueryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.chooseQueryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 仓库下拉数据
+    getWarehouseList () {
+      checkWarehouseWarehouse({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    onChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+    },
+    onSelectChange (record, selected, selectedRows, nativeEvent) {
+      const _this = this
+      if (selected) { //  选择
+        this.selectedRows.push(record)
+      } else { //  取消
+        const arrId = []
+        this.selectedRows.map((item, index) => {
+          if (item.id == record.id) {
+            arrId.push(index)
+          }
+        })
+        arrId.map((item, index) => {
+          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        })
+      }
+    },
+    // 本页全选/取消全选
+    onSelectAllChange (selected, selectedRows, changeRows) {
+      const _this = this
+      if (selected) { //  选择
+        this.selectedRows = [...this.selectedRows, ...changeRows]
+      } else { //  取消
+        const arrId = []
+        this.selectedRows.map((item, index) => {
+          this.selectedRows.map((subItem, ind) => {
+            if (item.id == subItem.id) {
+              arrId.push(index)
+            }
+          })
+        })
+        arrId.map((item, index) => {
+          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        })
+      }
+    },
+    onChooseChange (selectedRowKeys, selectedRows) {
+      this.chooseSelectedRowKeys = selectedRowKeys
+    },
+    onChooseSelectChange (record, selected, selectedRows, nativeEvent) {
+      const _this = this
+      if (selected) { //  选择
+        this.chooseSelectedRows.push(record)
+      } else { //  取消
+        const arrId = []
+        this.chooseSelectedRows.map((item, index) => {
+          if (item.id == record.id) {
+            arrId.push(index)
+          }
+        })
+        arrId.map((item, index) => {
+          _this.chooseSelectedRows = _this.chooseSelectedRows.slice(item, item + 1)
+        })
+      }
+    },
+    // 本页全选/取消全选
+    onChooseSelectAllChange (selected, selectedRows, changeRows) {
+      const _this = this
+      if (selected) { //  选择
+        this.chooseSelectedRows = [...this.chooseSelectedRows, ...changeRows]
+      } else { //  取消
+        const arrId = []
+        this.chooseSelectedRows.map((item, index) => {
+          this.chooseSelectedRows.map((subItem, ind) => {
+            if (item.id == subItem.id) {
+              arrId.push(index)
+            }
+          })
+        })
+        arrId.map((item, index) => {
+          _this.chooseSelectedRows = _this.chooseSelectedRows.slice(item, item + 1)
+        })
+      }
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.openModal = false
+      vm.getDetail()
+      vm.getWarehouseList()
     })
   }
 }
 </script>
 
 <style lang="less">
-  .selfDisk-wrap{
-    .selfDisk-back{
+  .inventoryCheckSelfDiskList-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    .inventoryCheckSelfDiskList-cont, .inventoryCheckSelfDiskList-back{
       margin-bottom: 10px;
     }
-    .selfDisk-cont{
-      margin-bottom: 10px;
-      .import-btn{
-        margin-left: 15px;
-      }
+    .billno{
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 15px;
+    }
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
     }
   }
 </style>