代码提交

master
taozi 3 months ago
parent 14efd9eebb
commit 4df363491f
  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,6 +39,15 @@ export const getDetailedList = (params) => {
cryptoData: false
})
}
export const batchList = (params) => {
return request({
url: '/smartpark/demandEnd/getDemandEndNyData',
method: 'get',
params: params,
cryptoToken: false,
cryptoData: false
})
}
export const getDetailedItems = () => {
return request({
url: '/smartpark/department/getOnePutDepartment',

@ -0,0 +1,162 @@
<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>
<el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<basic-container>
<basic-container class="dialog-content">
<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"
@search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
@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>
</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>
</template>
<script>
@ -32,15 +32,15 @@ export default {
return {
form: {},
selectionList: [],
query: {},
query: { type: "NY" },
loading: true,
page: {
pageSize: 10,
pageSize: 5,
currentPage: 1,
total: 0,
},
option: {
height: "auto",
// height: "auto",
calcHeight: 30,
tip: false,
searchShow: true,
@ -88,11 +88,13 @@ export default {
type: "select",
headerAlign: "center",
align: "center",
value: "NY",
disabled: true,
dicData: [
{
label: "易耗品",
value: "YH",
},
// {
// label: "",
// value: "YH",
// },
{
label: "耐用品",
value: "NY",
@ -145,7 +147,8 @@ export default {
ckTable: [],
rkTable: [],
currentRow: null,
};
allSelectedList: [], //
}
},
computed: {
permissionList() {
@ -226,18 +229,34 @@ export default {
this.onLoad(this.page, params);
done();
},
//
//
selectionChange(list) {
this.selectionList = list;
console.log("勾选选中", 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() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleRowChange(row, index, data) {
console.log('Selected data:', data);
console.log('Selected data:', data);
console.log('select row', row)
//
},
currentChange(currentPage) {
console.log(currentPage, 1)
this.handleRowChange()
this.page.currentPage = currentPage;
},
@ -249,21 +268,35 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
console.log(this.query, 2)
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
// const data = res.data.data;
this.data = res.data.result.list;
this.data = res.data.result.list
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
})
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,8 +704,6 @@ export default {
}
</script>
<style lang="scss" scoped>
::v-deep .el-table td,
::v-deep .el-table th {
text-align: center !important;

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

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

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

Loading…
Cancel
Save