feat:计划借调管理接口联调

This commit is contained in:
jackal 2024-04-11 18:01:25 +08:00
parent 02d87beddb
commit 3face37c91
3 changed files with 261 additions and 113 deletions

View File

@ -339,3 +339,11 @@ export function getPlanList(query) {
params: query, params: query,
}); });
} }
//
export function addOrUpdateMange(data) {
return request({
url: "/material/planManagement/addOrUpdateMange",
method: "post",
data: data,
});
}

View File

@ -1,13 +1,21 @@
<template> <template>
<div class="app-container" id="planSecond"> <div class="app-container" id="planSecond">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="名称" prop="dictName"> <el-form-item label="名称" prop="dictName">
<el-input <el-input
v-model="queryParams.dictName" v-model="queryParams.dictName"
placeholder="请输入名称" placeholder="请输入名称"
clearable maxlength="50" clearable
style="width: 240px" maxlength="50"
@keyup.enter.native="handleQuery" style="width: 240px"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -20,22 +28,22 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['store:labelType:add']" v-hasPermi="['store:labelType:add']"
>计划借调</el-button> >计划借调</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['store:labelType:export']" v-hasPermi="['store:labelType:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
@ -53,7 +61,7 @@
<el-table-column label="现计划数" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="现计划数" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="借入方单位" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="借入方单位" align="center" prop="dictName" :show-overflow-tooltip="true" />
<!-- <el-table-column label="原计划数" align="center" prop="dictName" :show-overflow-tooltip="true" />--> <!-- <el-table-column label="原计划数" align="center" prop="dictName" :show-overflow-tooltip="true" />-->
<el-table-column label="现有计划数" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="现有计划数" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="借调数量" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="借调数量" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="操作人" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="操作人" align="center" prop="dictName" :show-overflow-tooltip="true" />
@ -64,104 +72,158 @@
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']" v-hasPermi="['store:labelType:edit']"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']" v-hasPermi="['store:labelType:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form
<el-form-item label="借出方单位" prop="dictName"> :model="dialogParams"
<el-input ref="dialogForm"
v-model="queryParams.dictName" size="small"
placeholder="请输入借出方单位" :inline="true"
clearable maxlength="50" :rules="rules"
style="width: 240px" v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="100px"
/> >
<el-form-item label="借出方单位" prop="borrowUnitId">
<el-select
v-model="dialogParams.borrowUnitId"
filterable
placeholder="请选择借出方单位"
style="width: 100%;"
@change="changeUnit"
>
<el-option
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="借入方单位" prop="dictName"> <el-form-item label="借入方单位" prop="needUnitId">
<el-input <el-select
v-model="queryParams.dictName" v-model="dialogParams.needUnitId"
placeholder="请输入借入方单位" filterable
clearable maxlength="50" placeholder="请选择借入方单位"
style="width: 240px" style="width: 100%;"
@keyup.enter.native="handleQuery" @change="changeUnit"
/> >
<el-option
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="关键字" prop="dictName"> <el-form-item label="关键字" prop="name">
<el-input <el-input
v-model="queryParams.dictName" v-model="dialogParams.name"
placeholder="请输入关键字" placeholder="请输入关键字"
clearable maxlength="50" clearable
style="width: 240px" maxlength="50"
@keyup.enter.native="handleQuery" style="width: 240px"
@keyup.enter.native="handledialogQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handledialogQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resedialogtQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table
<el-table v-loading="loading" :data="typeList" height="500px" @selection-change="handleSelectionChange"> ref="table"
v-loading="loading"
:data="dialogList"
height="500px"
@selection-change="handleSelectionDialog"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" /> <el-table-column label="序号" align="center" prop="planId" />
<el-table-column label="物资名称" align="center" prop="" :show-overflow-tooltip="true" /> <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="" :show-overflow-tooltip="true" /> <el-table-column
<el-table-column label="单位" align="center" prop="" :show-overflow-tooltip="true" /> label="规格型号"
<el-table-column label="剩余计划数" align="center" prop="" :show-overflow-tooltip="true" /> align="center"
<el-table-column label="借调数量" align="center" class-name="small-padding fixed-width" width="200"> prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column
label="剩余计划数"
align="center"
prop="lenderOrigPlanNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="借调数量"
align="center"
class-name="small-padding fixed-width"
prop="borrowNum"
width="210"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input-number
v-model="scope.row.dictName" v-model="scope.row.borrowNum"
placeholder="请输入借调数量" @input="validateBorrowNum(scope,'borrowNum')"
clearable :min="1"
:max="Number(scope.row.lenderOrigPlanNum)"
placeholder="请输入借调数量"
controls-position="right"
clearable
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" class-name="small-padding fixed-width" width="200"> <el-table-column
label="备注"
prop="remark"
align="center"
class-name="small-padding fixed-width"
width="200"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.dictName" v-model="scope.row.remark"
placeholder="请输入备注" @input="validateBorrowNum(scope,'remark')"
clearable placeholder="请输入备注"
clearable
/> />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="dialogtotal>0"
:total="total" :total="dialogtotal"
:page.sync="queryParams.pageNum" :page.sync="dialogParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="dialogParams.pageSize"
@pagination="getList" @pagination="getUnitList"
/> />
<div slot="footer" class="dialog-footer" style="text-align: center"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -171,11 +233,20 @@
</template> </template>
<script> <script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; import {
listType,
getType,
delType,
addType,
updateType,
refreshCache
} from "@/api/system/dict/type";
import { getunitInfoAll } from "@/api/store/tools";
import { getPlanList, addOrUpdateMange } from "@/api/store/newBuy";
export default { export default {
name: "PlanSecond", name: "PlanSecond",
dicts: ['sys_normal_disable'], dicts: ["sys_normal_disable"],
data() { data() {
return { return {
// //
@ -190,6 +261,11 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
dialogtotal: 0,
//
unitList: [],
dialogList: [],
// //
typeList: [], typeList: [],
// //
@ -204,16 +280,30 @@ export default {
dictType: undefined, dictType: undefined,
status: undefined status: undefined
}, },
//
dialogParams: {
pageNum: 1,
pageSize: 10,
borrowUnitId: undefined,
needUnitId: undefined,
name: undefined
},
//
dialogForm: {
checkDetailsList: [],
borrowUnitId: undefined,
needUnitId: undefined
},
// //
form: {}, form: {},
// //
rules: { rules: {
// dictName: [ borrowUnitId: [
// { required: true, message: "", trigger: "blur" } { required: true, message: "借出方单位不能为空", trigger: "blur" }
// ], ],
// dictType: [ needUnitId: [
// { required: true, message: "", trigger: "blur" } { required: true, message: "借入方单位不能为空", trigger: "blur" }
// ] ]
} }
}; };
}, },
@ -225,11 +315,10 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listType(this.queryParams).then(response => { listType(this.queryParams).then(response => {
this.typeList = response.rows; this.typeList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
} });
);
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -241,6 +330,14 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
handledialogQuery() {
this.dialogParams.pageNum = 1;
this.getUnitList();
},
resedialogtQuery() {
this.resetForm("dialogForm");
this.handledialogQuery();
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -262,12 +359,56 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "计划借调"; this.title = "计划借调";
this.getunitInfoAll();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item) this.ids = selection.map(item => item);
this.single = selection.length!=1 this.single = selection.length != 1;
this.multiple = !selection.length this.multiple = !selection.length;
},
/** 借调单位数据 */
getunitInfoAll() {
getunitInfoAll().then(response => {
this.unitList = response.rows;
});
this.resedialogtQuery();
},
//
changeUnit(val) {
if (this.dialogParams.needUnitId == this.dialogParams.borrowUnitId) {
this.$modal.msgError("借入方单位不能与借出方单位相同");
this.dialogParams.needUnitId = undefined;
} else {
this.getUnitList();
}
},
//
getUnitList() {
getPlanList(this.dialogParams).then(res => {
this.dialogList = res.rows;
this.dialogtotal = res.total;
});
},
//
handleSelectionDialog(checkDetailsList) {
this.dialogForm.checkDetailsList = checkDetailsList;
},
//
validateBorrowNum(scope, str) {
const selectedRowIndex = this.dialogForm.checkDetailsList.findIndex(
row => row.planId === scope.row.planId
);
if (selectedRowIndex !== -1) {
this.dialogForm.checkDetailsList.splice(selectedRowIndex, 1);
this.$refs.table.toggleRowSelection(scope.row, false);
debugger;
if (str == "remark") {
this.$message.warning("请先输入备注再进行勾选操作");
} else {
this.$message.warning("请先输入借调数量再进行勾选操作");
}
}
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -281,19 +422,19 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs["dialogForm"].validate(valid => {
if (valid) { if (valid) {
if (this.form.dictId != undefined) { this.dialogForm.needUnitId = this.dialogParams.needUnitId;
updateType(this.form).then(response => { this.dialogForm.borrowUnitId = this.dialogParams.borrowUnitId;
this.$modal.msgSuccess("修改成功"); if (this.dialogForm.checkDetailsList.length > 0) {
this.open = false; this.dialogForm.checkDetailsList.forEach(row => {
this.getList(); if ("lenderOrigPlanNum" in row) {
row.purchaseNum = row.lenderOrigPlanNum;
delete row.lenderOrigPlanNum;
}
}); });
} else { addOrUpdateMange(this.dialogForm).then(res => {
addType(this.form).then(response => { console.log(res);
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}); });
} }
} }
@ -314,8 +455,7 @@ export default {
// this.download('system/dict/type/export', { // this.download('system/dict/type/export', {
// ...this.queryParams // ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`) // }, `type_${new Date().getTime()}.xlsx`)
}, }
} }
}; };
</script> </script>

View File

@ -45,8 +45,8 @@ module.exports = {
// target: `http://10.40.92.8:8080`, //超 // target: `http://10.40.92.8:8080`, //超
// target: `http://10.40.92.253:8080`,//韩 // target: `http://10.40.92.253:8080`,//韩
// target: `http://10.40.92.209:8080`,//川/ // target: `http://10.40.92.209:8080`,//川/
// target: `http://10.40.92.153:8080`, //帅 target: `http://10.40.92.153:8080`, //帅
target: `http://10.40.92.14:8080`, //福 // target: `http://10.40.92.14:8080`, //福
//******** 注意事项 ********* */ //******** 注意事项 ********* */
//1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址; //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址;