代码提交

master
taozi 3 months ago
parent 8b36334de6
commit 70456fc7c6
  1. 2
      src/views/firstOrder/components/consumableDialog.vue
  2. 1
      src/views/firstOrder/components/inDialog.vue
  3. 11
      src/views/firstOrder/components/outDialog.vue
  4. 49
      src/views/secondOrder/components/categoryDialog.vue
  5. 8
      src/views/secondOrder/components/outDialog.vue

@ -1,6 +1,6 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible" <el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen> :append-to-body="true" width="70%" @close="handleCancel" fullscreen>
<basic-container class="dialog-content"> <basic-container class="dialog-content">
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
:page.sync="page" :permission="permissionList" @row-del="rowDel" @search-change="searchChange" :page.sync="page" :permission="permissionList" @row-del="rowDel" @search-change="searchChange"

@ -616,7 +616,6 @@ export default {
ldOnePutStorageDetailVOList: [], // ldOnePutStorageDetailVOList: [], //
}, },
inTableData: [], inTableData: [],
inBatchDialogVisible: false, // inBatchDialogVisible: false, //
batchType: "", // batchType: "", //
materialsType: "", materialsType: "",

@ -428,7 +428,7 @@
v-if="consumableVisible" v-if="consumableVisible"
:consumableVisible="consumableVisible" :consumableVisible="consumableVisible"
:demandDialogTitle="demandDialogTitle" :demandDialogTitle="demandDialogTitle"
@handleCloseDetail="handleCloseDetail" @handleCloseDetail="closeDialog"
@confirm="confirm" @confirm="confirm"
> >
</consumableDialog> </consumableDialog>
@ -693,9 +693,12 @@ export default {
// //
handleCloseDetail() { handleCloseDetail() {
this.outDialogVisible = false; this.outDialogVisible = false;
this.consumableVisible = false;
this.$emit("handleCloseDetail"); this.$emit("handleCloseDetail");
}, },
closeDialog() {
this.consumableVisible = false;
},
// //
async getQuarterList() { async getQuarterList() {
try { try {
@ -834,8 +837,8 @@ export default {
getDepartmentName(departmentId) { getDepartmentName(departmentId) {
const department = this.list.find( const department = this.list.find(
(item) => item.departmentId === departmentId (item) => item.departmentId === departmentId
); )
return department ? department.department : ""; return department ? department.department : ""
}, },
// //
async getMaterialList() { async getMaterialList() {

@ -11,7 +11,7 @@
@refresh-change="refreshChange" @on-load="onLoad" @row-change="handleRowChange"> @refresh-change="refreshChange" @on-load="onLoad" @row-change="handleRowChange">
</avue-crud> </avue-crud>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCloseDetail">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -31,7 +31,7 @@ export default {
default: '' default: ''
}, },
departmentId: { departmentId: {
type: [String, Number], type: String,
default: '' default: ''
}, },
selectionData: { selectionData: {
@ -174,11 +174,8 @@ export default {
// //
updateCurrentPageSelection() { updateCurrentPageSelection() {
if (!this.$refs.crud || !this.data) return; if (!this.$refs.crud || !this.data) return;
this.isUpdatingSelection = true; this.isUpdatingSelection = true;
const currentPageData = this.data
const currentPageData = this.data || [];
// //
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
@ -191,6 +188,7 @@ export default {
if (isSelected) { if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true); this.$refs.crud.toggleRowSelection(item, true);
} }
}); });
// //
@ -201,40 +199,19 @@ export default {
}); });
}, },
//
selectionChange(selection) {
if (this.isUpdatingSelection) {
return;
}
console.log('当前选择:', selection)
console.log('当前页面数据:', this.data)
console.log('当前全部勾选:', this.allSelectedList)
// ID selectionChange(selection) {
const currentPageIds = this.data.map(item => item.id); console.log(selection,'selection-------')
console.log(this.selectionData, '---selectionData')
const otherPageSelected = this.allSelectedList.filter(item => const currentPageIds = this.selectionData.map(item => item.id)
!currentPageIds.includes(item.id) let arr = selection.filter(item => !currentPageIds.includes(item.id)) //
); const selectionWithTwoInventoryId = arr.map(item => ({
const currentSelected = selection.map(item => ({
...item, ...item,
twoInventoryId: item.id twoInventoryId: item.id
})); }))
this.allSelectedList.push(...selectionWithTwoInventoryId);
// this.allSelectedList = this.uniqueById(this.allSelectedList);
const combinedSelection = [
...otherPageSelected, //
...currentSelected //
];
// allSelectedList
this.allSelectedList = this.uniqueById(combinedSelection)
console.log('更新后的allSelectedList:', this.allSelectedList)
}, },
// //
uniqueById(arr) { uniqueById(arr) {
const uniqueObj = {}; const uniqueObj = {};

@ -137,7 +137,7 @@
</el-dialog> </el-dialog>
<categoryDialog v-if="categoryVisible" :categoryVisible='categoryVisible' :selectionData="selectionData" <categoryDialog v-if="categoryVisible" :categoryVisible='categoryVisible' :selectionData="selectionData"
:departmentId="sizeForm.ldTwoOutStorage.departmentId" :categoryDialogTitle="categoryDialogTitle" :departmentId="sizeForm.ldTwoOutStorage.departmentId" :categoryDialogTitle="categoryDialogTitle"
@confirm="confirm" @handleCloseDetail="handleCloseDetail"></categoryDialog> @confirm="confirm" @handleCloseDetail="closeDialog"></categoryDialog>
</div> </div>
</template> </template>
<script> <script>
@ -403,9 +403,13 @@ export default {
}, },
handleCloseDetail() { handleCloseDetail() {
this.outDialogVisible = false; this.outDialogVisible = false;
this.categoryVisible = false
this.$emit("handleCloseDetail"); this.$emit("handleCloseDetail");
}, },
//
closeDialog() {
this.categoryVisible = false
},
inInit() { inInit() {
if (this.outDialogType != "add") { if (this.outDialogType != "add") {
getDetails({ twoOutStorageId: this.rowData.id }).then((res) => { getDetails({ twoOutStorageId: this.rowData.id }).then((res) => {

Loading…
Cancel
Save