代码提交

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> <template>
<el-dialog <el-dialog :close-on-click-modal="false" :title="batchSelectionTitle" :visible.sync="batchSelectionVisible"
:close-on-click-modal="false" :append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
:title="batchSelectionTitle"
:visible.sync="batchSelectionVisible"
:append-to-body="true"
width="70%"
@close="handleCloseDetail"
fullscreen
>
<el-table :data="tableData" style="width: 100%" border> <el-table :data="tableData" style="width: 100%" border>
<!-- 展开行详情 --> <!-- 展开行详情 -->
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<!-- 关联表单列表带复选框 --> <!-- 关联表单列表带复选框 -->
<el-table <el-table :data="props.row.oneFormList || []" size="mini" style="width: 100%"
:data="props.row.oneFormList || []" @selection-change="(val) => handleSelectionChange(val, props.row)" border>
size="mini"
style="width: 100%"
@selection-change="(val) => handleSelectionChange(val, props.row)"
border
>
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column type="index" label="#" width="55" /> <el-table-column type="index" label="#" width="55" />
<!-- <el-table-column label="表单ID" prop="id" width="80" /> --> <!-- <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="materialCode" />
<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="unitPrice" width="80" /> <el-table-column label="单价" prop="unitPrice" width="80" />
</el-table> </el-table>
@ -34,17 +22,18 @@
<!-- 常规列展示 --> <!-- 常规列展示 -->
<!-- <el-table-column label="物料ID" prop="materialId" /> --> <!-- <el-table-column label="物料ID" prop="materialId" /> -->
<el-table-column label="物料编码" prop="materialCode" /> <el-table-column label="物料编码" prop="materialCode" />
<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="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>
<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="handleCloseDetail">取消</el-button>
<el-button @click="handleConfirmSelect" type="primary">确认选择</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -92,9 +81,9 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
inBatchForm:{ inBatchForm: {
type:Object, type: Object,
default:()=>{} default: () => { }
} }
}, },
data() { data() {
@ -106,14 +95,14 @@ export default {
methods: { methods: {
// //
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
parentDepartmentName: parentRow.departmentName, // parentDepartmentName: parentRow.departmentName, //
applicationQuantity: parentRow.applicationQuantity, applicationQuantity: parentRow.applicationQuantity,
ldDemandEndId:parentRow.ldDemandEndId, ldDemandEndId: parentRow.ldDemandEndId,
// outboundQuantity:parentRow.outboundQuantity, // outboundQuantity:parentRow.outboundQuantity,
})); }));
@ -123,14 +112,14 @@ export default {
); );
// //
this.selectedRows.push(...selectionWithParent); this.selectedRows.push(...selectionWithParent);
console.log('777777',selection, parentRow,this.selectedRows) console.log('777777', selection, parentRow, this.selectedRows)
// //
}, },
// - // -
handleConfirmSelect() { handleConfirmSelect() {
console.log(1222) console.log(1222)
console.log(this.selectedRows,'00000') console.log(this.selectedRows, '00000')
// this.$emit('confirm-selection', this.selectedRows); // this.$emit('confirm-selection', this.selectedRows);
this.batchSelectionVisible = false; this.batchSelectionVisible = false;
@ -152,7 +141,7 @@ export default {
}, },
mounted() { mounted() {
console.log(9999999,this.inBatchForm) console.log(9999999, this.inBatchForm)
} }
} }

@ -45,7 +45,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 18,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -177,17 +177,6 @@ export default {
this.consumableVisible = this.consumableVisible this.consumableVisible = this.consumableVisible
}, },
methods: { 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) { async handleLog(row) {
this.dialogLogVisible = true; this.dialogLogVisible = true;
this.currentRow = row; this.currentRow = row;
@ -230,7 +219,6 @@ export default {
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;
@ -275,8 +263,7 @@ export default {
}, },
handleRowChange(row, index, data) { handleRowChange(row, index, data) {
// onLoad
//
this.$nextTick(() => { this.$nextTick(() => {
// //
this.isUpdatingSelection = true; this.isUpdatingSelection = true;
@ -372,7 +359,8 @@ export default {
}, },
handleCancel() { handleCancel() {
this.$emit('handleCloseDetail'); // this.$emit('handleCloseDetail');
this.consumableVisible
} }
}, },
} }

@ -66,7 +66,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;" <el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)" @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"> value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item"> <el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option> </el-option>
@ -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">
@ -117,7 +117,7 @@
</template> </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>
@ -276,10 +276,8 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
materialList: [],
demandDialogTitle: '耐用品出库', demandDialogTitle: '耐用品出库',
batchSelectionTitle: '耐用品出库', batchSelectionTitle: '耐用品出库',
goodsVisible: false,
batchSelectionVisible: false, batchSelectionVisible: false,
batchSelection: true, // batchSelection: true, //
batchTableData: [], batchTableData: [],
@ -308,8 +306,6 @@ export default {
mainErDepartmentName: "主管部门名称", mainErDepartmentName: "主管部门名称",
}, },
}, },
goodsList: [],
goodsSelectList: [],
// inTableData: [], // inTableData: [],
inBatchDialogVisible: false,// inBatchDialogVisible: false,//
batchType: '',// batchType: '',//
@ -358,14 +354,7 @@ export default {
this.consumableVisible = false this.consumableVisible = false
this.sizeForm.inTableData = allSelectedList this.sizeForm.inTableData = allSelectedList
console.log(this.sizeForm.inTableData, '111220') 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() { async handleSearch() {
// //
this.currentPage = 1; this.currentPage = 1;
@ -384,50 +373,6 @@ export default {
this.currentPage = val; this.currentPage = val;
this.loadGoodsList(); 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) { depchange(value) {
this.departmentList = this.departmentList this.departmentList = this.departmentList
}, },
@ -518,57 +463,7 @@ export default {
this.departmentList = [] 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() { async batchSubmit() {
if (!this.inBatchForm.batchType) { if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单'); this.$message.error('请选择需求单');
@ -642,20 +537,6 @@ export default {
console.error('批量提交接口调用失败:', error); 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() { async getDetailedItems() {
this.loading = true this.loading = true
@ -675,10 +556,9 @@ export default {
// //
async getMaterialList() { async getMaterialList() {
this.loading = true this.loading = true
this.goodsVisible = false;
this.consumableVisible = false; this.consumableVisible = false;
try { try {
if (this.sizeForm.optionType === "NY") { if (this.sizeForm.optionType === "NY" && this.outDialogType !== 'details') {
this.consumableVisible = true this.consumableVisible = true
} else { } else {
const res = await getMaterialList({ optionType: this.sizeForm.optionType }) const res = await getMaterialList({ optionType: this.sizeForm.optionType })
@ -778,60 +658,46 @@ 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 this.sizeForm.optionType = ldOneOutStorage.optionType
// reason: '',//
// inAccountsTableData: [],//
// inTableData: [],
// ldOneOutStorageDetailVOList: [],
// demandEndInfo: '',//
// outDate: '',//
// options: 2,//
// optionType: '', // 1 2
// materialType: '1',//
// status: '',//1 2
// 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')
}) })
} }
}, },
// this.sizeForm = { // async inInit() {
// // ...this.sizeForm, // if (this.outDialogType == 'details' || this.outDialogType == 'edit') {
// // ...ldOneOutStorage, // try {
// // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '', // const res = await editList(this.id);
// // options: Number(ldOneOutStorage.options) || 1, // const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
// // inTableData: ldOneOutStorageDetails // if (!ldOneOutStorage) {
// } // this.$message.error("");
// }) // return;
// try { // }
// const res = await editList(this.id) // const handledDetailList = ldOneOutStorageDetails.map(item => ({
// console.log(res, '') // ...item,
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {}; // outboundQuantity: item.outboundQuantity || 0
// if (!ldOneOutStorage) { // }))
// this.$message.error(""); // this.sizeForm = {
// return; // ...this.sizeForm,
// } // ...ldOneOutStorage,
// // const handledDetailList = ldOneOutStorageDetails.map(item => ({ // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// // ...item, // options: Number(ldOneOutStorage.options) || 1,
// // outboundQuantity: item.outboundQuantity || 0 // }
// // })) // this.sizeForm.inTableData = handledDetailList;
// 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("");
// }
// } catch (error) {
// this.$message.error("");
// }
// }
// },
// //
radioChange() { radioChange() {
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
this.sizeForm.optionType = ''; this.sizeForm.optionType = '';
this.inBatchDialogVisible = false;
this.consumableVisible = false;
this.batchSelectionVisible = false;
this.batchTableData = [];
if (this.sizeForm.options === 1) { if (this.sizeForm.options === 1) {
this.getQuarterList() this.getQuarterList()
this.inBatchDialogVisible = true this.inBatchDialogVisible = true
@ -866,13 +732,13 @@ export default {
} }
}, },
'sizeForm.optionType': function (newVal) { 'sizeForm.optionType': function (newVal) {
if (newVal && this.outDialogType === 'add') { if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
this.getMaterialList() this.getMaterialList()
} else if (newVal && this.outDialogType !== 'add') { } else if (newVal && this.outDialogType !== 'add') {
this.getMaterialList() this.getMaterialList()
} }
}, },
} }
} }
</script> </script>

Loading…
Cancel
Save