代码提交

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. 73
      src/views/secondOrder/components/categoryDialog.vue
  5. 8
      src/views/secondOrder/components/outDialog.vue

@ -1,6 +1,6 @@
<template>
<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">
<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"

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

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

@ -11,7 +11,7 @@
@refresh-change="refreshChange" @on-load="onLoad" @row-change="handleRowChange">
</avue-crud>
<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>
</div>
</el-dialog>
@ -31,7 +31,7 @@ export default {
default: ''
},
departmentId: {
type: [String, Number],
type: String,
default: ''
},
selectionData: {
@ -174,25 +174,23 @@ export default {
//
updateCurrentPageSelection() {
if (!this.$refs.crud || !this.data) return;
this.isUpdatingSelection = true;
const currentPageData = this.data || [];
const currentPageData = this.data
//
this.$refs.crud.toggleSelection();
// allSelectedList
currentPageData.forEach((item) => {
const isSelected = this.allSelectedList.some(selectedItem =>
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id
);
if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true);
}
});
//
this.$nextTick(() => {
setTimeout(() => {
@ -201,40 +199,19 @@ export default {
});
},
//
selectionChange(selection) {
if (this.isUpdatingSelection) {
return;
}
console.log('当前选择:', selection)
console.log('当前页面数据:', this.data)
console.log('当前全部勾选:', this.allSelectedList)
// ID
const currentPageIds = this.data.map(item => item.id);
const otherPageSelected = this.allSelectedList.filter(item =>
!currentPageIds.includes(item.id)
);
const currentSelected = selection.map(item => ({
console.log(selection,'selection-------')
console.log(this.selectionData, '---selectionData')
const currentPageIds = this.selectionData.map(item => item.id)
let arr = selection.filter(item => !currentPageIds.includes(item.id)) //
const selectionWithTwoInventoryId = arr.map(item => ({
...item,
twoInventoryId: item.id
}));
//
const combinedSelection = [
...otherPageSelected, //
...currentSelected //
];
// allSelectedList
this.allSelectedList = this.uniqueById(combinedSelection)
console.log('更新后的allSelectedList:', this.allSelectedList)
}))
this.allSelectedList.push(...selectionWithTwoInventoryId);
this.allSelectedList = this.uniqueById(this.allSelectedList);
},
//
uniqueById(arr) {
const uniqueObj = {};
@ -245,24 +222,24 @@ export default {
});
return Object.values(uniqueObj);
},
//
handleConfirm() {
const uniqueList = this.uniqueById(this.allSelectedList)
this.$emit("confirm", uniqueList)
},
handleCloseDetail() {
this.$emit('handleCloseDetail')
},
selectionClear() {
this.allSelectedList = []
if (this.$refs.crud) {
this.$refs.crud.toggleSelection()
}
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page, this.query)
@ -272,16 +249,16 @@ export default {
this.page.pageSize = pageSize;
this.onLoad(this.page, this.query)
},
refreshChange() {
this.onLoad(this.page, this.query)
},
handleTabClick() {
this.page.currentPage = 1
this.onLoad(this.page)
},
onLoad(page, params = {}) {
this.loading = true
const requestParams = Object.assign({}, params, this.query, {
@ -294,7 +271,7 @@ export default {
apiPromise.then((res) => {
this.data = res.data.result.list
this.page.total = res.data.result.total
//
this.$nextTick(() => {
this.updateCurrentPageSelection()
@ -305,7 +282,7 @@ export default {
this.loading = false;
})
},
handleCancel() {
this.categoryVisible = false
}

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

Loading…
Cancel
Save