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,
});
}
//
export function addOrUpdateMange(data) {
return request({
url: "/material/planManagement/addOrUpdateMange",
method: "post",
data: data,
});
}

View File

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

View File

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