代码提交

master
taozi 3 months ago
parent 8dcbdca13c
commit 3dc2d1a0dc
  1. 13
      src/api/firstOrder/outbound.js
  2. 4
      src/views/firstOrder/components/batchSelectionDialog.vue
  3. 200
      src/views/firstOrder/components/consumableDialog.vue
  4. 124
      src/views/firstOrder/components/needDialog.vue
  5. 26
      src/views/firstOrder/components/outDialog.vue
  6. 3
      src/views/firstOrder/inbound.vue
  7. 21
      src/views/firstOrder/outbound.vue
  8. 5
      src/views/materials/index.vue
  9. 11
      src/views/secondOrder/components/outDialog.vue

@ -85,4 +85,17 @@ export const editList = (oneOutStorageId) => {
cryptoToken: false, cryptoToken: false,
cryptoData: false cryptoData: false
}) })
}
export const getPutPurchaseList = (current, size, params) => {
return request({
url: '/smartpark/oneOutStorageDetail/getOneOutStorageDetailList',
method: 'get',
params: {
...params,
pageSize: size,
pageNum: current,
},
cryptoToken: false,
cryptoData: false
})
} }

@ -38,8 +38,8 @@
<el-table-column label="物料名称" prop="materialName" /> <el-table-column label="物料名称" prop="materialName" />
<el-table-column label="规格型号" prop="model" /> <el-table-column label="规格型号" prop="model" />
<el-table-column label="申请数量" prop="applicationQuantity" /> <el-table-column label="申请数量" prop="applicationQuantity" />
<el-table-column label="本此出库数量" prop="applicationQuantity" />
<el-table-column label="已出库数量" prop="outboundQuantity" /> <!-- <el-table-column label="已出库数量" prop="outboundQuantity" /> -->
<el-table-column label="部门" prop="departmentName" /> <el-table-column label="部门" prop="departmentName" />
<el-table-column label="单位" prop="unit" /> <el-table-column label="单位" prop="unit" />
</el-table> </el-table>

@ -35,7 +35,7 @@ export default {
query: { type: "NY" }, query: { type: "NY" },
loading: true, loading: true,
page: { page: {
pageSize: 5, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
@ -152,6 +152,7 @@ export default {
rkTable: [], rkTable: [],
currentRow: null, currentRow: null,
allSelectedList: [], // allSelectedList: [], //
isUpdatingSelection: false, // data
} }
}, },
computed: { computed: {
@ -194,8 +195,8 @@ export default {
handleTabClick() { handleTabClick() {
this.loadTransactionData(); this.loadTransactionData();
}, },
async loadTransactionData() { async loadTransactionData() {
if (!this.currentRow) return; if (!this.currentRow) return;
const params = { const params = {
@ -223,142 +224,155 @@ export default {
this.loading = false; this.loading = false;
} }
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.page.currentPage = 1; this.page.currentPage = 1;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done(); done();
}, },
// //
selectionChange(list) { selectionChange(selection) {
console.log("勾选选中", list) //
const currentPageIds = this.data.map(item => item.id) if (this.isUpdatingSelection) {
console.log(currentPageIds, "currentPageIds") return;
this.allSelectedList = this.allSelectedList.filter(item => !currentPageIds.includes(item.id)) }
console.log(this.allSelectedList, '1')
this.allSelectedList.push(...list) console.log("勾选选中", selection);
console.log('所有勾选数据:', this.allSelectedList) const currentPageIds = this.data.map(item => item.id);
console.log(currentPageIds, "currentPageIds");
// allSelectedListselection
this.allSelectedList = this.allSelectedList.filter(item =>
!currentPageIds.includes(item.id)
);
console.log(this.allSelectedList, '1');
// allSelectedList
this.allSelectedList.push(...selection);
console.log('所有勾选数据:', this.allSelectedList);
}, },
// //
handleConfirm() { handleConfirm() {
console.log(6) console.log(6);
console.log(this.allSelectedList, 'chuan') console.log(this.allSelectedList, 'chuan');
this.$emit("confirm", this.allSelectedList) this.$emit("confirm", this.allSelectedList);
}, },
selectionClear() { selectionClear() {
this.selectionList = []; this.allSelectedList = []; //
this.$refs.crud.toggleSelection(); if (this.$refs.crud) {
this.$refs.crud.toggleSelection(); //
}
}, },
handleRowChange(row, index, data) { handleRowChange(row, index, data) {
// // onLoad
//
this.$nextTick(() => { this.$nextTick(() => {
const currentPageData = this.data //
console.log(this.data,0) this.isUpdatingSelection = true;
this.$refs.crud.toggleAllSelection(false);
const currentPageData = this.data || [];
//
this.$refs.crud.toggleSelection();
// allSelectedList
currentPageData.forEach((item) => { currentPageData.forEach((item) => {
// 0 const isSelected = this.allSelectedList.some(selectedItem =>
const isSelected = this.allSelectedList.some(selectedItem => selectedItem.id === item.id
selectedItem.id === item.id && !(item.num === 0 || item.num === null || item.num === undefined || item.num === '')
); );
//
if (isSelected) { if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true); this.$refs.crud.toggleRowSelection(item, true);
} }
}); });
//
setTimeout(() => {
this.isUpdatingSelection = false;
}, 100);
}); });
}, },
// handleRowChange(row, index, data) {
// //
// this.$nextTick(() => {
// //
// const currentPageData = this.data || [];
// //
// this.$refs.crud.toggleAllSelection(false);
// // allSelectedList
// currentPageData.forEach((item, index) => {
// const isSelected = this.allSelectedList.some(selectedItem =>
// selectedItem.id === item.id
// );
// //
// if (isSelected) {
// this.$refs.crud.toggleRowSelection(item, true);
// }
// });
// });
// },
// currentChange(currentPage) {
// console.log(currentPage, 1);
// this.page.currentPage = currentPage;
// // onLoad handleRowChange
// this.onLoad(this.page, this.query);
// },
// onLoad(page, params = {}) {
// this.loading = true;
// console.log(this.query, 2);
// getList(
// page.currentPage,
// page.pageSize,
// Object.assign(params, this.query)
// ).then((res) => {
// this.data = res.data.result.list;
// this.loading = false;
// this.page.total = res.data.result.total;
// //
// this.$nextTick(() => {
// this.updateCurrentPageSelection();
// });
// });
// this.loading = false;
// },
// //
// updateCurrentPageSelection() {
// if (!this.$refs.crud) return;
// const currentPageData = this.data || [];
// currentPageData.forEach((item) => {
// const isSelected = this.allSelectedList.some(selectedItem =>
// selectedItem.id === item.id
// );
// if (isSelected) {
// this.$refs.crud.toggleRowSelection(item, true);
// }
// });
// },
currentChange(currentPage) { currentChange(currentPage) {
console.log(currentPage, 1) console.log(currentPage, 1);
this.handleRowChange()
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
// onLoad
this.onLoad(this.page, this.query);
}, },
sizeChange(pageSize) { sizeChange(pageSize) {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
this.onLoad(this.page, this.query);
}, },
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
console.log(this.query, 2) console.log(this.query, 2);
getList( getList(
page.currentPage, page.currentPage,
page.pageSize, page.pageSize,
Object.assign(params, this.query) Object.assign(params, this.query)
).then((res) => { ).then((res) => {
this.data = res.data.result.list this.data = res.data.result.list;
this.loading = false; this.loading = false;
this.page.total = res.data.result.total; this.page.total = res.data.result.total;
})
this.loading = false; //
this.$nextTick(() => {
this.updateCurrentPageSelection();
});
}).catch(error => {
this.loading = false;
this.$message.error('加载数据失败: ' + error.message);
});
}, },
//
updateCurrentPageSelection() {
if (!this.$refs.crud) return;
//
this.isUpdatingSelection = true;
const currentPageData = this.data || [];
//
this.$refs.crud.toggleSelection();
currentPageData.forEach((item) => {
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id
);
if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true);
}
});
//
this.$nextTick(() => {
setTimeout(() => {
this.isUpdatingSelection = false;
}, 100);
});
},
handleCancel() {
this.$emit('handleCloseDetail');
}
}, },
} }
</script> </script>
@ -375,4 +389,4 @@ export default {
padding-right: 10px; padding-right: 10px;
overflow-x: hidden; overflow-x: hidden;
} }
</style> </style>

@ -1,59 +1,91 @@
<template> <template>
<el-dialog :title="purchaseTitle" append-to-body :visible.sync="openShow" width="70%" @close="closeDialog"> <el-dialog :title="purchaseTitle" append-to-body :visible.sync="openShow" width="70%" @close="closeDialog">
<avue-crud :data="data" :option="option"></avue-crud> <avue-crud :data="data" :option="option" @current-change="currentChange" @size-change="sizeChange"
<!-- <template #footer> @refresh-change="refreshChange" :page.sync="page" @on-load="onLoad"></avue-crud>
<span class="dialog-footer"> </el-dialog>
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template> -->
</el-dialog>
</template> </template>
<script> <script>
import { getPutPurchaseList } from "@/api/firstOrder/outbound";
export default { export default {
props: { props: {
showDialog: { showDialog: {
type: Boolean, type: Boolean,
default: false default: false
},
purchaseTitle:{
type:String,
default:''
}
}, },
data() { purchaseTitle: {
return { type: String,
openShow:false, default: ''
option:{
menu:false,
header:false,
align: 'center',
column:[
{
label:'物品名称',
prop:'wupinmingcheng'
}, {
label:'需求数量',
prop:'caigoushuliang'
},{
label:'已出库数量',
prop:'yirukushuliang'
}
]
}
}
}, },
mounted(){ id: {
this.openShow = this.showDialog type: Number,
default: 0
}
},
data() {
return {
openShow: false,
data: [],
query: {},
loading: false,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
menu: false,
header: false,
align: 'center',
// page: true,
column: [
{
label: '物资名称',
prop: 'materialName'
}, {
label: '计划需求数量',
prop: 'requiredQuantity'
}, {
label: '已出库数量',
prop: 'outboundQuantity'
}
]
}
}
},
mounted() {
this.openShow = this.showDialog
},
methods: {
closeDialog() {
this.openShow = false
this.$emit('closeDialog');
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
}, },
methods:{ onLoad(page, params = {}) {
closeDialog(){ this.loading = true;
this.openShow = false const queryParams = Object.assign(params, this.query, {
this.$emit('closeDialog'); onePutStorageId: this.id
} });
getPutPurchaseList(page.currentPage, page.pageSize, queryParams).then(res => {
console.log('采购单列表', res.data.result)
// const data = res.data.data;
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
} }
}
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

@ -88,7 +88,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="unit" label="单位"> <el-table-column prop="unit" label="单位">
</el-table-column> </el-table-column>
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 && sizeForm.optionType" <el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 || sizeForm.optionType"
:key="'account-dept-' + sizeForm.options"> :key="'account-dept-' + sizeForm.options">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;" <el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
@ -97,7 +97,7 @@
:value="item.departmentId"> :value="item.departmentId">
</el-option> </el-option>
</el-select> </el-select>
<span v-else> {{ scope.row.departmentName }}</span> <span v-else> {{ scope.row.departmentName || ''}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options"> <!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options">
@ -112,12 +112,16 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1"> <el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.applicationQuantity || 0 }}
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1 ">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }} {{ scope.row.outboundQuantity || 0 }}
</template> </template>
</el-table-column> --> </el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量"> <el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%;" <el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%;"
@ -774,7 +778,7 @@ export default {
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo
this.sizeForm.outDate = ldOneOutStorage.outDate this.sizeForm.outDate = ldOneOutStorage.outDate
this.sizeForm.options = Number(ldOneOutStorage.options) this.sizeForm.options = Number(ldOneOutStorage.options)
// this.sizeForm.optionType = ldOneOutStorage.optionType
// reason: '',// // reason: '',//
// inAccountsTableData: [],// // inAccountsTableData: [],//
// inTableData: [], // inTableData: [],
@ -862,11 +866,13 @@ export default {
} }
}, },
'sizeForm.optionType': function (newVal) { 'sizeForm.optionType': function (newVal) {
if (newVal) { if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
// this.getMaterialList() this.getMaterialList()
} } else if (newVal && this.outDialogType !== 'add') {
}, this.getMaterialList()
}
},
} }
} }
</script> </script>

@ -17,7 +17,7 @@
@on-load="onLoad" @on-load="onLoad"
> >
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button size="small" type="primary" @click="handleDesign()" <el-button size="small" type="primary" @click="handleDesign()"
>新增入库单 >新增入库单
</el-button> </el-button>
</template> </template>
@ -279,6 +279,7 @@ export default {
}, },
// //
purchaseFn(row) { purchaseFn(row) {
console.log(122)
this.purchaseOpen = true; this.purchaseOpen = true;
this.purchaseTitle = row.purchaseEndInfo + "采购单详情"; this.purchaseTitle = row.purchaseEndInfo + "采购单详情";
this.id = row.id; this.id = row.id;

@ -11,10 +11,20 @@
<!-- <el-button size="small" plain @click="handleExport()">出库单导出 <!-- <el-button size="small" plain @click="handleExport()">出库单导出
</el-button> --> </el-button> -->
</template> </template>
<template slot-scope="scope" slot="purchaseEndInfo"> <!-- <template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.purchaseEndInfo != '无'">{{ <el-button type="text" @click.stop="purchaseFn(scope.row)"
scope.row.purchaseEndInfo }}</el-button> v-if="scope.row.purchaseEndInfo != '无'">
<span>{{ scope.row.purchaseEndInfo || '无' }}</span> {{scope.row.purchaseEndInfo }}</el-button>
<span>{{ scope.row.purchaseEndInfo || '无' }}</span>
</template> -->
<template slot-scope="scope" slot="demandEndInfo">
<el-button
type="text"
@click.stop="purchaseFn(scope.row)"
v-if="scope.row.demandEndInfo && scope.row.demandEndInfo !== ''"
>{{ scope.row.demandEndInfo }}</el-button
>
<span v-else></span>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button> <el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
@ -226,8 +236,9 @@ export default {
}, },
// //
purchaseFn(row) { purchaseFn(row) {
console.log('xuqiudanchuku')
this.purchaseOpen = true this.purchaseOpen = true
this.purchaseTitle = row.purchaseEndInfo + '需求单详情' this.purchaseTitle = row.demandEndInfo + '需求单详情'
this.id = row.id this.id = row.id
}, },
closeDialog() { closeDialog() {

@ -64,12 +64,13 @@ export default {
align: "center", align: "center",
}, },
{ {
label: "类别", label: "物资编码",
prop: "materialCode", prop: "materialCode",
type: "select", type: "select",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
dicData: [], dicData: [
],
props: { props: {
label: "label", label: "label",
value: "value", value: "value",

@ -124,9 +124,9 @@
border border
style="width: 100%" style="width: 100%"
> >
<el-table-column prop="materialCode" label="物资编码" width="100"> <el-table-column prop="materialCode" label="物资编码" >
</el-table-column> </el-table-column>
<el-table-column prop="str2" label="物资名称" width="140"> <el-table-column prop="str2" label="物资名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select
v-model="scope.row.materialitem" v-model="scope.row.materialitem"
@ -150,7 +150,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="model" label="规格/型号"> </el-table-column> <el-table-column prop="model" label="规格/型号"> </el-table-column>
<el-table-column prop="type" label="类别"> </el-table-column> <!-- <el-table-column prop="type" label="类别"> </el-table-column> -->
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"> </el-table-column> <el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column prop="num" label="数量"> <el-table-column prop="num" label="数量">
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save