Compare commits

..

No commits in common. '44c02725fe518fe2c3f36b83995e76c8fcd357fe' and '1cf46a7dbab22660dcea7f64b34dcbd2fafa146a' have entirely different histories.

  1. 9
      src/api/firstOrder/outbound.js
  2. 162
      src/views/firstOrder/components/batchSelectionDialog.vue
  3. 75
      src/views/firstOrder/components/consumableDialog.vue
  4. 2
      src/views/firstOrder/components/inDialog.vue
  5. 488
      src/views/firstOrder/components/outDialog.vue
  6. 19
      src/views/firstOrder/list.vue
  7. 81
      src/views/firstOrder/outbound.vue

@ -39,15 +39,6 @@ export const getDetailedList = (params) => {
cryptoData: false cryptoData: false
}) })
} }
export const batchList = (params) => {
return request({
url: '/smartpark/demandEnd/getDemandEndNyData',
method: 'get',
params: params,
cryptoToken: false,
cryptoData: false
})
}
export const getDetailedItems = () => { export const getDetailedItems = () => {
return request({ return request({
url: '/smartpark/department/getOnePutDepartment', url: '/smartpark/department/getOnePutDepartment',

@ -1,162 +0,0 @@
<template>
<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-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="materialCode" />
<el-table-column label="规格型号" prop="model" />
<!-- <el-table-column label="申请数量" prop="applicationQuantity" /> -->
<el-table-column label="单价" prop="unitPrice" width="80" />
</el-table>
</template>
</el-table-column>
<!-- 常规列展示 -->
<!-- <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="outboundQuantity" />
<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>
</el-dialog>
</template>
<style>
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 15px;
width: 50%;
}
/* 适配嵌套表格样式 */
.demo-table-expand .el-table {
--el-table-header-text-color: #666;
--el-table-row-hover-bg-color: #f8f9fa;
}
/* 展开行内表格样式优化 */
.el-table__expanded-cell .el-table {
margin-bottom: 16px;
}
</style>
<script>
export default {
props: {
batchSelectionVisible: {
type: Boolean,
default: false
},
batchSelectionTitle: {
type: String,
default: '物料出库信息'
},
tableData: {
type: Array,
default: () => []
},
inBatchForm:{
type:Object,
default:()=>{}
}
},
data() {
return {
//
selectedRows: []
};
},
methods: {
//
handleSelectionChange(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,
// outboundQuantity:parentRow.outboundQuantity,
}));
//
this.selectedRows = this.selectedRows.filter(
item => item.parentMaterialId !== parentRow.materialId
);
//
this.selectedRows.push(...selectionWithParent);
console.log('777777',selection, parentRow,this.selectedRows)
//
},
// -
handleConfirmSelect() {
console.log(1222)
console.log(this.selectedRows,'00000')
// this.$emit('confirm-selection', this.selectedRows);
this.batchSelectionVisible = false;
this.$emit('selectionChange', this.selectedRows);
//
// this.handleCloseDetail();
},
// //
handleCloseDetail() {
// this.$emit('update:batchSelectionVisible', false);
// this.$emit('handleCloseDetail')
this.$emit('selectionChange', this.selectedRows);
},
},
mounted() {
console.log(9999999,this.inBatchForm)
}
}
</script>

@ -1,18 +1,18 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible" <el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen> :append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<basic-container class="dialog-content"> <basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
:page.sync="page" :permission="permissionList" @row-del="rowDel" @search-change="searchChange" :page.sync="page" :permission="permissionList" @row-del="rowDel" @search-change="searchChange"
@search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
@row-change="handleRowChange"> @row-change="handleRowChange">
<!-- <template slot-scope="scope" slot="menu">
<el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录
</el-button>
</template> -->
</avue-crud> </avue-crud>
</basic-container> </basic-container>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
@ -32,15 +32,15 @@ export default {
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: { type: "NY" }, query: {},
loading: true, loading: true,
page: { page: {
pageSize: 5, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
option: { option: {
// height: "auto", height: "auto",
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
@ -88,13 +88,11 @@ export default {
type: "select", type: "select",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
value: "NY",
disabled: true,
dicData: [ dicData: [
// { {
// label: "", label: "易耗品",
// value: "YH", value: "YH",
// }, },
{ {
label: "耐用品", label: "耐用品",
value: "NY", value: "NY",
@ -147,8 +145,7 @@ export default {
ckTable: [], ckTable: [],
rkTable: [], rkTable: [],
currentRow: null, currentRow: null,
allSelectedList: [], // };
}
}, },
computed: { computed: {
permissionList() { permissionList() {
@ -229,34 +226,18 @@ export default {
this.onLoad(this.page, params); this.onLoad(this.page, params);
done(); done();
}, },
// //
selectionChange(list) { selectionChange(list) {
console.log("勾选选中", list) this.selectionList = list;
const currentPageIds = this.data.map(item => item.id)
console.log(currentPageIds, "currentPageIds")
this.allSelectedList = this.allSelectedList.filter(item => !currentPageIds.includes(item.id))
console.log(this.allSelectedList, '1')
this.allSelectedList.push(...list)
console.log('所有勾选数据:', this.allSelectedList)
},
//
handleConfirm() {
console.log(6)
console.log(this.allSelectedList, 'chuan')
this.$emit("confirm", this.allSelectedList)
}, },
selectionClear() { selectionClear() {
this.selectionList = []; this.selectionList = [];
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}, },
handleRowChange(row, index, data) { handleRowChange(row, index, data) {
console.log('Selected data:', data); console.log('Selected data:', data);
console.log('select row', row)
//
}, },
currentChange(currentPage) { currentChange(currentPage) {
console.log(currentPage, 1)
this.handleRowChange() this.handleRowChange()
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
}, },
@ -268,35 +249,21 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
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 // const data = res.data.data;
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.selectionClear();
});
this.loading = false; this.loading = false;
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped>
::v-deep.el-dialog__footer {
position: fixed !important;
bottom: 0 !important;
right: 0 !important;
}
::v-deep.dialog-content {
max-height: calc(100vh - 200px);
overflow-y: auto;
padding-right: 10px;
overflow-x: hidden;
}
</style>

@ -704,6 +704,8 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-table td, ::v-deep .el-table td,
::v-deep .el-table th { ::v-deep .el-table th {
text-align: center !important; text-align: center !important;

@ -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 @click="closeHandle">批量选择</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>
@ -58,7 +58,7 @@
</el-row> </el-row>
<div class="form-title">{{ outDate }} 出库信息</div> <div class="form-title">{{ outDate }} 出库信息</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()" <el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
v-if="sizeForm.options == 2 && outDialogType != 'details'">新增</el-button> v-if="sizeForm.options == 2">新增</el-button>
<el-table :data="sizeForm.inTableData" border style="width: 100%"> <el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="materialCode" label="物资编码"> <el-table-column prop="materialCode" label="物资编码">
</el-table-column> </el-table-column>
@ -102,22 +102,22 @@
</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">
</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%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'" @change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
v-if="sizeForm.optionType === 'YH' ||inBatchForm.optionType === 'YH'"></el-input-number> <!-- <span v-else>{{ scope.row.theOutboundQuantity || 0 }}</span> -->
<span v-else>{{ scope.row.theOutboundQuantity = 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" style="text-align: center;" v-if="outDialogType != 'details'"> <el-table-column label="操作" v-if="sizeForm.optionType === 'YH' || inBatchForm.optionType === 'YH'"
style="text-align: center;">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;" :disabled="outDialogType == 'details'"> <div style="text-align: center;">
<el-button type="text" size="mini" @click="handleDelete(scope.$index, scope.row)"> <el-button type="text" size="mini" @click="handleDelete(scope.$index, scope.row)">
删除 删除
</el-button> </el-button>
@ -165,13 +165,13 @@
</el-table> </el-table>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer" v-if="outDialogType != 'details'"> <span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button> <el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="submit(1)">暂存</el-button> <el-button type="primary" @click="submit(1)">暂存</el-button>
<el-button type="primary" @click="submit(2)">提交</el-button> <el-button type="primary" @click="submit(2)">提交</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 批量出库 选择数据源弹窗 --> <!-- 批量出库 选择弹窗 -->
<el-dialog :close-on-click-modal="false" title="选择数据来源" :visible.sync="inBatchDialogVisible" :append-to-body="true" <el-dialog :close-on-click-modal="false" title="选择数据来源" :visible.sync="inBatchDialogVisible" :append-to-body="true"
width="40%" @close="handleBatchClose" @open="getQuarterList"> width="40%" @close="handleBatchClose" @open="getQuarterList">
<el-form :model="inBatchForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic"> <el-form :model="inBatchForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
@ -214,25 +214,64 @@
<el-button type="primary" @click="batchSubmit()"> </el-button> <el-button type="primary" @click="batchSubmit()"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 选择弹窗 -->
<!-- 单条新增耐用品弹窗 --> <el-dialog :close-on-click-modal="false" title="选择耐用品" :visible.sync="goodsVisible" :append-to-body="true"
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible' width="70%">
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="handleCloseDetail" @confirm="confirm"> <!-- 搜索区域 -->
</consumableDialog> <div class="search-container" style="margin-bottom: 15px;">
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible='batchSelectionVisible' <el-input v-model="searchKeyword" placeholder="请输入物资名称搜索" clearable style="width: 300px;"
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" @keyup.enter.native="handleSearch">
@batchclose="batchclose" :inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange"></batchSelectionDialog> <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button>
</el-input>
</div>
<el-table :data="goodsList" border style="width: 100%" @selection-change="goodsListSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="model" 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="departmentName" label="部门" v-if="sizeForm.options == 2">
</el-table-column>
<el-table-column prop="applicationQuantity" label="申请数量">
</el-table-column>
<el-table-column prop="outboundQuantity" label="已出库数量">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[5, 10, 20, 50]" :page-size="pageSize" :total="total"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="goodsVisible = false"> </el-button>
<el-button type="primary" @click="goodsSubmit()"> </el-button>
</span>
</el-dialog>
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible' :demandDialogTitle="demandDialogTitle"
@handleCloseDetail="handleCloseDetail">
</consumableDialog>
</div> </div>
</template> </template>
<script> <script>
import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList, batchList } from "@/api/firstOrder/outbound"; import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList } from "@/api/firstOrder/outbound";
import consumableDialog from './consumableDialog.vue' import consumableDialog from './consumableDialog.vue'
import batchSelectionDialog from './batchSelectionDialog.vue'
export default { export default {
components: { components: {
consumableDialog, consumableDialog,
batchSelectionDialog
}, },
props: { props: {
repairVisible: { repairVisible: {
@ -258,16 +297,9 @@ export default {
}, },
data() { data() {
return { return {
dialogVisible: false,
materialList: [],
demandDialogTitle: '耐用品出库', demandDialogTitle: '耐用品出库',
batchSelectionTitle: '耐用品出库',
goodsVisible: false, goodsVisible: false,
batchSelectionVisible: false,
batchSelection: true, //
batchTableData: [],
consumableVisible: false, // consumableVisible: false, //
batchSelection: false,
quarterList: [], quarterList: [],
departmentList: [], departmentList: [],
outDialogVisible: false, outDialogVisible: false,
@ -293,16 +325,25 @@ export default {
}, },
goodsList: [], goodsList: [],
goodsSelectList: [], goodsSelectList: [],
// inTableData: [], inTableData: [],
inBatchDialogVisible: false,// inBatchDialogVisible: false,//
batchType: '',// batchType: '',//
inBatchForm: { // inBatchForm: {
batchType: '', // batchType: '',
department: '', // department: '',
optionType: '', //YH/NY optionType: '',
}, },
quarterYearMap: {}, quarterYearMap: {},
quarterQuarterMap: {}, quarterQuarterMap: {},
rules: {
reason: [
{ required: true, message: '事由不能为空', trigger: 'blur' }
],
materialType: [
{ required: true, message: '请选择物资类型', trigger: 'change' }
]
//
}
} }
}, },
computed: { computed: {
@ -319,7 +360,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()
@ -330,18 +371,6 @@ export default {
// this.getMaterialList() // this.getMaterialList()
}, },
methods: { methods: {
batchclose() {
this.batchSelectionVisible = false
},
selectionChange(row){
this.batchSelectionVisible = false
this.sizeForm.inTableData=row
},
confirm(allSelectedList) {
this.consumableVisible = false
this.sizeForm.inTableData = allSelectedList
console.log(this.sizeForm.inTableData, '111220')
},
// // // //
// async getMaterialList() { // async getMaterialList() {
// const { data: res } = await this.$http.get('material/getMaterialList') // const { data: res } = await this.$http.get('material/getMaterialList')
@ -386,31 +415,34 @@ export default {
// this.$message.error(""); // this.$message.error("");
// } // }
// }, // },
// //
goodsListSelectionChange(val) { goodsListSelectionChange(val) {
this.goodsSelectList = JSON.parse(JSON.stringify(val)); this.goodsSelectList = JSON.parse(JSON.stringify(val));
}, },
//
// goodsSubmit() { //
// if (this.goodsSelectList.length > 0) { goodsSubmit() {
// const newItems = this.goodsSelectList.map(item => ({ if (this.goodsSelectList.length > 0) {
// ...item, const newItems = this.goodsSelectList.map(item => ({
// materialId: item.materialId, ...item,
// materialCode: item.materialCode, materialId: item.materialId,
// materialName: item.materialName, materialCode: item.materialCode,
// model: item.model, materialName: item.materialName,
// type: item.type, model: item.model,
// unit: item.unit, type: item.type,
// department: item.departmentId, unit: item.unit,
// departmentName: item.departmentName, department: item.departmentId,
// theOutboundQuantity: 0 departmentName: item.departmentName,
// })); theOutboundQuantity: 0
// this.sizeForm.inTableData.push(...newItems); }));
// this.batchSelectionVisible = true;
// } else { this.sizeForm.inTableData.push(...newItems);
// this.$message.warning('') this.goodsVisible = false;
// } } else {
// }, this.$message.warning('请先勾选需要添加的数据');
}
},
depchange(value) { depchange(value) {
this.departmentList = this.departmentList this.departmentList = this.departmentList
}, },
@ -448,9 +480,7 @@ export default {
row.theOutboundQuantity = maxAllowQuantity; row.theOutboundQuantity = maxAllowQuantity;
} }
} }
if (this.sizeForm.optionType === 'NY') {
row.theOutboundQuantity = 1
}
}, },
// //
handleCloseDetail() { handleCloseDetail() {
@ -502,143 +532,70 @@ 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) {
// 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('请选择需求单');
return;
}
if (!this.inBatchForm.department) {
this.$message.error('请选择部门');
return;
}
if (!this.inBatchForm.optionType) {
this.$message.error('请选择类别');
return;
}
const requestParams = {
ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department,
optionType: this.inBatchForm.optionType,
};
try {
let res;
if (this.inBatchForm.optionType === 'YH') {
res = await getDetailedList(requestParams);
} else if (this.inBatchForm.optionType === 'NY') {
res = await batchList(requestParams);
}
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: 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) {
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) {
if (this.inBatchForm.optionType === 'NY') { this.sizeForm.inTableData = res.data.result
console.log(this.inBatchForm.optionType, 'this.inBatchForm.optionType') const selectedDept = this.departmentList.find(
this.batchSelectionVisible = true; dept => dept.departmentId === this.inBatchForm.department
this.dialogVisible = true; )
console.log(1) const deptName = selectedDept ? selectedDept.department : '';
this.batchTableData = res.data.result; 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.goodsVisible = true
this.data.goodsList = res.data.result
}
this.$nextTick(() => {
this.$forceUpdate();
});
} else {
this.$message.warning('未获取到详细数据');
} }
// },
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
}, },
// //
// goodsSubmit() { goodsSubmit() {
// if (this.goodsSelectList.length > 0) { if (this.goodsSelectList.length > 0) {
// this.sizeForm.inTableData.push(...this.goodsSelectList); this.sizeForm.inTableData.push(...this.goodsSelectList);
// this.$forceUpdate(); this.$forceUpdate();
// } else { } else {
// this.$message.warning(''); this.$message.warning('请先勾选需要添加的数据');
// } }
// this.batchSelectionVisible = true; this.goodsVisible = false
// }, },
// //
async getDetailedItems() { async getDetailedItems() {
this.loading = true this.loading = true
@ -658,9 +615,8 @@ async batchSubmit() {
// //
async getMaterialList() { async getMaterialList() {
this.loading = true this.loading = true
this.goodsVisible = false;
this.consumableVisible = false;
try { try {
if (this.sizeForm.optionType === "NY") { if (this.sizeForm.optionType === "NY") {
this.consumableVisible = true this.consumableVisible = true
} else { } else {
@ -715,15 +671,13 @@ async batchSubmit() {
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData
let arr = this.departmentList.find(item => item.departmentId === this.inBatchForm.department || {}) let arr = this.departmentList.find(item => item.departmentId === this.inBatchForm.department || {})
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map(row => { this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map(row => {
console.log(row, 'row')
const deptId = row.department const deptId = row.department
const dept = this.list.find(item => item.departmentId === deptId); const dept = this.list.find(item => item.departmentId === deptId);
const oneFormId = row.id console.log(dept, 'dept')
return { return {
...row, ...row,
department: this.sizeForm.options == '1' ? arr.departmentId : deptId, department: this.sizeForm.options == '1' ? arr.departmentId : deptId,
departmentName: this.sizeForm.options == '1' ? arr.department : dept.department, departmentName: this.sizeForm.options == '1' ? arr.department : dept.department,
oneFormId: oneFormId
} }
}) })
console.log(this.sizeForm, '111') console.log(this.sizeForm, '111')
@ -747,95 +701,60 @@ async batchSubmit() {
}, },
// //
async inInit() { async inInit() {
if (this.outDialogType == 'details' || this.outDialogType == 'edit') { if (this.outDialogType == 'details' || this.outDialogType == 'edit') {
editList(this.id).then(res => { try {
console.log(res.data.result, '详情数据') const res = await editList(this.id);
const { ldOneOutStorage, ldOneOutStorageDetails } = res.data.result || {}; const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
if (!ldOneOutStorage) {
// this.sizeForm = res.data.result.ldOneOutStorage this.$message.error("回显数据异常");
this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails return;
this.sizeForm.orderNo = ldOneOutStorage.orderNo }
this.sizeForm.reason = ldOneOutStorage.reason const handledDetailList = ldOneOutStorageDetails.map(item => ({
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo ...item,
this.sizeForm.outDate = ldOneOutStorage.outDate outboundQuantity: item.outboundQuantity || 0
this.sizeForm.options = Number(ldOneOutStorage.options) }))
this.sizeForm = {
// reason: '',// ...this.sizeForm,
// inAccountsTableData: [],// ...ldOneOutStorage,
// inTableData: [], outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// ldOneOutStorageDetailVOList: [], options: Number(ldOneOutStorage.options) || 1,
// demandEndInfo: '',// }
// outDate: '',// this.sizeForm.inTableData = handledDetailList;
// options: 2,//
// optionType: '', // 1 2
// materialType: '1',//
// status: '',//1 2
// materialld: '',//Id
this.$set(this.sizeForm,'inTableData',res.data.result.ldOneOutStorageDetails)
console.log(this.sizeForm, '111')
}) } catch (error) {
this.$message.error("获取详情数据失败");
}
} }
}, },
// 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("");
// }
// //
radioChange() { async radioChange() {
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
this.sizeForm.optionType = ''; this.sizeForm.optionType = '';
if (this.sizeForm.options === 1) { if (this.sizeForm.options === 1) {
this.getQuarterList() await this.getQuarterList()
this.inBatchDialogVisible = true this.inBatchDialogVisible = true
this.inBatchForm.batchType = '', this.$nextTick(() => {
this.inBatchForm.department = '' this.$forceUpdate();
this.inBatchForm.optionType = '' });
} }
}, },
// closeHandle() { closeHandle() {
// this.inBatchForm.batchType = '', this.inBatchForm.batchType = '',
// this.inBatchForm.department = '' this.inBatchForm.department = ''
// this.inBatchForm.optionType = '' this.inBatchForm.optionType = ''
// this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
// this.getQuarterList() this.getQuarterList()
// this.inBatchDialogVisible = true this.inBatchDialogVisible = true
this.$nextTick(() => {
// // this.sizeForm.inTableData = [] this.$forceUpdate();
// }, });
// this.sizeForm.inTableData = []
},
// //
handleDelete(index, row) { handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1) this.sizeForm.inTableData.splice(index, 1)
@ -857,6 +776,15 @@ async batchSubmit() {
// this.getMaterialList() // this.getMaterialList()
} }
}, },
//
goodsVisible(newVal) {
if (newVal) {
//
this.searchKeyword = '';
this.currentPage = 1;
this.loadGoodsList();
}
}
} }
} }
</script> </script>

@ -143,20 +143,13 @@ export default {
prop: "unitPrice", prop: "unitPrice",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
formatter: (row, column) => {
const value = row.unitPrice;
if (value === null || value === undefined || value === "") {
return "-";
}
return value;
}
}, },
// { {
// label: "", label: "金额",
// prop: "amount", prop: "amount",
// headerAlign: "center", headerAlign: "center",
// align: "center", align: "center",
// }, },
{ {
label: "描述", label: "描述",
prop: "remark", prop: "remark",

@ -102,13 +102,13 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
// { {
// label: "", label: "出库类型",
// prop: "outType", prop: "outType",
// width: 140, width: 140,
// headerAlign: "center", headerAlign: "center",
// align: "center", align: "center",
// }, },
{ {
label: "出库日期", label: "出库日期",
prop: "outDate", prop: "outDate",
@ -146,19 +146,19 @@ export default {
value: '2' value: '2'
}] }]
}, },
// { {
// label: "", label: "部门",
// prop: "department", prop: "department",
// align: "center", align: "center",
// headerAlign: "center", headerAlign: "center",
// formatter: (row, column) => { formatter: (row, column) => {
// const value = row.department; const value = row.department;
// if (value === null || value === undefined || value === "") { if (value === null || value === undefined || value === "") {
// return ""; return "无";
// } }
// return value; return value;
// } }
// }, },
{ {
label: "出库人", label: "出库人",
prop: "shipperName", prop: "shipperName",
@ -168,25 +168,25 @@ export default {
headerAlign: "center", headerAlign: "center",
}, },
{ // {
label: "状态", // label: "",
prop: "status", // prop: "status",
type: 'select', // type: 'select',
dicData: [ // dicData: [
{ // {
label: '暂存', // label: '',
value: 1 // value: 1
}, // },
{ // {
label: '待审批', // label: '',
value: 2 // value: 2
}, // },
{ // {
label: '已审批', // label: '',
value: 3 // value: 3
}, // },
] // ]
}, // },
] ]
}, },
@ -210,12 +210,11 @@ export default {
}, },
// //
handleDetails(row) { handleDetails(row) {
console.log(row, 'row详情')
this.outDialogVisible = true this.outDialogVisible = true
this.outDialogType = 'details' this.outDialogType = 'details'
this.outDialogTiltle = '详情' this.outDialogTiltle = '详情'
this.id = row.id this.id = row.id
console.log(this.id,'详情的id') console.log(this.id,'id')
}, },
// //
handleEdit(row) { handleEdit(row) {

Loading…
Cancel
Save