oa初步完成

This commit is contained in:
2024-11-16 20:08:00 +08:00
parent 17ef95ebae
commit 76403c1cf8
35 changed files with 1157 additions and 93 deletions

View File

@@ -53,20 +53,35 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="outWareHouseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="项目名" align="center" prop="projectName"/>
<el-table-column label="创建时间" align="center" prop="createtime"/>
<el-table-column label="出库单" align="center" prop="id"/>
<el-table-column label="物料名" align="center" prop="warehouseName"/>
<el-table-column label="出库数量" align="center" prop="amount"/>
<el-table-column label="关联项目" align="center" prop="projectName">
<template slot-scope="scope">
<div v-if="scope.row.projectName!==null">
<el-tooltip class="item" effect="dark" content="点击查看该项目出库情况" placement="bottom">
<el-button
size="mini"
type="text"
@click="handleSearch(scope.row)"
> {{ scope.row.projectName }}
</el-button>
</el-tooltip>
</div>
<div v-else>未关联项目</div>
</template>
</el-table-column>
<el-table-column label="出库时间" align="center" prop="createTime"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-search"
@click="handleSearch(scope.row)"
v-hasPermi="['oa:oaOutWarehouse:remove']"
@click="showDetail(scope.row)"
>查看详情
</el-button>
</template>
@@ -81,10 +96,128 @@
@pagination="getList"
/>
<!-- 详情描述弹窗 -->
<el-dialog title="出库物料详情" :visible.sync="detail" width="800px" append-to-body>
<!-- 物料数据 -->
<el-descriptions class="margin-top" title="物料数据" :column="3" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-order"></i>
出库单
</template>
{{outDetail.id}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-postcard"></i>
出库数量{{warehouseDetail.unit}}
</template>
{{ outDetail.amount }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-collection"></i>
物料名
</template>
{{ warehouseDetail.name }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
操作人
</template>
{{ outDetail.createBy }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-date"></i>
出库时间
</template>
{{ outDetail.createTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-collection"></i>
关联项目
</template>
{{projectDetail==null?'未关联项目':projectDetail.projectName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
{{outDetail.remark==null?'空':outDetail.remark}}
</el-descriptions-item>
</el-descriptions>
<!-- 项目数据 如果有的话显示 -->
<el-descriptions v-if="projectDetail!==null" class="margin-top" title="项目数据" :column="3" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-order"></i>
项目编号
</template>
{{ projectDetail.projectNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-flag"></i>
项目名
</template>
{{outDetail.id}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-s-opportunity"></i>
项目状态
</template>
<el-tag> {{projectDetail.projectStatus==0?'未完结':'结项'}} </el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
{{projectDetail.remark==null?'空':projectDetail.remark}}
</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button @click="detail = false">关闭</el-button>
</div>
</el-dialog>
<!-- 添加或修改仓库出库对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item
label="绑定项目"
>
<el-radio-group v-model="projectFlag">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="projectFlag"
prop="projectId"
label="项目名"
>
@@ -98,6 +231,19 @@
</el-select>
</el-form-item>
<el-form-item
v-else
prop="remark"
label="备注"
>
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
placeholder="请输入内容"
v-model="form.remark">
</el-input>
</el-form-item>
<el-form-item
v-for="(item, index) in form.outWareHouseList"
:label="'出库物料' + index"
@@ -132,7 +278,7 @@
</el-col>
<el-col :span="4">
<el-tag type="info" v-if="item.inventory===undefined">请选择物料</el-tag>
<el-tag type="info" v-else>{{item.inventory}}</el-tag>
<el-tag type="info" v-else>{{ item.inventory }}</el-tag>
</el-col>
<el-col :span="8">
<el-input-number v-model="item.amount" :min="1" :max="item.inventory"></el-input-number>
@@ -187,7 +333,7 @@
<el-table v-loading="loading" :data="oaOutWarehouseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="物料名" align="center" prop="warehouseName"/>
<el-table-column label="出库单" align="center" prop="id"/>
<el-table-column label="出库数量" align="center" prop="amount"/>
<el-table-column label="出库时间" align="center" prop="createTime"/>
<el-table-column label="备注" align="center" prop="remark"/>
@@ -229,7 +375,16 @@ export default {
return {
// 抽屉
drawer: false,
// 查看详情弹窗
outDetail:{},
// 弹窗标志
detail:false,
// 绑定项目详情
projectDetail:{},
// 物料信息详情
warehouseDetail:{},
// 出库列表
outWareHouseList: [],
// 按钮loading
buttonLoading: false,
// 遮罩层
@@ -254,8 +409,11 @@ export default {
title: "",
// 选择对象
searchItem: {},
// 是否显示弹出层
open: false,
// 是否绑定项目
projectFlag: false,
// 库存查询参数
warehouseParams: {
pageSize: 999,
@@ -264,11 +422,12 @@ export default {
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
projectName: undefined,
pageSize: 10
},
// 表单参数
form: {},
form: {
productId: ''
},
// 表单校验
rules: {
amount: [
@@ -287,10 +446,15 @@ export default {
/** 查询仓库出库列表 */
getList() {
this.loading = true;
listOaOutWarehouse(this.queryParams).then(res => {
this.outWareHouseList = res.rows
this.total = res.total
this.loading = false
})
listProject(this.queryParams).then(response => {
this.projectList = response.rows
this.total = response.total;
this.loading = false;
});
},
@@ -400,6 +564,7 @@ export default {
addDomain() {
this.form.outWareHouseList.push({
value: '',
warehouseId: '',
key: Date.now()
});
},
@@ -410,8 +575,8 @@ export default {
}
},
handleGetInventory(e,index){
this.form.outWareHouseList[index].inventory = this.oaWarehouseList[this.oaWarehouseList.findIndex(item=>item.id===e)].inventory
handleGetInventory(e, index) {
this.form.outWareHouseList[index].inventory = this.oaWarehouseList[this.oaWarehouseList.findIndex(item => item.id === e)].inventory
console.log(this.form.outWareHouseList[index])
},
@@ -432,6 +597,12 @@ export default {
};
},
getOaOutWarehouseList(){
listOaWarehouse(this.warehouseParams).then(res => {
this.oaWarehouseList = res.rows
})
},
remoteMethod(query) {
this.warehouseParams.name = query
this.selectLoading = true;
@@ -454,6 +625,19 @@ export default {
this.drawer = true;
this.loading = false;
})
},
// 查看出库单独条目详情
showDetail(row){
getOaOutWarehouse(row.id).then(response => {
console.log(response.data);
this.outDetail = response.data;
this.projectDetail = response.data.project;
this.warehouseDetail = response.data.warehouse;
})
this.detail=true;
}
}
};