一级库出库接口联调

master
taozi 4 months ago
parent 592561c54f
commit 5e65cd5811
  1. 77
      src/api/firstOrder/outbound.js
  2. 9
      src/views/firstOrder/components/inDialog.vue
  3. 652
      src/views/firstOrder/components/outDialog.vue
  4. 586
      src/views/firstOrder/components/uniqueListDialog.vue
  5. 312
      src/views/firstOrder/outbound.vue

@ -0,0 +1,77 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/oneOutStorage/list',
method: 'get',
params: {
...params,
pageSize: size,
pageNum: current,
},
cryptoToken: false,
cryptoData: false
})
}
export const getQuarterList = () => {
return request({
url: '/smartpark/demandEnd/getAllQuarter',
method: 'get',
cryptoToken: false,
cryptoData: false
})
}
export const getDepartmentList = (params) => {
return request({
url: '/smartpark/demandEnd/getDepartment',
method: 'get',
params: params,
cryptoToken: false,
cryptoData: false
})
}
export const getDetailedList = (params) => {
return request({
url: '/smartpark/demandEnd/getDemandEndData',
method: 'get',
params: params,
cryptoToken: false,
cryptoData: false
})
}
export const getDetailedItems = () => {
return request({
url: '/smartpark/department/getOnePutDepartment',
method: 'get',
cryptoToken: false,
cryptoData: false
})
}
export const submitData = (sizeForm) => {
console.log('api中的数据', sizeForm)
return request({
url: '/smartpark/oneOutStorage/submit',
method: 'post',
data: sizeForm,
cryptoToken: false,
cryptoData: false
})
}
export const getMaterialList = () => {
return request({
url: '/smartpark/oneForm/getPutOneFormList',
method: 'get',
cryptoToken: false,
cryptoData: false
})
}
export const editList = (oneOutStorageId) => {
console.log('api中的数据', oneOutStorageId)
return request({
url: '/smartpark/oneOutStorage/detail',
method: 'get',
params: { oneOutStorageId },
cryptoToken: false,
cryptoData: false
})
}

@ -6,9 +6,9 @@
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12">
<el-form-item label="入库单号" v-if="sizeForm.option == 1">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
<el-col :span="12" v-show="sizeForm.options == 1 && inDialogType != 'add'">
<el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@ -509,7 +509,6 @@ export default {
return
}
const res = await getDetailList({ id: row.materialId })
console.log("res1", res)
if (res.data.success) {
if (!Array.isArray(this.sizeForm.singleData)) {
this.sizeForm.singleData = [];
@ -521,8 +520,6 @@ export default {
} else {
this.sizeForm.singleData.push({ ...row, ...materialData });
}
console.log("更新后的singleData:", this.sizeForm.singleData);
} else {
this.$message.error(res.data.message || "获取物资信息失败");
}

@ -6,108 +6,93 @@
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12">
<el-form-item label="仓库名称">
<el-input v-model="sizeForm.waNmae" :disabled="outDialogType != 'add'||type =='一级库'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库单号">
<el-input v-model="sizeForm.code" disabled></el-input>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库申请时间">
<el-date-picker v-model="sizeForm.inDate" type="date" placeholder="选择日期" style="width: 100%;" disabled>
<el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期" style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.argument" :disabled="outDialogType != 'add'"></el-input>
<el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.type" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType != 'add'">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="领用人">
<el-input v-model="sizeForm.submitName" :disabled="outDialogType != 'add'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="填报人">
<el-input v-model="sizeForm.submitName" :disabled="outDialogType != 'add'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审批人">
<el-input v-model="sizeForm.applyNmae" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级入库确认">
<el-input v-model="sizeForm.applyNmae" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.radio" @change="radioChange()" :disabled="outDialogType != 'add'">
<el-radio-group v-model="sizeForm.options" @change="radioChange()" :disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2">批量选择</el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.radio==1">
<el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称">
<el-input v-model="sizeForm.xuqiudanmingcheng" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门" v-if="sizeForm.radio==1">
<el-input v-model="sizeForm.bumen" disabled></el-input>
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <div class="form-title">2025年04月05日出库信息</div> -->
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()">新增</el-button>
<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>
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="str1" label="编码" width="100">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="str2" label="名称" width="140">
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<el-select v-model="scope.row.str2" placeholder="请选择" style="width: 100%;" size="mini"
@change="changeName(scope.$index)">
<el-option label="名称一" value="1"></el-option>
<el-option label="名称二" value="2"></el-option>
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
v-if='inDialogType != "details" && sizeForm.options == 2' value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</el-table-column>
<el-table-column prop="str3" label="规格" width="100">
<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="str4" label="类别" width="100">
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column prop="str5" label="单位" width="100">
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='inDialogType != "details"'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName }}</span>
</template>
</el-table-column>
<el-table-column prop="str6" label="申请数量" width="100">
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
</el-table-column>
<el-table-column prop="yichuku" label="已出库" width="100">
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
</el-table-column>
<el-table-column prop="str7" label="出库数量" width="140">
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.str7" :min="1" style="width: 100%;"
:disabled="outDialogType != 'add'" v-if="scope.row.str7" @change="numberChange($event)"></el-input-number>
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
<!-- <span v-else>{{ scope.row.theInboundQuantity || 0 }}</span> -->
</template>
</el-table-column>
<el-table-column prop="str8" label="单价" width="100">
</el-table-column>
<!-- <el-table-column prop="status" label="出库情况">
<template slot-scope="scope">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">出库</el-button>
@ -115,42 +100,39 @@
</template>
</el-table-column> -->
</el-table>
<div class="form-title">出库账目表格</div>
<el-table :data="sizeForm.inAccountsTableData" border style="width: 100%">
<div class="form-title" v-if="outDialogType !== 'details'">出库账目表格</div>
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-if="outDialogType !== 'details'">
<el-table-column prop="date" label="当前库存" width="100">
<el-table-column prop="str1" label="编码" width="100">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="str2" label="名称" width="100">
<template slot-scope="scope">
<el-select v-if="sizeForm.radio == 2" v-model="sizeForm.type" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType != 'add'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
<span v-else>{{ scope.row.str2 }}</span>
</template>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="str3" label="规格" width="100">
<el-table-column prop="model" label="规格">
</el-table-column>
<el-table-column prop="str4" label="类别" width="100">
</el-table-column>
<el-table-column prop="str5" label="单位" width="100">
<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="str6" label="数量" width="100">
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2">
<template slot-scope="scope">
<span>
{{ getDepartmentName(scope.row.department) }}
</span>
</template>
</el-table-column>
<el-table-column prop="str7" label="单价" width="100">
<!-- <el-table-column prop="str6" label="数量" v-if="sizeForm.options == 1">
</el-table-column> -->
<el-table-column prop="theInboundQuantity" label="本次出库数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息" width="100">
<el-table-column prop="str8" label="数量" width="100">
</el-table-column>
<el-table-column prop="str9" label="单价" width="100">
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库后库存">
<el-table-column prop="str10" label="数量" width="100">
</el-table-column>
<el-table-column prop="str11" label="单价" width="100">
<el-table-column prop="date" label="出库后库存" v-if="sizeForm.options == 1">
<el-table-column prop="str10" label="数量">
</el-table-column>
</el-table-column>
@ -158,46 +140,46 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="save()">暂存</el-button>
<el-button type="primary" @click="sumbit()">提交</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">
width="40%" @close="handleBatchClose" @open="getQuarterList">
<el-form :model="inBatchForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-row>
<el-col :span="24">
<el-form-item label="需求单">
<el-select v-model="inBatchForm.batchType" placeholder="请选择" style="width: 100%;">
<el-option label="2025年1季度" value="1"></el-option>
<el-option label="2025年2季度" value="2"></el-option>
<el-option label="2025年3季度" value="3"></el-option>
<el-option label="2025年4季度" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="需求单">
<template slot-scope="scope">
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%;">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName" :value="item.ids">
</el-option>
</el-select>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="部门">
<el-select v-model="inBatchForm.bumen" placeholder="请选择" style="width: 100%;">
<el-option label="部门1" value="1"></el-option>
<el-option label="部门2" value="2"></el-option>
<el-option label="部门3" value="3"></el-option>
<el-option label="部门4" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="部门">
<el-select v-model="inBatchForm.department" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in departmentList" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleBatchClose()"> </el-button>
<el-button type="primary" @click="batchSumbit()"> </el-button>
<el-button type="primary" @click="batchSubmit()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList } from "@/api/firstOrder/outbound";
export default {
props: {
repairVisible: {
@ -212,31 +194,57 @@ export default {
type: String,
default: ''
},
type:{
type: {
type: String,
default: ''
},
id: {
type: Number,
default: 0
}
},
data() {
return {
quarterList: [],
departmentList: [],
outDialogVisible: false,
sizeForm: {
code: '',//
applyNmae: '',//
submitName: '',//
waNmae: '',//
argument: '',//
inAccountsTableData: [],//
orderNo: '',//
reason: '',//
// inAccountsTableData: [],//
inTableData: [],
ldOneOutStorageDetailVOList: [],
demandEndInfo: '',//
outDate: '',//
options: '',//
materialType: '1',//
status: '',//1 2
// materialld: '',//Id
userInfoVO: {
userId: "用户ID",
name: "用户名称"
},
},
uniqueListDialogVisible: false, //
uniqueList: [],
inTableData: [],
inBatchDialogVisible: false,//
batchType: '',//
inBatchForm:{
batchType:'',
bumen:''
batchType: '',//
inBatchForm: {
batchType: '',
department: ''
},
quarterYearMap: {},
quarterQuarterMap: {}
}
},
computed: {
outDate() {
const now = new Date()
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
return `${year}${month}${day}`;
}
},
mounted() {
@ -246,158 +254,322 @@ export default {
} else {
this.inInit()
}
this.getDetailedItems()
this.getMaterialList()
},
methods: {
//
syncInboundQuantity(row) {
row.theInboundQuantity = Number(row.theInboundQuantity);
},
//
handleCloseDetail() {
this.outDialogVisible = false
this.$emit('handleCloseDetail')
},
inInit() {
const randomNum = Math.floor(Math.random() * 100000000) + 1;
this.sizeForm.code = String(randomNum).padStart(8, '0');//
this.sizeForm.applyNmae = '审批人一'
this.sizeForm.submitName = '填报人一'
this.sizeForm.radio = 1
this.sizeForm.waNmae = '仓库一'
this.sizeForm.argument = '入库'
this.sizeForm.type = '1'
this.sizeForm.inDate = new Date()//
this.sizeForm.inTableData.push({
str1: '000001',
str2: '物品1',
str3: '规格1',
str4: '类别1',
str5: '单位1',
str6: '11',
str7: '22',
str8: '3',
str9: '33',
name: '审批人',
status: '1',//
yichuku:0,
})
},
addInit() {
//
const randomNum = Math.floor(Math.random() * 100000000) + 1;
this.sizeForm.code = String(randomNum).padStart(8, '0');//
this.sizeForm.inDate = new Date()//
if(this.type =='一级库'){
this.sizeForm.waNmae = '一级库'
//
async getQuarterList() {
try {
const res = await getQuarterList()
if (res.data && res.data.result) {
this.quarterList = res.data.result
this.quarterList.forEach(item => {
if (item.year && item.quarter && item.ids) {
this.quarterYearMap[item.ids] = item.year
this.quarterQuarterMap[item.ids] = item.quarter
this.sizeForm.inTableData.ldDemandEndId = item.ids
}
})
}
} catch (error) {
console.error('获取需求单列表失败:', error)
this.$message.error('获取需求单列表失败')
}
},
handleCloseDetail() {
this.inDialogVisible = false
this.$emit('handleCloseDetail')
},
//
inTableAdd() {
this.sizeForm.inTableData.push({
str1: '',
str2: '',
str3: '',
str4: '',
str5: '',
str6: '',
str7: 0,
name: '',
})
},
//
putIn(row) {
row.status = 0
//
this.sizeForm.inAccountsTableData.push({
str1: "000001",
str2: "物品1",
str3: "规格1",
str4: "类别1",
str5: "单位1",
str6: "12",
str7: "3",
str8: row.str7,
str9: "3",
str10: row.str7 + 12,
str11: "3",
str12: "审批人1",
str13: "2025-04-05",
})
//
async onQuarterSelectChange(ids) {
if (!ids) return
const year = this.quarterYearMap[ids]
const quarter = this.quarterQuarterMap[ids]
if (year && quarter) {
try {
const res = await getDepartmentList({
year: year,
quarter: quarter
})
if (res.data && res.data.result) {
this.departmentList = res.data.result
} else {
this.departmentList = []
}
} catch (error) {
this.$message.error('获取部门列表失败')
this.departmentList = []
}
} else {
this.departmentList = []
}
},
//
handleBatchClose() {
this.inBatchDialogVisible = false
},
//
batchSumbit() {
this.sizeForm.bumen='部门一'
this.sizeForm.xuqiudanmingcheng = '2025年一季度需求单'
this.sizeForm.inTableData.push({
str1: '000001',
str2: '物品1',
str3: '规格1',
str4: '类别1',
str5: '单位1',
str6: '11',
str7: '22',
str8: '3',
str9: '部门一',
name: '审批人',
status: '1',//
yichuku:98,
})
this.inBatchDialogVisible = false
async batchSubmit() {
if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单');
return;
}
if (!this.inBatchForm.department) {
this.$message.error('请选择部门');
return;
}
const res = await getDetailedList({
ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department
})
if (res.data && res.data.result) {
this.sizeForm.inTableData = res.data.result.duplicateList
const selectedDept = this.departmentList.find(
dept => dept.departmentId === this.inBatchForm.department
);
const deptName = selectedDept ? selectedDept.department : '';
this.sizeForm.inTableData = res.data.result.duplicateList.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;
}
} else {
this.$message.warning('未获取到详细数据');
}
},
//
save() {
this.$message({
type: "success",
message: "保存成功"
});
this.handleCloseDetail()
//
async getDetailedItems() {
this.loading = true
try {
const res = await getDetailedItems();
this.list = res.data.result
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
getDepartmentName(departmentId) {
const department = this.list.find(item => item.departmentId === departmentId);
return department ? department.department : '';
},
//
async getMaterialList() {
this.loading = true
try {
const res = await getMaterialList();
this.materials = res.data.result
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
//
handleMaterialChange(row, index) {
this.sizeForm.inTableData[index].materialId = row.materialId
this.sizeForm.inTableData[index].model = row.model
this.sizeForm.inTableData[index].materialCode = row.materialCode
this.sizeForm.inTableData[index].materialName = row.materialName
this.sizeForm.inTableData[index].type = row.type
this.sizeForm.inTableData[index].unit = row.unit
},
//
sumbit() {
this.$message({
type: "success",
message: "提交成功"
async submit(index) {
if (!this.sizeForm.reason) {
this.$message.error("事由不能为空");
return;
}
if (!this.sizeForm.materialType) {
this.$message.error("请选择物资类型");
return;
}
if (this.sizeForm.options === 1) {
if (!this.sizeForm.demandEndInfo) {
this.$message.error("请选择需求单名称");
return;
}
if (!this.sizeForm.inTableData || this.sizeForm.inTableData.length === 0) {
this.$message.error("请添加批量选择数据");
return;
}
if (this.sizeForm.options === 2) {
for (const row of this.sizeForm.inTableData) {
if (!row.departmentName) {
this.$message.error("请选择部门");
return;
}
}
}
}
// status == 1 2
this.sizeForm.status = index
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData
this.sizeForm.inTableData.forEach(row => {
row.departmentName = this.getDepartmentName(row.department);
});
this.handleCloseDetail()
this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department
this.sizeForm.inTableData = []
const res = await submitData(this.sizeForm)
console.log(res, '暂存提交数据')
if (res.data.success) {
this.$message({
type: "success",
message: "提交成功"
});
//
this.$emit('submitSuccess');
this.handleCloseDetail();
} else {
this.$message.error(res.data.message || "提交失败");
}
},
//
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,
// theInboundQuantity: item.theInboundQuantity || 0
}))
this.sizeForm = {
...this.sizeForm,
...ldOneOutStorage,
outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
options: Number(ldOneOutStorage.options) || 1,
}
this.sizeForm.inTableData = handledDetailList;
} catch (error) {
console.error("回显失败:", error);
this.$message.error("获取详情数据失败");
}
}
},
addInit() {
// //
// const randomNum = Math.floor(Math.random() * 100000000) + 1;
// this.sizeForm.code = String(randomNum).padStart(8, '0');//
this.sizeForm.outDate = new Date()//
},
//
inTableAdd() {
this.sizeForm.inTableData.push({})
},
// //
// // putIn(row) {
// // row.status = 0
// // //
// // this.sizeForm.inAccountsTableData.push({
// // str1: "000001",
// // str2: "1",
// // str3: "1",
// // str4: "1",
// // str5: "1",
// // str6: "12",
// // str7: "3",
// // str8: row.str7,
// // str9: "3",
// // str10: row.str7 + 12,
// // str11: "3",
// // str12: "1",
// // str13: "2025-04-05",
// // })
// // },
//
// //
// handleBatchClose() {
// this.inBatchDialogVisible = false
// },
// //
// batchSumbit() {
// this.sizeForm.bumen = ''
// this.sizeForm.xuqiudanmingcheng = '2025'
// this.sizeForm.inTableData.push({
// // str1: '000001',
// // str2: '1',
// // str3: '1',
// // str4: '1',
// // str5: '1',
// // str6: '11',
// // str7: '22',
// // str8: '3',
// // str9: '',
// // name: '',
// // status: '1',//
// // yichuku: 98,
// })
// this.inBatchDialogVisible = false
// },
//
radioChange(val) {
async radioChange() {
this.sizeForm.inTableData = []
if (this.sizeForm.radio == 1) {
if (this.sizeForm.options == 1) {
await this.getQuarterList() //
this.inBatchDialogVisible = true
}
},
//
changeName(index) {
console.log(9999, index)
this.sizeForm.inTableData.forEach((item,i)=>{
if(i==index){
item.str1= '000001'
item.str2= '物品1'
item.str3= '规格1'
item.str4= '类别1'
item.str5= '单位1'
item.str6= '11'
item.str7= 22
item.str8= '3'
item.str9= '部门一'
item.name= '审批人'
item.status= '1'
this.$set(item,'str7',22)
}
})
console.log(888888, this.sizeForm.inTableData)
},
// changeName(index) {
// console.log(9999, index)
// this.sizeForm.inTableData.forEach((item, i) => {
// if (i == index) {
// item.str1 = '000001'
// item.str2 = '1'
// item.str3 = '1'
// item.str4 = '1'
// item.str5 = '1'
// item.str6 = '11'
// item.str7 = 22
// item.str8 = '3'
// item.str9 = ''
// item.name = ''
// item.status = '1'
// this.$set(item, 'str7', 22)
// }
// })
// console.log(888888, this.sizeForm.inTableData)
// },
numberChange() {
this.$forceUpdate();//
console.log(77777, this.sizeForm.inTableData)
}
},
watch: {
//
'inBatchForm.batchType': function (newVal) {
if (newVal) {
this.onQuarterSelectChange(newVal)
}
}
}
}
</script>

@ -0,0 +1,586 @@
<template>
<div>
<el-dialog :close-on-click-modal="false" :title="outDialogTiltle" :visible.sync="outDialogVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<!-- 基本信息 -->
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库申请时间">
<el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期"
style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2">批量选择</el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称">
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
</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>
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
v-if='inDialogType != "details" && sizeForm.options == 2' value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName"
:value="item">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</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">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='inDialogType != "details"'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName }}</span>
</template>
</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>
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1"
style="width: 100%;" @change="syncInboundQuantity(scope.row)"
:disabled="outDialogType == 'details'"></el-input-number>
<!-- <span v-else>{{ scope.row.theInboundQuantity || 0 }}</span> -->
</template>
</el-table-column>
<!-- <el-table-column prop="status" label="出库情况">
<template slot-scope="scope">
<el-button type="text" @click="putIn(scope.row)" v-if="scope.row.status == 1">出库</el-button>
<span v-if="scope.row.status == 0">已出库</span>
</template>
</el-table-column> -->
</el-table>
<div class="form-title" v-if="outDialogType !== 'details'">出库账目表格</div>
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-if="outDialogType !== 'details'">
<el-table-column prop="date" label="当前库存" width="100">
<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="departmentName" label="部门" v-if="sizeForm.options == 2">
<template slot-scope="scope">
<span>
{{ getDepartmentName(scope.row.department) }}
</span>
</template>
</el-table-column>
<!-- <el-table-column prop="str6" label="数量" v-if="sizeForm.options == 1">
</el-table-column> -->
<el-table-column prop="theInboundQuantity" label="本次出库数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库后库存" v-if="sizeForm.options == 1">
<el-table-column prop="str10" label="数量">
</el-table-column>
</el-table-column>
</el-table>
</el-form>
<span slot="footer" class="dialog-footer">
<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">
<el-row>
<el-col :span="24">
<el-form-item label="需求单">
<template slot-scope="scope">
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%;">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName"
:value="item.ids">
</el-option>
</el-select>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="部门">
<el-select v-model="inBatchForm.department" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in departmentList" :key="item.departmentId"
:label="item.department" :value="item.departmentId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleBatchClose()"> </el-button>
<el-button type="primary" @click="batchSubmit()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList } from "@/api/firstOrder/outbound";
export default {
props: {
repairVisible: {
type: Boolean,
default: false
},
outDialogTiltle: {
type: String,
default: ''
},
outDialogType: {
type: String,
default: ''
},
type: {
type: String,
default: ''
},
id: {
type: Number,
default: 0
}
},
data() {
return {
quarterList: [],
departmentList: [],
outDialogVisible: false,
sizeForm: {
orderNo: '',//
reason: '',//
// inAccountsTableData: [],//
inTableData: [],
ldOneOutStorageDetailVOList: [],
demandEndInfo: '',//
outDate: '',//
options: '',//
materialType: '1',//
status: '',//1 2
// materialld: '',//Id
userInfoVO: {
userId: "用户ID",
name: "用户名称"
},
},
inTableData: [],
inBatchDialogVisible: false,//
batchType: '',//
inBatchForm: {
batchType: '',
department: ''
},
quarterYearMap: {},
quarterQuarterMap: {}
}
},
computed: {
outDate() {
const now = new Date()
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
return `${year}${month}${day}`;
}
},
mounted() {
this.outDialogVisible = this.repairVisible
if (this.outDialogType == 'add') {
this.addInit()
} else {
this.inInit()
}
this.getDetailedItems()
this.getMaterialList()
},
methods: {
//
syncInboundQuantity(row) {
row.theInboundQuantity = Number(row.theInboundQuantity);
},
//
handleCloseDetail() {
this.outDialogVisible = false
this.$emit('handleCloseDetail')
},
//
async getQuarterList() {
try {
const res = await getQuarterList()
if (res.data && res.data.result) {
this.quarterList = res.data.result
this.quarterList.forEach(item => {
if (item.year && item.quarter && item.ids) {
this.quarterYearMap[item.ids] = item.year
this.quarterQuarterMap[item.ids] = item.quarter
this.sizeForm.inTableData.ldDemandEndId = item.ids
}
})
}
} catch (error) {
console.error('获取需求单列表失败:', error)
this.$message.error('获取需求单列表失败')
}
},
//
async onQuarterSelectChange(ids) {
if (!ids) return
const year = this.quarterYearMap[ids]
const quarter = this.quarterQuarterMap[ids]
if (year && quarter) {
try {
const res = await getDepartmentList({
year: year,
quarter: quarter
})
if (res.data && res.data.result) {
this.departmentList = res.data.result
} else {
this.departmentList = []
}
} catch (error) {
this.$message.error('获取部门列表失败')
this.departmentList = []
}
} else {
this.departmentList = []
}
},
//
handleBatchClose() {
this.inBatchDialogVisible = false
},
async batchSubmit() {
if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单');
return;
}
if (!this.inBatchForm.department) {
this.$message.error('请选择部门');
return;
}
const res = await getDetailedList({
ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department
})
if (res.data.result.uniqueList) {
}
if (res.data && res.data.result) {
this.sizeForm.inTableData = res.data.result.duplicateList
const selectedDept = this.departmentList.find(
dept => dept.departmentId === this.inBatchForm.department
);
const deptName = selectedDept ? selectedDept.department : '';
this.sizeForm.inTableData = res.data.result.duplicateList.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;
}
} else {
this.$message.warning('未获取到详细数据');
}
},
//
async getDetailedItems() {
this.loading = true
try {
const res = await getDetailedItems();
this.list = res.data.result
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
getDepartmentName(departmentId) {
const department = this.list.find(item => item.departmentId === departmentId);
return department ? department.department : '';
},
//
async getMaterialList() {
this.loading = true
try {
const res = await getMaterialList();
this.materials = res.data.result
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
//
handleMaterialChange(row, index) {
this.sizeForm.inTableData[index].materialId = row.materialId
this.sizeForm.inTableData[index].model = row.model
this.sizeForm.inTableData[index].materialCode = row.materialCode
this.sizeForm.inTableData[index].materialName = row.materialName
this.sizeForm.inTableData[index].type = row.type
this.sizeForm.inTableData[index].unit = row.unit
},
//
async submit(index) {
if (!this.sizeForm.reason) {
this.$message.error("事由不能为空");
return;
}
if (!this.sizeForm.materialType) {
this.$message.error("请选择物资类型");
return;
}
if (this.sizeForm.options === 1) {
if (!this.sizeForm.demandEndInfo) {
this.$message.error("请选择需求单名称");
return;
}
if (!this.sizeForm.inTableData || this.sizeForm.inTableData.length === 0) {
this.$message.error("请添加批量选择数据");
return;
}
if (this.sizeForm.options === 2) {
for (const row of this.sizeForm.inTableData) {
if (!row.departmentName) {
this.$message.error("请选择部门");
return;
}
}
}
}
// status == 1 2
this.sizeForm.status = index
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData
this.sizeForm.inTableData.forEach(row => {
row.departmentName = this.getDepartmentName(row.department);
});
this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department
this.sizeForm.inTableData = []
const res = await submitData(this.sizeForm)
console.log(res, '暂存提交数据')
if (res.data.success) {
this.$message({
type: "success",
message: "提交成功"
});
//
this.$emit('submitSuccess');
this.handleCloseDetail();
} else {
this.$message.error(res.data.message || "提交失败");
}
},
//
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,
// theInboundQuantity: item.theInboundQuantity || 0
}))
this.sizeForm = {
...this.sizeForm,
...ldOneOutStorage,
outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
options: Number(ldOneOutStorage.options) || 1,
}
this.sizeForm.inTableData = handledDetailList;
} catch (error) {
console.error("回显失败:", error);
this.$message.error("获取详情数据失败");
}
}
},
addInit() {
// //
// const randomNum = Math.floor(Math.random() * 100000000) + 1;
// this.sizeForm.code = String(randomNum).padStart(8, '0');//
this.sizeForm.outDate = new Date()//
},
//
inTableAdd() {
this.sizeForm.inTableData.push({})
},
// //
// // putIn(row) {
// // row.status = 0
// // //
// // this.sizeForm.inAccountsTableData.push({
// // str1: "000001",
// // str2: "1",
// // str3: "1",
// // str4: "1",
// // str5: "1",
// // str6: "12",
// // str7: "3",
// // str8: row.str7,
// // str9: "3",
// // str10: row.str7 + 12,
// // str11: "3",
// // str12: "1",
// // str13: "2025-04-05",
// // })
// // },
//
// //
// handleBatchClose() {
// this.inBatchDialogVisible = false
// },
// //
// batchSumbit() {
// this.sizeForm.bumen = ''
// this.sizeForm.xuqiudanmingcheng = '2025'
// this.sizeForm.inTableData.push({
// // str1: '000001',
// // str2: '1',
// // str3: '1',
// // str4: '1',
// // str5: '1',
// // str6: '11',
// // str7: '22',
// // str8: '3',
// // str9: '',
// // name: '',
// // status: '1',//
// // yichuku: 98,
// })
// this.inBatchDialogVisible = false
// },
//
async radioChange() {
this.sizeForm.inTableData = []
if (this.sizeForm.options == 1) {
await this.getQuarterList() //
this.inBatchDialogVisible = true
}
},
//
// changeName(index) {
// console.log(9999, index)
// this.sizeForm.inTableData.forEach((item, i) => {
// if (i == index) {
// item.str1 = '000001'
// item.str2 = '1'
// item.str3 = '1'
// item.str4 = '1'
// item.str5 = '1'
// item.str6 = '11'
// item.str7 = 22
// item.str8 = '3'
// item.str9 = ''
// item.name = ''
// item.status = '1'
// this.$set(item, 'str7', 22)
// }
// })
// console.log(888888, this.sizeForm.inTableData)
// },
numberChange() {
this.$forceUpdate();//
console.log(77777, this.sizeForm.inTableData)
}
},
watch: {
//
'inBatchForm.batchType': function (newVal) {
if (newVal) {
this.onQuarterSelectChange(newVal)
}
}
}
}
</script>
<style lang="scss" scoped>
.form-title {
margin: 20px 0;
}
</style>

@ -1,24 +1,29 @@
<template>
<basic-container>
<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"
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" @row-click="rowSelect">
@refresh-change="refreshChange" @on-load="onLoad" >
<!-- @row-click="rowSelect" -->
<template slot-scope="scope" slot="menuLeft">
<el-button size="small" plain @click.stop="handleDesign()">新增出库单
<el-button size="small" plain @click="handleDesign()">新增出库单
</el-button>
<el-button size="small" plain @click.stop="handleExport()">出库单导出
<el-button size="small" plain @click="handleExport()">出库单导出
</el-button>
</template>
<template slot-scope="scope" slot="xuqiudanmingcheng">
<el-button type="text" @click.stop="purchaseFn(scope.row)"
v-if="scope.row.xuqiudanmingcheng != ''">{{ scope.row.xuqiudanmingcheng }}</el-button>
<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 v-else></span>
</template>
<template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
<el-button type="text" v-if="scope.row.status == 1" @click.stop="handleEdit(scope.row)">编辑</el-button>
</template>
</avue-crud>
<outDialog v-if="outDialogVisible" :repairVisible='outDialogVisible' :outDialogTiltle="outDialogTiltle"
:outDialogType="outDialogType" @handleCloseDetail="handleCloseDetail" type="一级库">
:outDialogType="outDialogType" @handleCloseDetail="handleCloseDetail" type="一级库" @submitSuccess="handleSubmitSuccess"
:id="id">
</outDialog>
<!-- 需求单明细 -->
@ -29,11 +34,10 @@
</template>
<script>
import { getList, remove } from "@/api/report/report";
import { mapGetters } from "vuex";
import { getList } from "@/api/firstOrder/outbound";
// import { mapGetters } from "vuex";
import outDialog from './components/outDialog.vue';
import needDialog from './components/needDialog.vue';
export default {
components: {
outDialog,
@ -41,7 +45,8 @@ export default {
},
data() {
return {
form: {},
// form: {},
form: { outDate: [] },
selectionList: [],
query: {},
loading: true,
@ -59,7 +64,10 @@ export default {
border: true,
index: true,
selection: true,
viewBtn: true,
viewBtn: false,
editBtn: false,
delBtn: false,
addBtn: false,
dialogClickModal: false,
selection: false,
printBtn: false,
@ -69,144 +77,156 @@ export default {
gridSpan: false,
filterBtn: false,
columnBtn: false,
menu: false,
menuWidth: 120,
menu: true,
column: [
{
label: "需求单名称",
prop: "xuqiudanmingcheng",
prop: "demandEndInfo",
width: 180,
},
{
label: "部门",
prop: "bumen",
},
{
label: "仓库类型",
prop: "str1",
},
{
label: "出库单号",
prop: "str2",
prop: "orderNo",
width: 110
},
{
label: "出库时间",
prop: "str3",
label: "出库日期",
prop: "outDate",
search: true,
type: "datetime",
searchRange: true,
startPlaceholder: '开始时间',
endPlaceholder: "结束时间",
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 140,
// searchParam: 'startTime',
// searchEndParam: 'endTime'
},
{
label: "出库人",
prop: "str4",
search: true,
label: "事由",
prop: "reason",
search: false,
},
{
label: "审批人",
prop: "str5",
label: "物资类型",
prop: "materialType",
search: false,
type: 'select',
dicData: [{
label: '办公物资',
value: '1'
},
{
label: '其他物资',
value: '2'
}]
},
{
label: "来源",
prop: "str6",
search: true,
label: "部门",
prop: "department",
},
{
label: "状态",
prop: "str7",
type: 'select',
dicData: [
{
label: '暂存',
value: 1
},
{
label: '待确认',
value: 2
}, {
label: '确认',
value: 3
}
]
label: "出库人",
prop: "shipperName",
search: true,
searchParam: 'inOperator'
},
// {
// label: "",
// prop: "status",
// type: 'select',
// dicData: [
// {
// label: '',
// value: 1
// },
// {
// label: '',
// value: 2
// },
// {
// label: '',
// value: 3
// },
// ]
// },
]
},
data: [],
outDialogVisible: false,
outDialogTiltle: '出库',
outDialogType: '',
purchaseOpen: false
outDialogType: '',//
purchaseOpen: false,
purchaseTitle: '',
inTitle: '',
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
purchaseFn(row) {
this.purchaseOpen = true
this.purchaseTitle = row.xuqiudanmingcheng + '详情'
},
closeDialog() {
this.purchaseOpen = false
},
handlePreview() {
// this.$router.push({ path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.design.reportUrl}/preview?_u=blade-${name}` });
},
handleDesign() {
this.outDialogVisible = true
this.outDialogType = 'add'
this.outDialogTiltle = '新增出库'
},
//
rowSelect(row) {
//
handleDetails(row) {
this.outDialogVisible = true
this.outDialogType = 'outbound'
this.outDialogTiltle = '出库'
this.outDialogType = 'details'
this.outDialogTiltle = '详情'
this.id = row.id
console.log(this.id,'id')
},
//
handleEdit(row) {
this.outDialogVisible = true
this.outDialogType = 'edit'
this.outDialogTiltle = '编辑'
this.id = row.id
},
//
purchaseFn(row) {
this.purchaseOpen = true
this.purchaseTitle = row.purchaseEndInfo + '需求单详情'
this.id = row.id
},
closeDialog() {
this.purchaseOpen = false
},
handleCloseDetail() {
this.outDialogVisible = false
},
handleExport(name) {
handleExport() {
this.$message({
type: "success",
message: "出库单导出成功!"
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
//
rowSelect() {
this.outDialogVisible = true
this.outDialogType = 'outbound'
this.outDialogTiltle = '出库'
},
searchReset() {
this.query = {};
this.form.outDate = []
this.form.inOperatorName = ''
this.form.inOperator = ''
this.onLoad(this.page);
},
searchChange(params, done) {
if (params && params.inOperatorName && !params.inOperator) {
params.inOperator = params.inOperatorName;
delete params.inOperatorName;
}
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
@ -219,28 +239,7 @@ export default {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
@ -250,50 +249,33 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
//
handleSubmitSuccess() {
console.log(2)
console.log('父组件更新')
this.onLoad(this.page)
console.log('父组件更新完成')
},
//
onLoad(page, params = {}) {
this.loading = true;
this.data.push({
xuqiudanmingcheng: '20225年一季度需求单',
bumen: '部门1',
str1: '类型一',
str2: '00000001',
str3: '2025-03-01',
str4: '员工一',
str5: '员工二',
str6: '采购',
str7: '1',
}, {
xuqiudanmingcheng: '20225年二季度需求单',
bumen: '部门2',
str1: '类型二',
str2: '00000002',
str3: '2025-03-02',
str4: '员工一',
str5: '员工二',
str6: '单项',
str7: '2',
}, {
xuqiudanmingcheng: '',
bumen: '部门3',
str1: '类型二',
str2: '00000002',
str3: '2025-03-02',
str4: '员工3',
str5: '员工3',
str6: '单项',
str7: '3',
}, {
xuqiudanmingcheng: '',
bumen: '部门3',
str1: '类型二',
str2: '00000002',
str3: '2025-03-02',
str4: '员工3',
str5: '员工3',
str6: '单项',
str7: '1',
})
this.loading = false
const queryParams = {
...params,
...this.query,
pageSize: page.pageSize,
pageNum: page.currentPage
};
if (queryParams.outDate && Array.isArray(queryParams.outDate)) {
queryParams.startTime = queryParams.outDate[0];
queryParams.endTime = queryParams.outDate[1];
delete queryParams.outDate;
}
getList(page.currentPage, page.pageSize, queryParams).then(res => {
console.log('列表', res.data.result)
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
}
}
};

Loading…
Cancel
Save