代码提交

master
taozi 3 months ago
parent b1e636bfcc
commit 9f67ac2f03
  1. 59
      src/views/firstOrder/components/batchSelectionDialog.vue
  2. 20
      src/views/firstOrder/components/consumableDialog.vue
  3. 218
      src/views/firstOrder/components/outDialog.vue

@ -1,31 +1,19 @@
<template>
<el-dialog
:close-on-click-modal="false"
:title="batchSelectionTitle"
:visible.sync="batchSelectionVisible"
:append-to-body="true"
width="70%"
@close="handleCloseDetail"
fullscreen
>
<el-dialog :close-on-click-modal="false" :title="batchSelectionTitle" :visible.sync="batchSelectionVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<el-table :data="tableData" style="width: 100%" border>
<!-- 展开行详情 -->
<el-table-column type="expand">
<template slot-scope="props">
<!-- 关联表单列表带复选框 -->
<el-table
:data="props.row.oneFormList || []"
size="mini"
style="width: 100%"
@selection-change="(val) => handleSelectionChange(val, props.row)"
border
>
<el-table :data="props.row.oneFormList || []" size="mini" style="width: 100%"
@selection-change="(val) => handleSelectionChange(val, props.row)" border>
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="#" width="55" />
<!-- <el-table-column label="表单ID" prop="id" width="80" /> -->
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="物料编码" prop="materialCode" />
<el-table-column label="规格型号" prop="model" />
<el-table-column label="规格型号" prop="model" />
<!-- <el-table-column label="申请数量" prop="applicationQuantity" /> -->
<el-table-column label="单价" prop="unitPrice" width="80" />
</el-table>
@ -34,17 +22,18 @@
<!-- 常规列展示 -->
<!-- <el-table-column label="物料ID" prop="materialId" /> -->
<el-table-column label="物料编码" prop="materialCode" />
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="规格型号" prop="model" />
<el-table-column label="申请数量" prop="applicationQuantity" />
<el-table-column label="本此出库数量" prop="applicationQuantity" />
<el-table-column label="物料编码" prop="materialCode" />
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="规格型号" prop="model" />
<el-table-column label="申请数量" prop="applicationQuantity" />
<el-table-column label="本此出库数量" prop="applicationQuantity" />
<!-- <el-table-column label="已出库数量" prop="outboundQuantity" /> -->
<el-table-column label="部门" prop="departmentName" />
<el-table-column label="单位" prop="unit" />
<el-table-column label="部门" prop="departmentName" />
<el-table-column label="单位" prop="unit" />
</el-table>
<div style="text-align: right; margin-top: 20px">
<el-button @click="handleConfirmSelect">确认选择</el-button>
<div style="text-align: right; margin-top: 20px">
<el-button @click="handleCloseDetail">取消</el-button>
<el-button @click="handleConfirmSelect" type="primary">确认选择</el-button>
</div>
</el-dialog>
</template>
@ -92,9 +81,9 @@ export default {
type: Array,
default: () => []
},
inBatchForm:{
type:Object,
default:()=>{}
inBatchForm: {
type: Object,
default: () => { }
}
},
data() {
@ -106,14 +95,14 @@ export default {
methods: {
//
handleSelectionChange(selection, parentRow) {
console.log('666666',selection, parentRow)
console.log('666666', selection, parentRow)
//
const selectionWithParent = selection.map(item => ({
...item,
parentMaterialId: parentRow.materialId, // ID
parentDepartmentName: parentRow.departmentName, //
applicationQuantity: parentRow.applicationQuantity,
ldDemandEndId:parentRow.ldDemandEndId,
ldDemandEndId: parentRow.ldDemandEndId,
// outboundQuantity:parentRow.outboundQuantity,
}));
@ -123,14 +112,14 @@ export default {
);
//
this.selectedRows.push(...selectionWithParent);
console.log('777777',selection, parentRow,this.selectedRows)
console.log('777777', selection, parentRow, this.selectedRows)
//
},
// -
handleConfirmSelect() {
console.log(1222)
console.log(this.selectedRows,'00000')
console.log(this.selectedRows, '00000')
// this.$emit('confirm-selection', this.selectedRows);
this.batchSelectionVisible = false;
@ -152,7 +141,7 @@ export default {
},
mounted() {
console.log(9999999,this.inBatchForm)
console.log(9999999, this.inBatchForm)
}
}

@ -45,7 +45,7 @@ export default {
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 12,
searchMenuSpan: 18,
border: true,
index: true,
selection: true,
@ -177,17 +177,6 @@ export default {
this.consumableVisible = this.consumableVisible
},
methods: {
formatTime(row, column, cellValue) {
if (!cellValue) return '';
const date = new Date(cellValue);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
async handleLog(row) {
this.dialogLogVisible = true;
this.currentRow = row;
@ -230,7 +219,6 @@ export default {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
@ -275,8 +263,7 @@ export default {
},
handleRowChange(row, index, data) {
// onLoad
//
this.$nextTick(() => {
//
this.isUpdatingSelection = true;
@ -372,7 +359,8 @@ export default {
},
handleCancel() {
this.$emit('handleCloseDetail');
// this.$emit('handleCloseDetail');
this.consumableVisible
}
},
}

@ -66,7 +66,7 @@
<template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
v-if='inDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"'
v-if='outDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"'
value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option>
@ -97,7 +97,7 @@
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName || ''}}</span>
<span v-else> {{ scope.row.departmentName || '' }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options">
@ -117,7 +117,7 @@
</template>
</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">
{{ scope.row.outboundQuantity || 0 }}
</template>
@ -276,10 +276,8 @@ export default {
data() {
return {
dialogVisible: false,
materialList: [],
demandDialogTitle: '耐用品出库',
batchSelectionTitle: '耐用品出库',
goodsVisible: false,
batchSelectionVisible: false,
batchSelection: true, //
batchTableData: [],
@ -308,8 +306,6 @@ export default {
mainErDepartmentName: "主管部门名称",
},
},
goodsList: [],
goodsSelectList: [],
// inTableData: [],
inBatchDialogVisible: false,//
batchType: '',//
@ -358,14 +354,7 @@ export default {
this.consumableVisible = false
this.sizeForm.inTableData = allSelectedList
console.log(this.sizeForm.inTableData, '111220')
},
// //
// async getMaterialList() {
// const { data: res } = await this.$http.get('material/getMaterialList')
// if (res.code !== 200) return this.$message.error(res.msg)
// this.materialList = res.data
// },
//
}, //
async handleSearch() {
//
this.currentPage = 1;
@ -384,50 +373,6 @@ export default {
this.currentPage = val;
this.loadGoodsList();
},
//
// async loadGoodsList() {
// try {
// const res = await getMaterialList({
// optionType: 'NY', //
// // pageNum: this.currentPage,
// // pageSize: this.pageSize,
// // keyword: this.searchKeyword //
// });
// if (res.data && res.data.result) {
// // this.goodsList = res.data.result.list; //
// this.goodsList = res.data.result; //
// this.total = res.data.result.total; //
// }
// } catch (error) {
// this.$message.error("");
// }
// },
//
goodsListSelectionChange(val) {
this.goodsSelectList = JSON.parse(JSON.stringify(val));
},
//
// goodsSubmit() {
// if (this.goodsSelectList.length > 0) {
// const newItems = this.goodsSelectList.map(item => ({
// ...item,
// materialId: item.materialId,
// materialCode: item.materialCode,
// materialName: item.materialName,
// model: item.model,
// type: item.type,
// unit: item.unit,
// department: item.departmentId,
// departmentName: item.departmentName,
// theOutboundQuantity: 0
// }));
// this.sizeForm.inTableData.push(...newItems);
// this.batchSelectionVisible = true;
// } else {
// this.$message.warning('')
// }
// },
depchange(value) {
this.departmentList = this.departmentList
},
@ -518,57 +463,7 @@ export default {
this.departmentList = []
}
},
//
// async batchSubmit() {
// if (!this.inBatchForm.batchType) {
// this.$message.error('');
// return;
// }
// if (!this.inBatchForm.department) {
// this.$message.error('');
// return;
// }
// if (!this.inBatchForm.optionType) {
// this.$message.error('');
// return;
// }
// const res = await getDetailedList({
// ids: this.inBatchForm.batchType,
// departmentId: this.inBatchForm.department,
// optionType: this.inBatchForm.optionType,
// })
// if (res.data && res.data.result) {
// this.sizeForm.inTableData = res.data.result
// const selectedDept = this.departmentList.find(
// dept => dept.departmentId === this.inBatchForm.department
// )
// const deptName = selectedDept ? selectedDept.department : '';
// this.sizeForm.inTableData = res.data.result.map(item => ({
// ...item,
// IdDemandEndld: this.inBatchForm.batchType,
// // department: this.inBatchForm.department,
// department: deptName
// }))
// this.inBatchDialogVisible = false;
// const selectedQuarter = this.quarterList.find(
// item => item.ids === this.inBatchForm.batchType
// )
// if (selectedQuarter) {
// this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
// }
// if (this.inBatchForm.optionType === 'NY') {
// this.batchSelectionVisible = true;
// this.batchTableData = res.data.result;
// }
// this.$nextTick(() => {
// this.$forceUpdate();
// })
// } else {
// this.$message.warning('');
// }
// },
async batchSubmit() {
if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单');
@ -642,20 +537,6 @@ export default {
console.error('批量提交接口调用失败:', error);
}
},
//
goodsListSelectionChange(val) {
this.goodsSelectList = val
},
//
// goodsSubmit() {
// if (this.goodsSelectList.length > 0) {
// this.sizeForm.inTableData.push(...this.goodsSelectList);
// this.$forceUpdate();
// } else {
// this.$message.warning('');
// }
// this.batchSelectionVisible = true;
// },
//
async getDetailedItems() {
this.loading = true
@ -675,10 +556,9 @@ export default {
//
async getMaterialList() {
this.loading = true
this.goodsVisible = false;
this.consumableVisible = false;
try {
if (this.sizeForm.optionType === "NY") {
if (this.sizeForm.optionType === "NY" && this.outDialogType !== 'details') {
this.consumableVisible = true
} else {
const res = await getMaterialList({ optionType: this.sizeForm.optionType })
@ -778,60 +658,46 @@ export default {
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo
this.sizeForm.outDate = ldOneOutStorage.outDate
this.sizeForm.options = Number(ldOneOutStorage.options)
// this.sizeForm.optionType = ldOneOutStorage.optionType
// reason: '',//
// inAccountsTableData: [],//
// inTableData: [],
// ldOneOutStorageDetailVOList: [],
// demandEndInfo: '',//
// outDate: '',//
// options: 2,//
// optionType: '', // 1 2
// materialType: '1',//
// status: '',//1 2
// materialld: '',//Id
this.sizeForm.optionType = ldOneOutStorage.optionType
this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails)
console.log(this.sizeForm, '111')
})
}
},
// this.sizeForm = {
// // ...this.sizeForm,
// // ...ldOneOutStorage,
// // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// // options: Number(ldOneOutStorage.options) || 1,
// // inTableData: ldOneOutStorageDetails
// }
// })
// try {
// const res = await editList(this.id)
// console.log(res, '')
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
// if (!ldOneOutStorage) {
// this.$message.error("");
// return;
// }
// // const handledDetailList = ldOneOutStorageDetails.map(item => ({
// // ...item,
// // outboundQuantity: item.outboundQuantity || 0
// // }))
// console.log(handledDetailList, 'handledDetailList')
// this.sizeForm = {
// ...this.sizeForm,
// ...ldOneOutStorage,
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// options: Number(ldOneOutStorage.options) || 1,
// inTableData: ldOneOutStorageDetails
// }
// // console.log(this.sizeForm.inTableData, 'this.sizeForm')
// } catch (error) {
// this.$message.error("");
// }
// async inInit() {
// if (this.outDialogType == 'details' || this.outDialogType == 'edit') {
// try {
// const res = await editList(this.id);
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
// if (!ldOneOutStorage) {
// this.$message.error("");
// return;
// }
// const handledDetailList = ldOneOutStorageDetails.map(item => ({
// ...item,
// outboundQuantity: item.outboundQuantity || 0
// }))
// this.sizeForm = {
// ...this.sizeForm,
// ...ldOneOutStorage,
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// options: Number(ldOneOutStorage.options) || 1,
// }
// this.sizeForm.inTableData = handledDetailList;
// } catch (error) {
// this.$message.error("");
// }
// }
// },
//
radioChange() {
this.sizeForm.inTableData = []
this.sizeForm.optionType = '';
this.inBatchDialogVisible = false;
this.consumableVisible = false;
this.batchSelectionVisible = false;
this.batchTableData = [];
if (this.sizeForm.options === 1) {
this.getQuarterList()
this.inBatchDialogVisible = true
@ -866,13 +732,13 @@ export default {
}
},
'sizeForm.optionType': function (newVal) {
if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = []
this.getMaterialList()
} else if (newVal && this.outDialogType !== 'add') {
this.getMaterialList()
}
},
if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = []
this.getMaterialList()
} else if (newVal && this.outDialogType !== 'add') {
this.getMaterialList()
}
},
}
}
</script>

Loading…
Cancel
Save