|
|
@@ -9,19 +9,21 @@
|
|
|
:close-on-press-escape="false"
|
|
|
>
|
|
|
<div class="main">
|
|
|
+ <!-- @cell-click="cellClick" -->
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
:columns="columns"
|
|
|
:datasource="datasource"
|
|
|
- @cell-click="cellClick"
|
|
|
+ @select="selectChange"
|
|
|
+ @select-all="changeSelectAll"
|
|
|
cache-key="workOrderTable"
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
- <template v-slot:action="{ row }">
|
|
|
+ <!-- <template v-slot:action="{ row }">
|
|
|
<el-radio class="radio" v-model="currentId" :label="row.id"
|
|
|
><i></i
|
|
|
></el-radio>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<template v-slot:totalCount="{ row }">
|
|
|
{{ row.totalCount }} {{ row.measuringUnit }}
|
|
|
</template>
|
|
|
@@ -67,6 +69,7 @@
|
|
|
sceneState,
|
|
|
dialogVisible: false,
|
|
|
currentRow: {},
|
|
|
+ checkRadioData: [],
|
|
|
currentId: '',
|
|
|
statusOpt: [
|
|
|
{ label: '待处理', value: 0 },
|
|
|
@@ -79,11 +82,17 @@
|
|
|
// 表格列配置
|
|
|
columns() {
|
|
|
return [
|
|
|
+ // {
|
|
|
+ // action: 'action',
|
|
|
+ // slot: 'action',
|
|
|
+ // align: 'center',
|
|
|
+ // label: '选择'
|
|
|
+ // },
|
|
|
{
|
|
|
- action: 'action',
|
|
|
- slot: 'action',
|
|
|
- align: 'center',
|
|
|
- label: '选择'
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
columnKey: 'index',
|
|
|
@@ -154,15 +163,65 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 全选
|
|
|
+ changeSelectAll(arr) {
|
|
|
+ console.log('changeSelectAll---------', arr);
|
|
|
+ let isBoolean = arr.every(
|
|
|
+ (item) => arr[0].sourceType == item.sourceType
|
|
|
+ );
|
|
|
+ if (!isBoolean) {
|
|
|
+ this.checkRadioData = [];
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ return this.$message.error(
|
|
|
+ `所选${
|
|
|
+ this.type == 1 ? '入库' : '出库'
|
|
|
+ }申请单出入库类型不一致,请重新选择`
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (arr.length != 0) {
|
|
|
+ this.checkRadioData = arr;
|
|
|
+ } else {
|
|
|
+ this.checkRadioData = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectChange(arr, row) {
|
|
|
+ console.log('selectChange---------', arr);
|
|
|
+ let isBoolean = arr.every(
|
|
|
+ (item) => arr[0].sourceType == item.sourceType
|
|
|
+ );
|
|
|
+ if (!isBoolean) {
|
|
|
+ this.checkRadioData = [];
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ return this.$message.error(
|
|
|
+ `所选${
|
|
|
+ this.type == 1 ? '入库' : '出库'
|
|
|
+ }申请单出入库类型不一致,请重新选择`
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (arr.length != 0) {
|
|
|
+ this.checkRadioData = arr;
|
|
|
+ } else {
|
|
|
+ this.checkRadioData = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
handleMine() {
|
|
|
- if (!this.currentId) {
|
|
|
- return this.$message.warning(
|
|
|
+ if (this.checkRadioData.length < 1) {
|
|
|
+ return this.$message.error(
|
|
|
`请选择${this.type == 1 ? '入库' : '出库'}申请单`
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+ let isBoolean = this.checkRadioData.every(
|
|
|
+ (item) => this.checkRadioData[0].sourceType == item.sourceType
|
|
|
+ );
|
|
|
+ if (!isBoolean) {
|
|
|
+ return this.$message.error(
|
|
|
+ `所选${
|
|
|
+ this.type == 1 ? '入库' : '出库'
|
|
|
+ }申请单出入库类型不一致,请重新选择`
|
|
|
+ );
|
|
|
+ }
|
|
|
storageApi
|
|
|
- .getApplystoragedetail({ applyId: this.currentId })
|
|
|
+ .getApplystoragedetails(this.checkRadioData.map((item) => item.id))
|
|
|
.then(async (res) => {
|
|
|
if (this.type == 2) {
|
|
|
// 出库
|
|
|
@@ -177,14 +236,20 @@
|
|
|
});
|
|
|
if (data?.length > 0) {
|
|
|
console.log({
|
|
|
- sourceBizNo: this.currentRow.code,
|
|
|
+ sourceBizNo: this.checkRadioData
|
|
|
+ .map((item) => item.code)
|
|
|
+ .join(','),
|
|
|
bizType: this.currentRow.sourceType,
|
|
|
assetType: res[0].rootCategoryLevelId
|
|
|
});
|
|
|
this.$emit('detailData', data, 1, {
|
|
|
- sourceBizNo: this.currentRow.code,
|
|
|
- bizType: this.currentRow.sourceType,
|
|
|
- assetType: res[0].rootCategoryLevelId
|
|
|
+ sourceBizNo: this.checkRadioData
|
|
|
+ .map((item) => item.code)
|
|
|
+ .join(','),
|
|
|
+ bizType: this.checkRadioData[0].sourceType,
|
|
|
+ assetType: Array.from(
|
|
|
+ new Set(res.map((item) => item.rootCategoryLevelId))
|
|
|
+ ).join(',')
|
|
|
});
|
|
|
this.dialogVisible = false;
|
|
|
} else {
|
|
|
@@ -207,9 +272,13 @@
|
|
|
};
|
|
|
});
|
|
|
this.$emit('detailData', data, 1, {
|
|
|
- sourceBizNo: this.currentRow.code,
|
|
|
- bizType: this.currentRow.sourceType,
|
|
|
- assetType: res[0].rootCategoryLevelId
|
|
|
+ sourceBizNo: this.checkRadioData
|
|
|
+ .map((item) => item.code)
|
|
|
+ .join(','),
|
|
|
+ bizType: this.checkRadioData[0].sourceType,
|
|
|
+ assetType: Array.from(
|
|
|
+ new Set(res.map((item) => item.rootCategoryLevelId))
|
|
|
+ ).join(',')
|
|
|
});
|
|
|
this.dialogVisible = false;
|
|
|
}
|