|
|
@@ -3,8 +3,9 @@
|
|
|
<Navbar :title="'选择工装设备生成盘点详情'" :is-go-back="false" />
|
|
|
<div class="action-buttons">
|
|
|
<a-button type="primary" @click="searchDatas">搜索</a-button>
|
|
|
- <a-button type="dashed" @click="generateCheckVouchs">生成盘点明细</a-button>
|
|
|
- <a-button danger @click="clear">清空</a-button>
|
|
|
+ <a-button type="dashed" @click="generateCheckVouchs">生成明细</a-button>
|
|
|
+ <a-button type="dashed" @click="showDetail = true">所选明细({{ selectedRowKeys.length }})</a-button>
|
|
|
+ <a-button danger @click="clearFilter">清除条件</a-button>
|
|
|
</div>
|
|
|
<div style="display: flex; gap: 10px;">
|
|
|
<div style="width: 26%;">
|
|
|
@@ -12,13 +13,13 @@
|
|
|
<div class="category-panel">
|
|
|
<a-form layout="horizontal" :model="formState">
|
|
|
<a-form-item label="名称">
|
|
|
- <a-input v-model:value="formState.inventoryName" placeholder="请输入名称" @keyup.enter="getCurrentStock" />
|
|
|
+ <a-input v-model:value="formState.inventoryName" placeholder="请输入名称" @keyup.enter="searchDatas" />
|
|
|
</a-form-item>
|
|
|
<a-form-item label="编号">
|
|
|
- <a-input v-model:value="formState.inventoryNo" placeholder="请输入编号" @keyup.enter="getCurrentStock" />
|
|
|
+ <a-input v-model:value="formState.inventoryNo" placeholder="请输入编号" @keyup.enter="searchDatas" />
|
|
|
</a-form-item>
|
|
|
<a-form-item label="类型">
|
|
|
- <a-select v-model:value="formState.inventoryType" placeholder="请选择类型" @change="getCurrentStock">
|
|
|
+ <a-select v-model:value="formState.inventoryType" placeholder="请选择类型" @change="searchDatas">
|
|
|
<a-select-option :value="undefined">全部工装设备</a-select-option>
|
|
|
<a-select-option value="Clamp">工装</a-select-option>
|
|
|
<a-select-option value="Instrument">设备</a-select-option>
|
|
|
@@ -32,7 +33,7 @@
|
|
|
<div style="width: 74%;margin:10px 0 0 10px;">
|
|
|
<CommonTable
|
|
|
ref="tableRef" :columns="currentStockColumns" :data-source="currentStocks"
|
|
|
- :total="currentStocks.length" :is-custom-row-click="true" @custom-row-click="openWindow"
|
|
|
+ :total="pagination.total" :is-select="true" @get-pager="getPageParams" @get-selected="getSelectParams"
|
|
|
>
|
|
|
<template #bodyCell="{ column, index }">
|
|
|
<span v-if="column.dataIndex === 'index'">
|
|
|
@@ -43,6 +44,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <Modal v-model:show="showDetail" title="盘点明细" small="true" :show-canel-button="false" :show-ok-button="false">
|
|
|
+ <div>
|
|
|
+ <a-button :disabled="selectedRowKeys.length === 0" danger @click="clearSelected">清空所有选择</a-button>
|
|
|
+ <CommonTable :columns="detailColumns" :data-source="selectedRowData" :extra-height="320">
|
|
|
+ <template #bodyCell="{ column, record, index }">
|
|
|
+ <span v-if="column.dataIndex === 'index'">
|
|
|
+ {{ index + 1 }}
|
|
|
+ </span>
|
|
|
+ <template v-if="column.dataIndex === 'operation'">
|
|
|
+ <a-button danger @click="deleteCountList(record.id)">
|
|
|
+ 删除
|
|
|
+ </a-button>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </CommonTable>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <a-button type="primary" @click="showDetail = false">关闭</a-button>
|
|
|
+ </template>
|
|
|
+ </Modal>
|
|
|
+
|
|
|
<Loading v-if="loading" />
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -67,8 +89,8 @@ export default {
|
|
|
currentStocks: [],
|
|
|
pagination: {
|
|
|
total: 0,
|
|
|
- pageSize: 10,
|
|
|
- current: 1,
|
|
|
+ per_page: 20,
|
|
|
+ current_page: 1,
|
|
|
},
|
|
|
isCurrentStock: true,
|
|
|
uuid: Uuid.createUUID(),
|
|
|
@@ -80,6 +102,9 @@ export default {
|
|
|
inventoryNo: '',
|
|
|
inventoryType: undefined,
|
|
|
},
|
|
|
+ showDetail: false,
|
|
|
+ selectedRowKeys: [],
|
|
|
+ selectedRowData: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -96,6 +121,17 @@ export default {
|
|
|
return { ...item, align: 'center' };
|
|
|
});
|
|
|
},
|
|
|
+ detailColumns() {
|
|
|
+ return [
|
|
|
+ { title: '序号', dataIndex: 'index', width: 50 },
|
|
|
+ { title: '名称', dataIndex: 'inventoryName', width: 100 },
|
|
|
+ { title: '编号', dataIndex: 'inventoryNo', width: 120 },
|
|
|
+ { title: '类型', dataIndex: 'inventoryType', width: 140 },
|
|
|
+ { title: '操作', dataIndex: 'operation', width: 100 },
|
|
|
+ ].map(item => {
|
|
|
+ return { ...item, align: 'center' };
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
@@ -121,9 +157,21 @@ export default {
|
|
|
methods: {
|
|
|
|
|
|
searchDatas() {
|
|
|
+ this.$refs.tableRef.backFirstPage();
|
|
|
+ },
|
|
|
+
|
|
|
+ getPageParams(page, pageSize) {
|
|
|
+ this.pagination.current_page = page;
|
|
|
+ this.pagination.per_page = pageSize;
|
|
|
this.getCurrentStock();
|
|
|
},
|
|
|
|
|
|
+ // 获取选中的数据
|
|
|
+ getSelectParams(selected) {
|
|
|
+ this.selectedRowKeys = selected.selectedRowKeys;
|
|
|
+ this.selectedRowData = selected.selectedRows;
|
|
|
+ },
|
|
|
+
|
|
|
getCurrentStock() {
|
|
|
const _self = this;
|
|
|
|
|
|
@@ -132,9 +180,11 @@ export default {
|
|
|
inventoryName: _self.formState.inventoryName,
|
|
|
inventoryNo: _self.formState.inventoryNo,
|
|
|
inventoryType: _self.formState.inventoryType,
|
|
|
+ start: (_self.pagination.current_page - 1) * _self.pagination.per_page,
|
|
|
+ length: _self.pagination.per_page,
|
|
|
};
|
|
|
$.ajax({
|
|
|
- url: Common.getApiURL('InventoryResource/checkVouchFindInventoryByCondition'),
|
|
|
+ url: Common.getApiURL('InventoryResource/checkVouchFindInventoryByConditionPage'),
|
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
|
contentType: 'application/json',
|
|
|
@@ -144,9 +194,17 @@ export default {
|
|
|
},
|
|
|
success: data => {
|
|
|
if (data.errorCode === 0) {
|
|
|
- _self.currentStocks = data.datas;
|
|
|
+ if (data.datas && data.datas.length > 0) {
|
|
|
+ _self.currentStocks = data.datas;
|
|
|
+ _self.pagination.total = data.total;
|
|
|
+ } else {
|
|
|
+ _self.currentStocks = [];
|
|
|
+ _self.pagination.total = 0;
|
|
|
+ }
|
|
|
} else {
|
|
|
message.warning(data.errorMessage);
|
|
|
+ _self.currentStocks = [];
|
|
|
+ _self.pagination.total = 0;
|
|
|
}
|
|
|
_self.loading = false;
|
|
|
},
|
|
|
@@ -157,23 +215,39 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 删除已选择的盘点清单
|
|
|
+ deleteCountList: function (data) {
|
|
|
+ var _self = this;
|
|
|
+ for (var i = 0; i < _self.selectedRowData.length; i++) {
|
|
|
+ if (_self.selectedRowData[i].id == data) {
|
|
|
+ _self.selectedRowData.splice(i, 1);
|
|
|
+ _self.selectedRowKeys.splice(i, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
generateCheckVouchs() {
|
|
|
const _self = this;
|
|
|
- let information = '';
|
|
|
- if (!_self.formState.inventoryType && _self.formState.inventoryName === '' && _self.formState.inventoryNo === '') {
|
|
|
- information =
|
|
|
- `您确定要将仓库:【${_self.warehouseName}】下所有物料生成盘点明细`;
|
|
|
- } else {
|
|
|
- information = '您确定要根据选择的过滤条件生成对应的盘点明细';
|
|
|
+ if (_self.selectedRowKeys.length === 0) {
|
|
|
+ message.warning('请先选择要生成盘点明细的物料');
|
|
|
+ return;
|
|
|
}
|
|
|
+ // let information = '';
|
|
|
+ // if (!_self.formState.inventoryType && _self.formState.inventoryName === '' && _self.formState.inventoryNo === '') {
|
|
|
+ // information =
|
|
|
+ // `您确定要将仓库:【${_self.warehouseName}】下所有物料生成盘点明细`;
|
|
|
+ // } else {
|
|
|
+ // information = '您确定要根据选择的过滤条件生成对应的盘点明细';
|
|
|
+ // }
|
|
|
Modal.confirm({
|
|
|
title: '确认生成盘点明细',
|
|
|
- content: `${information} 吗?如果"是"的话,请点击"确定"按钮,否则点击"取消"按钮`,
|
|
|
+ content: '如果"是"的话,请点击"确定"按钮,否则点击"取消"按钮',
|
|
|
onOk() {
|
|
|
_self.loading = true;
|
|
|
const obj = {
|
|
|
checkVouchId: _self.checkVouchId,
|
|
|
- inventoryIds: _self.currentStocks.map(item => item.id),
|
|
|
+ inventoryIds: _self.selectedRowKeys,
|
|
|
};
|
|
|
$.ajax({
|
|
|
url: Common.getApiURL(
|
|
|
@@ -188,6 +262,7 @@ export default {
|
|
|
},
|
|
|
success: data => {
|
|
|
if (data.errorCode === 0) {
|
|
|
+ _self.clear();
|
|
|
message.success(data.errorMessage);
|
|
|
} else {
|
|
|
message.warning(data.errorMessage);
|
|
|
@@ -209,7 +284,24 @@ export default {
|
|
|
inventoryNo: '',
|
|
|
inventoryType: undefined,
|
|
|
};
|
|
|
- this.getCurrentStock();
|
|
|
+ this.selectedRowKeys = [];
|
|
|
+ this.selectedRowData = [];
|
|
|
+ this.$refs.tableRef.clear(true);
|
|
|
+ this.searchDatas();
|
|
|
+ },
|
|
|
+ clearFilter() {
|
|
|
+ this.formState = {
|
|
|
+ inventoryName: '',
|
|
|
+ inventoryNo: '',
|
|
|
+ inventoryType: undefined,
|
|
|
+ };
|
|
|
+ this.searchDatas();
|
|
|
+ },
|
|
|
+
|
|
|
+ clearSelected() {
|
|
|
+ this.selectedRowKeys = [];
|
|
|
+ this.selectedRowData = [];
|
|
|
+ this.$refs.tableRef.clear(true);
|
|
|
},
|
|
|
openWindow(item) {
|
|
|
console.log(item);
|
|
|
@@ -268,9 +360,11 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
-:deep(.ant-form-item){
|
|
|
+
|
|
|
+:deep(.ant-form-item) {
|
|
|
margin-bottom: 10px !important;
|
|
|
}
|
|
|
+
|
|
|
:deep(.ant-form-item-label > label) {
|
|
|
font-size: 14px !important;
|
|
|
font-weight: 600 !important;
|