Compare commits

...

3 Commits

  1. 3
      src/api/firstOrder/outbound.js
  2. 23
      src/views/firstOrder/components/batchSelectionDialog.vue
  3. 21
      src/views/firstOrder/components/consumableDialog.vue
  4. 5
      src/views/firstOrder/components/needDialog.vue
  5. 172
      src/views/firstOrder/components/outDialog.vue
  6. 11
      src/views/firstOrder/outbound.vue

@ -87,8 +87,9 @@ export const editList = (oneOutStorageId) => {
}) })
} }
export const getPutPurchaseList = (current, size, params) => { export const getPutPurchaseList = (current, size, params) => {
console.log('api中的数据', params)
return request({ return request({
url: '/smartpark/oneOutStorageDetail/getOneOutStorageDetailList', url: '/smartpark/oneOutStorage/getDemandEndList',
method: 'get', method: 'get',
params: { params: {
...params, ...params,

@ -1,25 +1,13 @@
<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" /> -->
@ -44,7 +32,8 @@
<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>

@ -40,11 +40,12 @@ export default {
total: 0, total: 0,
}, },
option: { option: {
reserveSelection: true,
// height: "auto", // height: "auto",
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,
@ -176,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;
@ -229,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;
@ -274,8 +263,7 @@ export default {
}, },
handleRowChange(row, index, data) { handleRowChange(row, index, data) {
// onLoad
//
this.$nextTick(() => { this.$nextTick(() => {
// //
this.isUpdatingSelection = true; this.isUpdatingSelection = true;
@ -371,7 +359,8 @@ export default {
}, },
handleCancel() { handleCancel() {
this.$emit('handleCloseDetail'); // this.$emit('handleCloseDetail');
this.consumableVisible
} }
}, },
} }

@ -44,7 +44,7 @@ export default {
prop: 'materialName' prop: 'materialName'
}, { }, {
label: '计划需求数量', label: '计划需求数量',
prop: 'requiredQuantity' prop: 'applicationQuantity'
}, { }, {
label: '已出库数量', label: '已出库数量',
prop: 'outboundQuantity' prop: 'outboundQuantity'
@ -55,7 +55,6 @@ export default {
}, },
mounted() { mounted() {
this.openShow = this.showDialog this.openShow = this.showDialog
}, },
methods: { methods: {
closeDialog() { closeDialog() {
@ -74,7 +73,7 @@ export default {
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
const queryParams = Object.assign(params, this.query, { const queryParams = Object.assign(params, this.query, {
onePutStorageId: this.id oneOutStorageId: this.id
}); });
getPutPurchaseList(page.currentPage, page.pageSize, queryParams).then(res => { getPutPurchaseList(page.currentPage, page.pageSize, queryParams).then(res => {
console.log('采购单列表', res.data.result) console.log('采购单列表', res.data.result)

@ -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>
@ -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,
// // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// // options: Number(ldOneOutStorage.options) || 1,
// // inTableData: ldOneOutStorageDetails
// }
// })
// try { // try {
// const res = await editList(this.id) // const res = await editList(this.id);
// console.log(res, '')
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {}; // const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
// if (!ldOneOutStorage) { // if (!ldOneOutStorage) {
// this.$message.error(""); // this.$message.error("");
// return; // return;
// } // }
// // const handledDetailList = ldOneOutStorageDetails.map(item => ({ // const handledDetailList = ldOneOutStorageDetails.map(item => ({
// // ...item, // ...item,
// // outboundQuantity: item.outboundQuantity || 0 // outboundQuantity: item.outboundQuantity || 0
// // })) // }))
// console.log(handledDetailList, 'handledDetailList')
// this.sizeForm = { // this.sizeForm = {
// ...this.sizeForm, // ...this.sizeForm,
// ...ldOneOutStorage, // ...ldOneOutStorage,
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '', // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// options: Number(ldOneOutStorage.options) || 1, // options: Number(ldOneOutStorage.options) || 1,
// inTableData: ldOneOutStorageDetails
// } // }
// // console.log(this.sizeForm.inTableData, 'this.sizeForm') // this.sizeForm.inTableData = handledDetailList;
// } catch (error) { // } catch (error) {
// this.$message.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

@ -8,15 +8,7 @@
<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>
<!-- <el-button size="small" plain @click="handleExport()">出库单导出
</el-button> -->
</template> </template>
<!-- <template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)"
v-if="scope.row.purchaseEndInfo != '无'">
{{scope.row.purchaseEndInfo }}</el-button>
<span>{{ scope.row.purchaseEndInfo || '无' }}</span>
</template> -->
<template slot-scope="scope" slot="demandEndInfo"> <template slot-scope="scope" slot="demandEndInfo">
<el-button <el-button
type="text" type="text"
@ -38,7 +30,7 @@
<!-- 需求单明细 --> <!-- 需求单明细 -->
<needDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog" <needDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"> :purchaseTitle="purchaseTitle" :id="id">
</needDialog> </needDialog>
</basic-container> </basic-container>
</template> </template>
@ -240,6 +232,7 @@ export default {
this.purchaseOpen = true this.purchaseOpen = true
this.purchaseTitle = row.demandEndInfo + '需求单详情' this.purchaseTitle = row.demandEndInfo + '需求单详情'
this.id = row.id this.id = row.id
console.log(this.id,'需求单的id')
}, },
closeDialog() { closeDialog() {
this.purchaseOpen = false this.purchaseOpen = false

Loading…
Cancel
Save