一级库出库调整

master
taozi 3 months ago
parent 44c02725fe
commit e637c7f1cb
  1. 6
      src/views/firstOrder/components/batchSelectionDialog.vue
  2. 106
      src/views/firstOrder/components/consumableDialog.vue
  3. 196
      src/views/firstOrder/components/outDialog.vue
  4. 30
      src/views/materials/expend.vue
  5. 7
      src/views/secondOrder/inbound.vue
  6. 24
      src/views/secondOrder/list.vue

@ -43,7 +43,7 @@
<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>
<div style="text-align: right; margin-top: 20px"> <div style="text-align: right; margin-top: 20px">
<el-button @click="handleConfirmSelect">确认选择</el-button> <el-button @click="handleConfirmSelect">确认选择</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -107,7 +107,7 @@ export default {
// //
handleSelectionChange(selection, parentRow) { handleSelectionChange(selection, parentRow) {
console.log('666666',selection, parentRow) console.log('666666',selection, parentRow)
// //
const selectionWithParent = selection.map(item => ({ const selectionWithParent = selection.map(item => ({
...item, ...item,
parentMaterialId: parentRow.materialId, // ID parentMaterialId: parentRow.materialId, // ID
@ -148,9 +148,7 @@ export default {
// this.$emit('handleCloseDetail') // this.$emit('handleCloseDetail')
this.$emit('selectionChange', this.selectedRows); this.$emit('selectionChange', this.selectedRows);
}, },
}, },
mounted() { mounted() {

@ -50,7 +50,7 @@ export default {
selection: true, selection: true,
viewBtn: true, viewBtn: true,
dialogClickModal: false, dialogClickModal: false,
menu: true, menu: false,
printBtn: false, printBtn: false,
refreshBtn: false, refreshBtn: false,
gridBtn: false, gridBtn: false,
@ -61,6 +61,7 @@ export default {
menuAlign: "left", menuAlign: "left",
searchMenuPosition: "right", searchMenuPosition: "right",
menuWidth: 80, menuWidth: 80,
selectable: (row, index) => row.num !== 0,
column: [ column: [
{ {
label: "存货编号", label: "存货编号",
@ -84,7 +85,7 @@ export default {
{ {
label: "类别", label: "类别",
prop: "type", prop: "type",
search: true, search: false,
type: "select", type: "select",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -112,6 +113,9 @@ export default {
prop: "num", prop: "num",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
// selectDisabled: (row) => {
// return row.num === 0 || row.num === null || row.num === undefined;
// },
}, },
{ {
label: "单价", label: "单价",
@ -119,12 +123,12 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{ // {
label: "金额", // label: "",
prop: "amount", // prop: "amount",
headerAlign: "center", // headerAlign: "center",
align: "center", // align: "center",
}, // },
{ {
label: "描述", label: "描述",
prop: "remark", prop: "remark",
@ -250,11 +254,85 @@ export default {
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}, },
handleRowChange(row, index, data) { handleRowChange(row, index, data) {
console.log('Selected data:', data); //
console.log('select row', row) this.$nextTick(() => {
// const currentPageData = this.data
console.log(this.data,0)
this.$refs.crud.toggleAllSelection(false);
currentPageData.forEach((item) => {
// 0
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id && !(item.num === 0 || item.num === null || item.num === undefined || item.num === '')
);
if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true);
}
});
});
}, },
// 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.handleRowChange()
@ -273,7 +351,7 @@ export default {
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;
@ -283,8 +361,6 @@ export default {
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep.el-dialog__footer { ::v-deep.el-dialog__footer {

@ -36,7 +36,7 @@
<el-form-item label="选项"> <el-form-item label="选项">
<el-radio-group v-model="sizeForm.options" @change="radioChange()" <el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'"> :disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2"><span >批量选择</span></el-radio> <el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</span></el-radio>
<el-radio :label="2">单项选择</el-radio> <el-radio :label="2">单项选择</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -92,7 +92,7 @@
: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%;"
v-if='inDialogType != "details"'> v-if='outDialogType != "details"'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department" <el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId"> :value="item.departmentId">
</el-option> </el-option>
@ -100,6 +100,17 @@
<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">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='outDialogType != "details" && sizeForm.options === 2 && sizeForm.optionType'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else>{{ scope.row.departmentName }}</span>
</template>
</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">
</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">
@ -111,7 +122,7 @@
<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%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'" @change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"
v-if="sizeForm.optionType === 'YH' ||inBatchForm.optionType === 'YH'"></el-input-number> v-if="sizeForm.optionType === 'YH' || inBatchForm.optionType === 'YH'"></el-input-number>
<span v-else>{{ scope.row.theOutboundQuantity = 1 }}</span> <span v-else>{{ scope.row.theOutboundQuantity = 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -219,9 +230,11 @@
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible' <consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible'
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="handleCloseDetail" @confirm="confirm"> :demandDialogTitle="demandDialogTitle" @handleCloseDetail="handleCloseDetail" @confirm="confirm">
</consumableDialog> </consumableDialog>
<!-- 批量耐用品弹窗 -->
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible='batchSelectionVisible' <batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible='batchSelectionVisible'
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" :batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" @batchclose="batchclose"
@batchclose="batchclose" :inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange"></batchSelectionDialog> :inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange">
</batchSelectionDialog>
</div> </div>
</template> </template>
@ -319,7 +332,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.outDialogVisible = this.repairVisible this.outDialogVisible = this.repairVisible
if (this.outDialogType == 'add') { if (this.outDialogType == 'add') {
this.addInit() this.addInit()
@ -333,9 +346,9 @@ export default {
batchclose() { batchclose() {
this.batchSelectionVisible = false this.batchSelectionVisible = false
}, },
selectionChange(row){ selectionChange(row) {
this.batchSelectionVisible = false this.batchSelectionVisible = false
this.sizeForm.inTableData=row this.sizeForm.inTableData = row
}, },
confirm(allSelectedList) { confirm(allSelectedList) {
this.consumableVisible = false this.consumableVisible = false
@ -552,79 +565,79 @@ export default {
// } // }
// }, // },
async batchSubmit() { async batchSubmit() {
if (!this.inBatchForm.batchType) { if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单'); this.$message.error('请选择需求单');
return; return;
} }
if (!this.inBatchForm.department) { if (!this.inBatchForm.department) {
this.$message.error('请选择部门'); this.$message.error('请选择部门');
return; return;
} }
if (!this.inBatchForm.optionType) { if (!this.inBatchForm.optionType) {
this.$message.error('请选择类别'); this.$message.error('请选择类别');
return; return;
} }
const requestParams = { const requestParams = {
ids: this.inBatchForm.batchType, ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department, departmentId: this.inBatchForm.department,
optionType: this.inBatchForm.optionType, optionType: this.inBatchForm.optionType,
}; };
try { try {
let res; let res;
if (this.inBatchForm.optionType === 'YH') { if (this.inBatchForm.optionType === 'YH') {
res = await getDetailedList(requestParams); res = await getDetailedList(requestParams);
} else if (this.inBatchForm.optionType === 'NY') { } else if (this.inBatchForm.optionType === 'NY') {
res = await batchList(requestParams); res = await batchList(requestParams);
} }
if (res.data && res.data.result) { if (res.data && res.data.result) {
this.sizeForm.inTableData = res.data.result; this.sizeForm.inTableData = res.data.result;
const selectedDept = this.departmentList.find( const selectedDept = this.departmentList.find(
dept => dept.departmentId === this.inBatchForm.department dept => dept.departmentId === this.inBatchForm.department
); );
const deptName = selectedDept ? selectedDept.department : ''; const deptName = selectedDept ? selectedDept.department : '';
this.sizeForm.inTableData = res.data.result.map(item => ({
...item,
IdDemandEndld: this.inBatchForm.batchType,
department: deptName
}));
//
this.inBatchDialogVisible = false;
//
const selectedQuarter = this.quarterList.find(
item => item.ids === this.inBatchForm.batchType
);
if (selectedQuarter) {
this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
}
// this.sizeForm.inTableData = res.data.result.map(item => ({
if (this.inBatchForm.optionType === 'NY') { ...item,
console.log(this.inBatchForm.optionType, 'this.inBatchForm.optionType') IdDemandEndld: this.inBatchForm.batchType,
this.batchSelectionVisible = true; department: deptName
this.dialogVisible = true; }));
console.log(1)
this.batchTableData = res.data.result;
}
// //
this.$nextTick(() => { this.inBatchDialogVisible = false;
this.$forceUpdate();
}); //
} else { const selectedQuarter = this.quarterList.find(
this.$message.warning('未获取到详细数据'); item => item.ids === this.inBatchForm.batchType
} );
} catch (error) { if (selectedQuarter) {
this.$message.error(`获取${this.inBatchForm.optionType === 'YH' ? '易耗品' : '耐用品'}数据失败:${error.message}`); this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
console.error('批量提交接口调用失败:', error); }
}
}, //
if (this.inBatchForm.optionType === 'NY') {
console.log(this.inBatchForm.optionType, 'this.inBatchForm.optionType')
this.batchSelectionVisible = true;
this.dialogVisible = true;
console.log(1)
this.batchTableData = res.data.result;
}
//
this.$nextTick(() => {
this.$forceUpdate();
});
} else {
this.$message.warning('未获取到详细数据');
}
} catch (error) {
this.$message.error(`获取${this.inBatchForm.optionType === 'YH' ? '易耗品' : '耐用品'}数据失败:${error.message}`);
console.error('批量提交接口调用失败:', error);
}
},
// //
goodsListSelectionChange(val) { goodsListSelectionChange(val) {
this.goodsSelectList = val this.goodsSelectList = val
@ -754,7 +767,6 @@ async batchSubmit() {
editList(this.id).then(res => { editList(this.id).then(res => {
console.log(res.data.result, '详情数据') console.log(res.data.result, '详情数据')
const { ldOneOutStorage, ldOneOutStorageDetails } = res.data.result || {}; const { ldOneOutStorage, ldOneOutStorageDetails } = res.data.result || {};
// this.sizeForm = res.data.result.ldOneOutStorage // this.sizeForm = res.data.result.ldOneOutStorage
this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails
this.sizeForm.orderNo = ldOneOutStorage.orderNo this.sizeForm.orderNo = ldOneOutStorage.orderNo
@ -763,21 +775,19 @@ async batchSubmit() {
this.sizeForm.outDate = ldOneOutStorage.outDate this.sizeForm.outDate = ldOneOutStorage.outDate
this.sizeForm.options = Number(ldOneOutStorage.options) this.sizeForm.options = Number(ldOneOutStorage.options)
// reason: '',// // reason: '',//
// inAccountsTableData: [],// // inAccountsTableData: [],//
// inTableData: [], // inTableData: [],
// ldOneOutStorageDetailVOList: [], // ldOneOutStorageDetailVOList: [],
// demandEndInfo: '',// // demandEndInfo: '',//
// outDate: '',// // outDate: '',//
// options: 2,// // options: 2,//
// optionType: '', // 1 2 // optionType: '', // 1 2
// materialType: '1',// // materialType: '1',//
// status: '',//1 2 // status: '',//1 2
// materialld: '',//Id // materialld: '',//Id
this.$set(this.sizeForm,'inTableData',res.data.result.ldOneOutStorageDetails) this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails)
console.log(this.sizeForm, '111') console.log(this.sizeForm, '111')
}) })
} }
}, },
@ -822,7 +832,7 @@ async batchSubmit() {
this.getQuarterList() this.getQuarterList()
this.inBatchDialogVisible = true this.inBatchDialogVisible = true
this.inBatchForm.batchType = '', this.inBatchForm.batchType = '',
this.inBatchForm.department = '' this.inBatchForm.department = ''
this.inBatchForm.optionType = '' this.inBatchForm.optionType = ''
} }
}, },
@ -833,7 +843,7 @@ async batchSubmit() {
// this.sizeForm.inTableData = [] // this.sizeForm.inTableData = []
// this.getQuarterList() // this.getQuarterList()
// this.inBatchDialogVisible = true // this.inBatchDialogVisible = true
// // this.sizeForm.inTableData = [] // // this.sizeForm.inTableData = []
// }, // },
// //

@ -156,11 +156,11 @@ export default {
dicDta: [ dicDta: [
{ {
label: "易耗品", label: "易耗品",
value: "1", value: "YH",
}, },
{ {
label: "耐用品", label: "耐用品",
value: "2", value: "NY",
}, },
], ],
}, },
@ -182,12 +182,12 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{ // {
label: "金额", // label: "",
prop: "amount", // prop: "amount",
headerAlign: "center", // headerAlign: "center",
align: "center", // align: "center",
}, // },
{ {
label: "状态", label: "状态",
prop: "isBorrow", prop: "isBorrow",
@ -208,12 +208,26 @@ export default {
value: "2", value: "2",
}, },
], ],
formatter: (row, column) => {
const value = row.purchaseEndInfo;
if (value === null || value === undefined || value === "") {
return "无"; //
}
return value; //
}
}, },
{ {
label: "归还时间", label: "归还时间",
prop: "returnTime", prop: "returnTime",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
formatter: (row, column) => {
const value = row.returnTime;
if (value === null || value === undefined || value === "") {
return "无"; //
}
return value; //
}
}, },
], ],
}, },

@ -111,6 +111,13 @@ export default {
width: 180, width: 180,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
formatter: (row, column) => {
const value = row.demandEndInfo;
if (value === null || value === undefined || value === "") {
return "无"; //
}
return value; //
}
}, },
// { // {
// label: "", // label: "",

@ -135,18 +135,18 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{ // {
label: "单价", // label: "",
prop: "unitPrice", // prop: "unitPrice",
headerAlign: "center", // headerAlign: "center",
align: "center", // align: "center",
}, // },
{ // {
label: "金额", // label: "",
prop: "amount", // prop: "amount",
headerAlign: "center", // headerAlign: "center",
align: "center", // align: "center",
}, // },
], ],
}, },
data: [], data: [],

Loading…
Cancel
Save