领料申请

This commit is contained in:
jjLv 2024-11-15 19:07:10 +08:00
parent b9603f1ccc
commit d1fd246499
2 changed files with 502 additions and 409 deletions

View File

@ -9,7 +9,7 @@
:inline="true"
label-width="120px"
>
<el-form-item label="租赁单位" prop="leaseUnitId">
<!-- <el-form-item label="租赁单位" prop="leaseUnitId">
<el-select
v-model="maForm.leaseUnitId"
placeholder="请选择租赁单位"
@ -25,23 +25,32 @@
:value="item.unitId"
/>
</el-select>
</el-form-item> -->
<el-form-item label="租赁单位" prop="leaseUnitId">
<el-cascader
v-model="unitId"
:show-all-levels="false"
:options="uniteList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
@change="uniteChange"
placeholder="请选择退料单位"
></el-cascader>
</el-form-item>
<el-form-item label="租赁工程" prop="leaseProjectId">
<el-select
v-model="maForm.leaseProjectId"
placeholder="请选择租赁工程"
clearable
<el-cascader
v-model="projectId"
:show-all-levels="false"
:options="projectList"
:props="selectTreeProps"
filterable
style="width: 240px"
clearable
collapse-tags
@change="projectChange"
>
<el-option
v-for="item in projectList"
:key="item.proId"
:label="item.proName"
:value="item.proId"
/>
</el-select>
placeholder="请选择租赁工程"
></el-cascader>
</el-form-item>
<el-form-item label="领料人" prop="leasePerson">
<el-input
@ -226,6 +235,13 @@ export default {
showSearch: true,
//
total: 0,
selectTreeProps: {
children: "children",
label: "name",
// multiple: false,
value: "id",
// multiple: true,
},
//
uniteList: [],
//
@ -239,6 +255,8 @@ export default {
//
open: false,
rowData: {},
unitId: null,
projectId: null,
//
queryParams: {
equipmentId: undefined,
@ -334,26 +352,41 @@ export default {
},
methods: {
uniteChange(val) {
this.projectList = [];
this.$set(this.maForm, "leaseProjectId", null);
getListProject({ unitId: val }).then((response) => {
// this.projectList = [];
if (val && val.length > 0) {
this.maForm.unitId = this.unitId[this.unitId.length - 1];
} else if (val && val.length == 0) {
this.maForm.unitId = "";
}
// this.$set(this.maForm, "leaseProjectId", null);
getListProject({ unitId: this.maForm.unitId }).then((response) => {
this.projectList = response.data;
});
this.unitTemp = val;
this.unitTemp = this.unitid;
},
projectChange(val) {
this.maForm.leaseProjectId = val;
this.projectTemp = val;
console.log("projectTemp", this.projectTemp);
if (val && val.length > 0) {
this.maForm.projectId = this.projectId[this.projectId.length - 1];
} else if (val && val.length == 0) {
this.maForm.projectId = "";
}
getListUnite({ projectId: this.maForm.projectId }).then((response) => {
this.uniteList = response.data;
});
// this.maForm.leaseProjectId = val;
this.projectTemp = this.projectId;
},
/** 租赁单位和工程-下拉选 */
projectInfoList() {
if (!this.isEdit) {
getListUnite({ id: null }).then((response) => {
getListUnite({ projectId: null }).then((response) => {
this.uniteList = response.data;
});
getListProject({ unitId: null }).then((response) => {
this.projectList = response.data;
});
} else {
getListUnite({ id: null }).then((response) => {
getListUnite({ projectId: null }).then((response) => {
this.uniteList = response.data;
});
console.log("maForm", this.maForm.leaseUnitId);
@ -365,6 +398,14 @@ export default {
// this.projectList = response.data;
// });
},
// filterTree(nodes) {
// return nodes.map((node) => {
// if (node.children) {
// node.children = this.filterTree(node.children);
// }
// return node;
// });
// },
//
// changeSupplier(supplierId) {
// this.equipmentList.forEach((item) => {
@ -469,8 +510,8 @@ export default {
if (valid) {
console.log("projectId", this.projectTemp);
await getAgreement({
unitId: this.unitTemp,
projectId: this.projectTemp,
unitId: this.maForm.unitId,
projectId: this.maForm.projectId,
}).then((response) => {
this.agreementId = response.data.agreementId;
this.maForm.agreementId = this.agreementId;

View File

@ -1,49 +1,64 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item prop="keyWord">
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键词"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['machinery:type:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">
v-model="queryParams.keyWord"
placeholder="请输入关键词"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['machinery:type:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
@ -56,371 +71,408 @@
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="teamId">
<!-- <el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" prop="houseName" sortable/>
<el-table-column label="实物库" align="center" prop="physicalName" sortable/>
<el-table-column label="地理位置" align="center" prop="geoLocation" sortable/>
<el-table-column label="所属组织" align="center" prop="deptName" sortable>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" sortable>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:type:edit']"
>
编辑
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:type:del']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
<el-table
v-loading="loading"
:data="houseList"
ref="multipleTable"
row-key="teamId"
>
<!-- <el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
}}</span>
</template>
</el-table-column>
<el-table-column
label="仓库名称"
align="center"
prop="houseName"
sortable
/>
<!-- 新增或修改弹窗 -->
<el-dialog :title="title" :visible.sync="showHouse" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" >
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="仓库名称" prop="houseName">
<el-input v-model="form.houseName" placeholder="请输入仓库名称" maxlength="20"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="地理位置" prop="geoLocation">
<el-input v-model="form.geoLocation" placeholder="请输入地理位置" maxlength="20">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="实物库" prop="physicalName">
<el-input v-model="form.physicalName" placeholder="请输入实物库" maxlength="20">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-table-column
label="实物库"
align="center"
prop="physicalName"
sortable
/>
<el-table-column
label="地理位置"
align="center"
prop="geoLocation"
sortable
/>
<el-table-column label="所属组织" align="center" prop="deptName" sortable>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" sortable>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:type:edit']"
>
编辑
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:type:del']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row :gutter="24">
<el-col :span="20">
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-form-item label="所属组织" prop="deptId">
<treeselect v-model="form.deptId" :searchable="false" :disable-branch-nodes="true" :options="deptOptions"
:show-count="true" placeholder="请选择所属组织"
<!-- 新增或修改弹窗 -->
<el-dialog
:title="title"
:visible.sync="showHouse"
width="600px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="仓库名称" prop="houseName">
<el-input
v-model="form.houseName"
placeholder="请输入仓库名称"
maxlength="20"
/>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="地理位置" prop="geoLocation">
<el-input
v-model="form.geoLocation"
placeholder="请输入地理位置"
maxlength="20"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="实物库" prop="physicalName">
<el-input
v-model="form.physicalName"
placeholder="请输入实物库"
maxlength="20"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="5"
placeholder="请输入备注"
v-model="form.remark"
maxlength="50"
show-word-limit
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="所属组织" prop="deptId">
<treeselect
v-model="form.deptId"
:searchable="false"
:disable-branch-nodes="true"
:options="deptOptions"
:show-count="true"
placeholder="请选择所属组织"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="5"
placeholder="请输入备注"
v-model="form.remark"
maxlength="50"
show-word-limit
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getListHouse,getHouseDetail,editHouse,addHouse,delHouse } from "@/api/ma/whHouse";
import { downloadFile } from '@/utils/download'
import {deptTreeSelect,} from '@/api/system/user'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "whHouse",
data() {
return {
//
loading: false,
loadingTwo: false,
// Id
showName: false,
//
showWarn: false,
import {
getListHouse,
getHouseDetail,
editHouse,
addHouse,
delHouse,
} from "@/api/ma/whHouse";
import { downloadFile } from "@/utils/download";
import { deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "whHouse",
data() {
return {
//
loading: false,
//
single: true,
//
multiple: true,
//
showSearch: true,
showHouse: false,
//
deptOptions: undefined,
loadingTwo: false,
// Id
showName: false,
//
total: 0,
totalTwo : 0,
//
houseList: [],
maxLength:100,//
keeperDataRange:[],
//
teamList: [],
teamTempList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:undefined
},
//
queryTeam: {
pageNum: 1,
pageSize: 10,
name: undefined,
sex: undefined,
teamId: undefined,
//
showWarn: false,
//
single: true,
//
multiple: true,
//
showSearch: true,
showHouse: false,
//
deptOptions: undefined,
//
total: 0,
totalTwo: 0,
//
houseList: [],
maxLength: 100, //
keeperDataRange: [],
//
teamList: [],
teamTempList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
},
//
queryTeam: {
pageNum: 1,
pageSize: 10,
name: undefined,
sex: undefined,
teamId: undefined,
},
//
form: {},
//
rules: {
houseName: [
{
required: true,
message: "仓库名称不能为空",
trigger: "blur",
},
//
form: {},
//
rules: {
houseName: [
{
required: true,
message: '仓库名称不能为空',
trigger: 'blur',
},
],
geoLocation: [
{
required: false,
message: '地理位置不能为空',
trigger: 'blur',
},
],
physicalName: [
{
required: false,
message: '实物库不能为空',
trigger: 'blur',
},
],
leasePrice: [
{
required: true,
message: '请选择所属组织',
trigger: 'change',
},
],
remark: [
{
required: false,
message: '备注不能为空',
trigger: 'blur',
},
],
},
};
},
created() {
this.getDeptTree()
this.getList();
},
components: { Treeselect },
methods: {
],
geoLocation: [
{
required: false,
message: "地理位置不能为空",
trigger: "blur",
},
],
physicalName: [
{
required: false,
message: "实物库不能为空",
trigger: "blur",
},
],
leasePrice: [
{
required: true,
message: "请选择所属组织",
trigger: "change",
},
],
remark: [
{
required: false,
message: "备注不能为空",
trigger: "blur",
},
],
},
};
},
created() {
this.getDeptTree();
this.getList();
},
components: { Treeselect },
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then(response => {
this.deptOptions = this.filterTree(response.data)
})
deptTreeSelect().then((response) => {
this.deptOptions = this.filterTree(response.data);
});
},
filterTree(nodes) {
return nodes
.map(node => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter(node => node.status !== '1')
return nodes.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children);
}
return node;
});
},
/** 查询岗位列表 */
getList() {
this.loading = true;
getListHouse(this.queryParams).then(response => {
this.houseList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 查询岗位列表 */
getList() {
this.loading = true;
getListHouse(this.queryParams).then((response) => {
this.houseList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.showHouse = true
this.title = '新增'
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.showHouse = true;
this.title = "新增";
},
handleUpdate(row){
this.reset()
const houseId = row.houseId
getHouseDetail(houseId).then((response) => {
this.form = response.data;
this.showHouse = true
this.title = '修改'
})
},
//
reset() {
this.form = {};
this.resetForm("form");
},
handleUpdate(row) {
this.reset();
const houseId = row.houseId;
getHouseDetail(houseId).then((response) => {
this.form = response.data;
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord=null;
this.handleQuery();
},
this.showHouse = true;
this.title = "修改";
});
},
//
reset() {
this.form = {};
this.resetForm("form");
},
//** */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.houseId != undefined) {
editHouse(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.showHouse = false;
this.getList();
});
} else {
addHouse(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.showHouse = false;
this.getList();
});
}
}
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord = null;
this.handleQuery();
},
//** */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.houseId != undefined) {
editHouse(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.showHouse = false;
this.getList();
});
},
} else {
addHouse(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.showHouse = false;
this.getList();
});
}
}
});
},
//
cancel() {
this.showHouse = false;
this.reset();
},
//
cancel() {
this.showHouse = false;
this.reset();
},
/** 删除按钮操作 */
handleDelete(row) {
const houseIds = row.houseId
this.$modal
.confirm('是否确认删除数据项?')
.then(function () {
return delHouse(houseIds)
})
.then(() => {
this.$modal.msgSuccess('删除成功')
this.getList()
})
.catch(() => {})
},
handleExport() {
this.download('/material/wh_house_info/export', {
...this.queryParams
}, `仓库管理_${new Date().getTime()}.xlsx`)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 删除按钮操作 */
handleDelete(row) {
const houseIds = row.houseId;
this.$modal
.confirm("是否确认删除数据项?")
.then(function () {
return delHouse(houseIds);
})
.then(() => {
this.$modal.msgSuccess("删除成功");
this.getList();
})
.catch(() => {});
},
}
};
</script>
handleExport() {
this.download(
"/material/wh_house_info/export",
{
...this.queryParams,
},
`仓库管理_${new Date().getTime()}.xlsx`
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
},
};
</script>
<style lang="scss" scoped>
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
.uploadImg {
padding-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>
}
</style>