123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <template>
- <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 defaultActiveKey="1">
- <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="盘点仓库" :span="3" 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="产品编码" 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="产品名称" prop="productName">
- <a-input id="inventoryCheckSelfDiskList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="产品品牌">
- <ProductBrand id="inventoryCheckSelfDiskList-productBrand" v-model="queryParam.brandSn"></ProductBrand>
- </a-form-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="产品分类">
- <ProductType id="inventoryCheckSelfDiskList-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="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 @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="{
- selectedRowKeys: selectedRowKeys,
- onChange: onChange,
- onSelect: onSelectChange,
- onSelectAll: onSelectAllChange
- }"
- :rowKey="(record) => record.id"
- :columns="columns"
- :customRow="handleClickRow"
- :data="loadData"
- :scroll="{ y: 300 }"
- :defaultLoadData="false"
- 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="产品名称" prop="productName">
- <a-input id="inventoryCheckSelfDiskList-productName" v-model="chooseQueryParam.productName" 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>
- <template v-if="chooseAdvanced">
- <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>
- <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
- <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" 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 @click="chooseAdvanced=!chooseAdvanced" style="margin-left: 5px">
- {{ chooseAdvanced ? '收起' : '展开' }}
- <a-icon :type="chooseAdvanced ? '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-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="{
- selectedRowKeys: chooseSelectedRowKeys,
- onChange: onChooseChange,
- onSelect: onChooseSelectChange,
- onSelectAll: onChooseSelectAllChange
- }"
- :rowKey="(record) => record.id"
- :columns="chooseColumns"
- :data="chooseLoadData"
- :scroll="{ y: 300 }"
- :defaultLoadData="false"
- 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="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 { commonMixin } from '@/utils/mixin'
- import { STable, VSelect } from '@/components'
- import ProductType from '@/views/common/productType.js'
- import ProductBrand from '@/views/common/productBrand.js'
- import { checkWarehouseDetail, checkWarehouseDetailStockList, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseDetailSave, checkWarehouseDetailSaveBatch, checkWarehouseDetailDel, checkWarehouseSubmit } from '@/api/checkWarehouse'
- export default {
- name: 'CheckWarehouseSelfDisk',
- components: { STable, VSelect, ProductType, ProductBrand },
- mixins: [commonMixin],
- props: {},
- data () {
- return {
- spinning: false,
- advanced: false, // 高级搜索 展开/关闭
- chooseAdvanced: false, // 高级搜索 展开/关闭
- disabled: false,
- chooseDisabled: false,
- queryParam: {
- productCode: '',
- productName: '',
- warehouseSn: undefined,
- brandSn: undefined,
- productTypeSn1: undefined,
- productTypeSn2: undefined,
- productTypeSn3: undefined
- },
- basicInfoData: null, // 基础信息
- productTotal: null,
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- 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.listData = data.list || []
- this.disabled = false
- this.spinning = false
- return data
- })
- },
- chooseQueryParam: {
- productCode: '',
- productName: '',
- warehouseSn: undefined,
- brandSn: undefined,
- productTypeSn1: undefined,
- productTypeSn2: undefined,
- productTypeSn3: undefined
- },
- // 加载数据方法 必须为 Promise 对象
- chooseLoadData: parameter => {
- 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.getDetailCount()
- this.chooseDisabled = false
- return data
- })
- },
- productType: [],
- chooseProductType: [],
- warehouseList: [], // 仓库 下拉数据
- selectedRowKeys: [],
- selectedRows: [],
- chooseSelectedRowKeys: [],
- chooseSelectedRows: [],
- listData: []
- }
- },
- computed: {
- columns () {
- const arr = [
- { title: '产品编码', dataIndex: 'productCode', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '12%' : '22%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品名称', dataIndex: 'productName', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '15%' : '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '产品品牌', dataIndex: 'brandName', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '9%' : '11%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '14%' },
- { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '最后入库时间', dataIndex: 'lastStockTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
- ]
- if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
- arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
- arr.splice(5, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
- }
- return arr
- },
- chooseColumns () {
- const arr = [
- { title: '产品编码', dataIndex: 'productCode', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '12%' : '22%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品名称', dataIndex: 'productName', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '15%' : '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '产品品牌', dataIndex: 'brandName', width: this.basicInfoData && this.basicInfoData.warehouseFlag == '1' ? '9%' : '11%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '14%', align: 'center' },
- { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '库存数量', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '最后入库时间', dataIndex: 'lastStockTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
- ]
- if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
- arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
- arr.splice(5, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
- }
- return arr
- }
- },
- methods: {
- // 重置
- resetSearchForm () {
- 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)
- },
- // 添加
- 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
- }
- })
- },
- // 批量添加/全部添加
- 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
- }
- })
- },
- // 删除
- 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' })
- },
- // 查询基础信息
- getDetail () {
- checkWarehouseDetail({ sn: this.$route.params.sn }).then(res => {
- if (res.status == 200) {
- this.basicInfoData = res.data || null
- this.warehouseList = res.data.warehouseList || []
- } else {
- this.basicInfoData = null
- this.warehouseList = []
- }
- })
- },
- // 已选产品 重置
- 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] : ''
- },
- // 双击快速添加
- handleClickRow (record) {
- return {
- on: {
- dblclick: (event) => {
- this.handleAdd(record)
- }
- }
- }
- },
- onChange (selectedRowKeys, selectedRows) {
- this.selectedRowKeys = selectedRowKeys
- },
- onSelectChange (record, selected, selectedRows, nativeEvent) {
- if (selected) { // 选择
- this.selectedRows.push(record)
- } else { // 取消
- this.selectedRows = selectedRows
- }
- },
- // 本页全选/取消全选
- 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)
- })
- }
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
- this.getDetail()
- this.resetSearchForm()
- this.chooseResetSearchForm()
- }
- },
- activated () {
- // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
- if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
- this.getDetail()
- this.resetSearchForm()
- this.chooseResetSearchForm()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {})
- }
- }
- </script>
- <style lang="less">
- .inventoryCheckSelfDiskList-wrap{
- position: relative;
- height: 100%;
- padding-bottom: 51px;
- box-sizing: border-box;
- .inventoryCheckSelfDiskList-cont, .inventoryCheckSelfDiskList-back{
- margin-bottom: 10px;
- }
- .billno{
- font-size: 16px;
- font-weight: bold;
- margin: 0 15px;
- }
- >.ant-spin-nested-loading{
- overflow-y: scroll;
- height: 100%;
- }
- }
- </style>
|