代码提交

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> <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,25 +174,23 @@ 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();
// allSelectedList // allSelectedList
currentPageData.forEach((item) => { currentPageData.forEach((item) => {
const isSelected = this.allSelectedList.some(selectedItem => const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id selectedItem.id === item.id
); );
if (isSelected) { if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true); this.$refs.crud.toggleRowSelection(item, true);
} }
}); });
// //
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
@ -201,40 +199,19 @@ export default {
}); });
}, },
//
selectionChange(selection) { selectionChange(selection) {
if (this.isUpdatingSelection) { console.log(selection,'selection-------')
return; console.log(this.selectionData, '---selectionData')
} const currentPageIds = this.selectionData.map(item => item.id)
let arr = selection.filter(item => !currentPageIds.includes(item.id)) //
console.log('当前选择:', selection) const selectionWithTwoInventoryId = arr.map(item => ({
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 => ({
...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 = {};
@ -245,24 +222,24 @@ export default {
}); });
return Object.values(uniqueObj); return Object.values(uniqueObj);
}, },
// //
handleConfirm() { handleConfirm() {
const uniqueList = this.uniqueById(this.allSelectedList) const uniqueList = this.uniqueById(this.allSelectedList)
this.$emit("confirm", uniqueList) this.$emit("confirm", uniqueList)
}, },
handleCloseDetail() { handleCloseDetail() {
this.$emit('handleCloseDetail') this.$emit('handleCloseDetail')
}, },
selectionClear() { selectionClear() {
this.allSelectedList = [] this.allSelectedList = []
if (this.$refs.crud) { if (this.$refs.crud) {
this.$refs.crud.toggleSelection() this.$refs.crud.toggleSelection()
} }
}, },
currentChange(currentPage) { currentChange(currentPage) {
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
@ -272,16 +249,16 @@ export default {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
}, },
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
}, },
handleTabClick() { handleTabClick() {
this.page.currentPage = 1 this.page.currentPage = 1
this.onLoad(this.page) this.onLoad(this.page)
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true this.loading = true
const requestParams = Object.assign({}, params, this.query, { const requestParams = Object.assign({}, params, this.query, {
@ -294,7 +271,7 @@ export default {
apiPromise.then((res) => { apiPromise.then((res) => {
this.data = res.data.result.list this.data = res.data.result.list
this.page.total = res.data.result.total this.page.total = res.data.result.total
// //
this.$nextTick(() => { this.$nextTick(() => {
this.updateCurrentPageSelection() this.updateCurrentPageSelection()
@ -305,7 +282,7 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
handleCancel() { handleCancel() {
this.categoryVisible = false this.categoryVisible = false
} }

@ -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