feat:计划管理新增页面开发

This commit is contained in:
jackal 2024-04-09 15:10:31 +08:00
parent 8df7bf0faf
commit ad2c9e0db4
4 changed files with 693 additions and 773 deletions

View File

@ -1,308 +1,288 @@
import request from '@/utils/request'
import request from "@/utils/request";
//机具类型管理
export function getMaTypeList(query) {
return request({
url: '/base/type/getMaTypeList',
method: 'get',
params: query
})
url: "/base/type/getMaTypeList",
method: "get",
params: query,
});
}
//获取机具类型列表
export function getListByMaType(query) {
return request({
url: '/base/type/getListByMaType',
method: 'get',
params: query
})
url: "/base/type/getListByMaType",
method: "get",
params: query,
});
}
//获取机具类型树2
export function equipmentTypeTree(query) {
return request({
url: '/base/type/equipmentType',
method: 'get',
params: query
})
url: "/base/type/equipmentType",
method: "get",
params: query,
});
}
//机具类型-详情
export function getMaType(typeId) {
return request({
url: '/base/type/' + typeId,
method: 'get'
})
url: "/base/type/" + typeId,
method: "get",
});
}
//获取基层单位
export function getunitInfoAll(query) {
return request({
url: "/base/bmUnitInfo/unitInfoAll",
method: "get",
params: query,
});
}
//机具类型--新增
export function addMaType(data) {
return request({
url: '/base/type',
method: 'post',
data: data
})
url: "/base/type",
method: "post",
data: data,
});
}
// 机具类型--修改
export function updateMaType(data) {
return request({
url: '/base/type',
method: 'put',
data: data
})
url: "/base/type",
method: "put",
data: data,
});
}
//供应商管理--删除
export function delMaType(typeId) {
return request({
url: '/base/type/' + typeId,
method: 'delete'
})
url: "/base/type/" + typeId,
method: "delete",
});
}
//供应商管理-列表
export function listSupplierInfo(query) {
return request({
url: '/base/supplierInfo/list',
method: 'get',
params: query
})
url: "/base/supplierInfo/list",
method: "get",
params: query,
});
}
//供应商管理-详情
export function getSupplierInfo(supplierId) {
return request({
url: '/base/supplierInfo/' + supplierId,
method: 'get'
})
url: "/base/supplierInfo/" + supplierId,
method: "get",
});
}
//供应商管理--新增
export function addSupplier(data) {
return request({
url: '/base/supplierInfo',
method: 'post',
data: data
})
url: "/base/supplierInfo",
method: "post",
data: data,
});
}
// 供应商管理--修改
export function updateSupplier(data) {
return request({
url: '/base/supplierInfo',
method: 'put',
data: data
})
url: "/base/supplierInfo",
method: "put",
data: data,
});
}
//供应商管理--删除
export function delSupplier(supplierIds) {
return request({
url: '/base/supplierInfo/' + supplierIds,
method: 'delete'
})
url: "/base/supplierInfo/" + supplierIds,
method: "delete",
});
}
//供应商管理-下拉数据
export function supplierInfoList(query) {
return request({
url: '/base/supplierInfo/supplierInfoList',
method: 'get',
params: query
})
url: "/base/supplierInfo/supplierInfoList",
method: "get",
params: query,
});
}
//机具设备管理-列表
export function listMachine(query) {
return request({
url: '/base/machine/getMachine',
method: 'get',
params: query
})
url: "/base/machine/getMachine",
method: "get",
params: query,
});
}
//机具设备管理-详情
export function getMachine(maId) {
return request({
url: '/base/machine/' + maId,
method: 'get'
})
url: "/base/machine/" + maId,
method: "get",
});
}
//机具设备管理--新增
export function addMachine(data) {
return request({
url: '/base/machine',
method: 'post',
data: data
})
url: "/base/machine",
method: "post",
data: data,
});
}
// 机具设备管理--修改
export function updateMachine(data) {
return request({
url: '/base/machine',
method: 'put',
data: data
})
url: "/base/machine",
method: "put",
data: data,
});
}
//机具设备管理--删除
export function delMachine(maIds) {
return request({
url: '/base/machine/' + maIds,
method: 'delete'
})
url: "/base/machine/" + maIds,
method: "delete",
});
}
//
// //配件管理-列表
export function listPartType(query) {
return request({
url: '/base/maPartType/list',
method: 'get',
params: query
})
url: "/base/maPartType/list",
method: "get",
params: query,
});
}
//配件管理--新增
export function addPartType(data) {
return request({
url: '/base/maPartType',
method: 'post',
data: data
})
url: "/base/maPartType",
method: "post",
data: data,
});
}
//配件管理--新增
export function addMaPartType(data) {
return request({
url: '/base/maPartType',
method: 'post',
data: data
})
url: "/base/maPartType",
method: "post",
data: data,
});
}
// 配件管理--修改
export function updatePartType(data) {
return request({
url: '/base/maPartType',
method: 'put',
data: data
})
url: "/base/maPartType",
method: "put",
data: data,
});
}
// 配件管理--修改
export function updatePartTypeById(data) {
return request({
url: '/base/maPartType/updateById',
method: 'post',
data: data
})
url: "/base/maPartType/updateById",
method: "post",
data: data,
});
}
//配件管理--删除
export function delPartType(maIds) {
return request({
url: '/base/maPartType/' + maIds,
method: 'delete'
})
url: "/base/maPartType/" + maIds,
method: "delete",
});
}
//配件管理--查询
export function getPartType(maIds) {
return request({
url: '/base/maPartType/' + maIds,
method: 'get'
})
url: "/base/maPartType/" + maIds,
method: "get",
});
}
// 获取库管员配置列表
export function warehouseKeeperInfoAll(query) {
return request({
url: '/base/maWarehouseKeeper/warehouseKeeperInfoAll',
method: 'get',
params: query
})
url: "/base/maWarehouseKeeper/warehouseKeeperInfoAll",
method: "get",
params: query,
});
}
//库管员配置-根据人员名称查询左侧列表
export function getMaUserList(query) {
return request({
url: '/base/maWarehouseKeeper/getMaUserList',
method: 'get',
params: query
})
url: "/base/maWarehouseKeeper/getMaUserList",
method: "get",
params: query,
});
}
//库管员配置-保存
export function addHouseKeeper(data) {
return request({
url: '/base/maWarehouseKeeper/addList',
method: 'post',
data: data
})
url: "/base/maWarehouseKeeper/addList",
method: "post",
data: data,
});
}
//库管员配置-删除
export function delHouseKeeper(data) {
return request({
url: '/base/maWarehouseKeeper/remove',
method: 'post',
data: data
})
url: "/base/maWarehouseKeeper/remove",
method: "post",
data: data,
});
}
// 获取维修班配置列表
export function wareRepairerInfoAll(query) {
return request({
url: '/base/maintenanceGang/maintenanceGangInfoAll',
method: 'get',
params: query
})
url: "/base/maintenanceGang/maintenanceGangInfoAll",
method: "get",
params: query,
});
}
//维修班配置-根据人员名称查询左侧列表
export function getRepairerList(query) {
return request({
url: '/base/maintenanceGang/getMaUserList',
method: 'get',
params: query
})
url: "/base/maintenanceGang/getMaUserList",
method: "get",
params: query,
});
}
//维修班配置-保存
export function addRepairer(data) {
return request({
url: '/base/maintenanceGang/addList',
method: 'post',
data: data
})
url: "/base/maintenanceGang/addList",
method: "post",
data: data,
});
}
//维修班配置-删除
export function delRepairer(data) {
return request({
url: '/base/maintenanceGang/remove',
method: 'post',
data: data
})
url: "/base/maintenanceGang/remove",
method: "post",
data: data,
});
}
//机具厂家-下拉数据
export function getDeviceFactoryCbx(data) {
return request({
url: '/base/select/getDeviceFactoryCbx',
method: 'post',
data: data
})
url: "/base/select/getDeviceFactoryCbx",
method: "post",
data: data,
});
}

View File

@ -2,13 +2,8 @@
<div class="app-container" id="plan">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable maxlength="50" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
@ -19,23 +14,12 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -52,31 +36,16 @@
<el-table-column label="备注" align="center" prop="" :show-overflow-tooltip="true" />
<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']"
>编辑</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button>
<el-button 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']">删除</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"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
@ -120,10 +89,10 @@ export default {
getList() {
this.loading = true;
listType(this.queryParams).then(response => {
this.planList = response.rows;
this.total = response.total;
this.loading = false;
}
this.planList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
@ -138,20 +107,24 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({ path: "/store/plan/planAdd"});
this.$tab.closeOpenPage({
path: "/store/plan/planAdd",
});
// console.log(this.$router);
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item)
this.single = selection.length!=1
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
let query = { taskId:row.taskId }
let query = { taskId: row.taskId }
this.$tab.closeOpenPage({ path: "/store/plan/planAdd", query });
},
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;

View File

@ -1,500 +1,468 @@
<template>
<div class="app-container" id="newDevicesArrival">
<el-row :gutter="24" class="mb8">
<!-- <el-col :span="4" style="text-align:center;"><h4>新购任务信息:</h4></el-col> -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" >
<el-col :span="6">
<el-form-item label="机具类型" prop="equipmentId">
<treeselect
v-model="queryParams.equipmentId"
default-expand-all :options="equipmentTypeList"
placeholder="请选择机具类型"
@select="select"
:disable-branch-nodes="true"
style="width: 240px;"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="出厂日期">
<el-date-picker
v-model="queryParams.productionTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
placeholder="出厂日期"
@change="changeTime"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="机具厂家" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
placeholder="机具厂家"
clearable filterable
style="width: 240px"
@change="changeSupplier"
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="9"></el-col>
</el-form>
</el-row>
<el-form :model="maForm" ref="maForm" :rules="rules" size="small" :inline="true">
<el-row>
<el-form-item label="采购日期" prop="purchaseTime">
<el-date-picker
v-model="maForm.purchaseTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择采购日期"
></el-date-picker>
<div class="app-container" id="newDevicesArrival">
<el-row :gutter="24" class="mb8">
<!-- <el-col :span="4" style="text-align:center;"><h4>新购任务信息:</h4></el-col> -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-col :span="10">
<el-form-item label="机具类型" prop="equipmentId">
<treeselect v-model="queryParams.equipmentId" default-expand-all :options="equipmentTypeList"
placeholder="请选择机具类型" @select="select" :disable-branch-nodes="true" style="width: 240px;"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" />
</el-form-item>
<el-form-item label="到货日期" prop="arrivalTime">
<el-date-picker
v-model="maForm.arrivalTime"
style="width: 240px"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
type="date"
placeholder="请选择到货日期"
></el-date-picker>
</el-form-item>
<el-form-item label="采购员" prop="purchaser">
<el-select v-model="maForm.purchaser" filterable placeholder="请选择采购员" style="width: 100%;">
<el-option label="请选择" :value="0" ></el-option>
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.userName"
:value="item.userId"
></el-option>
</el-col>
<el-col :span="10">
<el-form-item label="基层单位" prop="unitId">
<el-select v-model="queryParams.unitId" filterable placeholder="请选择基层单位" style="width: 100%;"
@change="changeUnit">
<!-- <el-option label="请选择基层单位" :value="0"></el-option> -->
<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="remark">
<el-input
v-model="maForm.remark"
placeholder="请输入备注"
clearable maxlength="150"
type="textarea"
style="width: 240px"
/>
</el-col>
<!-- <el-col :span="6">
<el-form-item label="出厂日期">
<el-date-picker v-model="queryParams.productionTime" style="width: 240px" value-format="yyyy-MM-dd"
type="date" placeholder="出厂日期" @change="changeTime"></el-date-picker>
</el-form-item>
</el-row>
</el-col>
<el-col :span="6">
<el-form-item label="机具厂家" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="机具厂家" clearable filterable style="width: 240px"
@change="changeSupplier">
<el-option v-for="item in supplierList" :key="item.supplierId" :label="item.supplier"
:value="item.supplierId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="9"></el-col> -->
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="2">
<el-button
type="success"
plain
icon="el-icon-back"
size="mini"
@click="backList"
>返回</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleSave"
>保存</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="55"/>
<el-table-column label="机具类型" prop="machineTypeName" :show-overflow-tooltip="true" width="200">
</el-table-column>
<el-table-column label="规格型号" prop="specificationType" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="单位" prop="unitName" width="100" />
<el-table-column label="购置单价(元)" prop="purchasePrice" align="center" width="150">
<template slot-scope="scope">
<el-input-number v-model="scope.row.purchasePrice" controls-position="right" style="width: 100%;" :min="0"></el-input-number>
</template>
</el-table-column>
<el-table-column label="采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
<template slot-scope="scope">
<el-input-number v-model="scope.row.purchaseNum" controls-position="right" style="width: 100%;" :min="1"></el-input-number>
</template>
</el-table-column>
<el-table-column label="机具厂家" prop="supplierId" width="200" >
<template slot-scope="scope">
<el-select v-model="scope.row.supplierId" placeholder="机具厂家" filterable clearable style="width: 180px">
<el-option v-for="item in supplierList" :key="item.supplierId" :label="item.supplier" :value="item.supplierId" />
</el-select>
<!-- <el-input v-model="scope.row.supplierId"></el-input> -->
</template>
</el-table-column>
<el-table-column label="出厂日期" align="center" prop="productionTime" width="200">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.productionTime"
style="width: 180px"
value-format="yyyy-MM-dd"
type="date"
range-separator="-"
placeholder="出厂日期"
></el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { addPurchaseCheckInfo,getPurchaseCheckInfo,updatePurchaseCheckInfo } from "@/api/store/newBuy";
import { getUserByRoleList } from "@/api/system/user";
import { equipmentTypeTree ,supplierInfoList} from "@/api/store/tools";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { } from "@/api/store/newBuy";
export default {
name: "NewDevicesArrival",
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
</el-row>
<el-form :model="maForm" ref="maForm" size="small" :inline="true">
<!-- <el-row> -->
<!-- <el-form-item label="采购日期" prop="purchaseTime">
<el-date-picker v-model="maForm.purchaseTime" style="width: 240px" value-format="yyyy-MM-dd" type="date"
placeholder="请选择采购日期"></el-date-picker>
</el-form-item>
<el-form-item label="到货日期" prop="arrivalTime">
<el-date-picker v-model="maForm.arrivalTime" style="width: 240px" value-format="yyyy-MM-dd"
:picker-options="pickerOptions" type="date" placeholder="请选择到货日期"></el-date-picker>
</el-form-item>
<el-form-item label="采购员" prop="purchaser">
<el-select v-model="maForm.purchaser" filterable placeholder="请选择采购员" style="width: 100%;">
<el-option label="请选择" :value="0"></el-option>
<el-option v-for="item in userList" :key="item.userId" :label="item.userName"
:value="item.userId"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input v-model="maForm.remark" placeholder="请输入备注" clearable maxlength="150" type="textarea"
style="width: 240px" />
</el-form-item>
<!-- </el-row> -->
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="2">
<el-button type="success" plain icon="el-icon-back" size="mini" @click="backList">返回</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave">保存</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="机具类型" prop="machineTypeName" :show-overflow-tooltip="true" width="200">
</el-table-column>
<el-table-column label="规格型号" prop="specificationType" :show-overflow-tooltip="true" width="200" />
<el-table-column label="单位" prop="unitName" width="100" />
<el-table-column label="购置单价(元)" prop="purchasePrice" align="center" width="150">
<template slot-scope="scope">
<el-input-number v-model="scope.row.purchasePrice" controls-position="right" style="width: 100%;"
:min="0"></el-input-number>
</template>
</el-table-column>
<el-table-column label="采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
<template slot-scope="scope">
<el-input-number v-model="scope.row.purchaseNum" controls-position="right" style="width: 100%;"
:min="1"></el-input-number>
</template>
</el-table-column>
<el-table-column label="基层单位" prop="unitId" width="200">
<template slot-scope="scope">
<el-select v-model="scope.row.unitId" placeholder="基层单位" filterable clearable style="width: 180px">
<el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" />
</el-select>
<!-- <el-input v-model="scope.row.supplierId"></el-input> -->
</template>
</el-table-column>
<!-- <el-table-column label="出厂日期" align="center" prop="productionTime" width="200">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.productionTime" style="width: 180px" value-format="yyyy-MM-dd" type="date"
range-separator="-" placeholder="出厂日期"></el-date-picker>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { addPurchaseCheckInfo, getPurchaseCheckInfo, updatePurchaseCheckInfo } from "@/api/store/newBuy";
import { getUserByRoleList } from "@/api/system/user";
import { equipmentTypeTree, supplierInfoList, getunitInfoAll } from "@/api/store/tools";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { } from "@/api/store/newBuy";
export default {
name: "planAdd",
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
return {
planId: '',
isEdit: false,
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
supplierList: [],
//
equipmentTypeList: [],
//
userList: [],
//
unitList: [],
//
equipmentList: [],
//
title: "",
//
open: false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
dateRange: [],
//
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
},
{
value: "2",
label: "自定数据权限"
},
{
value: "3",
label: "本部门数据权限"
},
{
value: "4",
label: "本部门及以下数据权限"
},
{
value: "5",
label: "仅本人数据权限"
}
],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
equipmentId: undefined,
unitId: undefined,
// productionTime: '',
supplierId: '',
},
maForm: {
// purchaseTime: '',
// arrivalTime: '',
// purchaser: '',
remark: '',
},
//
form: {},
defaultProps: {
children: "children",
label: "label"
},
//
// rules: {
// purchaseTime: [
// { required: true, message: "", trigger: "blur" }
// ],
// arrivalTime: [
// { required: true, message: "", trigger: "blur" }
// ],
// purchaser: [
// { required: true, message: "", trigger: "blur" }
// ]
// },
};
},
computed: {
pickerOptions() {
const that = this;
return {
taskId:'',
isEdit:false,
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
supplierList: [],
//
equipmentTypeList: [],
//
userList: [],
//
equipmentList: [],
//
title: "",
//
open: false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
dateRange: [],
//
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
},
{
value: "2",
label: "自定数据权限"
},
{
value: "3",
label: "本部门数据权限"
},
{
value: "4",
label: "本部门及以下数据权限"
},
{
value: "5",
label: "仅本人数据权限"
disabledDate(time) {
if (that.maForm.purchaseTime) {
return (
time.getTime() < Date.now() - 8.64e7 ||
time.getTime() < new Date(that.maForm.purchaseTime).getTime() - 8.64e7
);
}
],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
equipmentId:undefined,
productionTime:'',
supplierId:'',
},
maForm:{
purchaseTime:'',
arrivalTime:'',
purchaser:'',
remark:'',
},
//
form: {},
defaultProps: {
children: "children",
label: "label"
},
//
rules: {
purchaseTime: [
{ required: true, message: "采购日期不能为空", trigger: "blur" }
],
arrivalTime: [
{ required: true, message: "到货日期不能为空", trigger: "blur" }
],
// purchaser: [
// { required: true, message: "", trigger: "blur" }
// ]
return time.getTime() < Date.now(); //1
},
};
},
computed: {
pickerOptions() {
const that = this;
return {
disabledDate(time) {
if (that.maForm.purchaseTime) {
return (
time.getTime() < Date.now()-8.64e7 ||
time.getTime() < new Date(that.maForm.purchaseTime).getTime()-8.64e7
);
}
return time.getTime() < Date.now(); //1
},
};
},
},
watch: {
'maForm.purchaseTime'() {
if (this.maForm.purchaseTime != '') {
this.maForm.arrivalTime = ''
}
},
watch: {
'maForm.purchaseTime'() {
if (this.maForm.purchaseTime != '') {
this.maForm.arrivalTime = ''
}
},
created() {
const taskId = this.$route.query && this.$route.query.taskId;
this.taskId = taskId;
if(this.taskId=='' || !this.taskId){
this.isEdit = false
}else if(this.taskId!=''){
this.isEdit = true;
this.getTaskInfo()
}
//
this.getUserList()
//
this.equipmentType();
//
this.supplierInfoList();
},
methods: {
/** 查询用户列表--采购员 */
getUserList() {
getUserByRoleList({roleId:'104'}).then(response => {
this.userList = response.data;
}
);
},
/** 机具厂家 */
supplierInfoList() {
supplierInfoList().then(response => {
this.supplierList = response.rows;
}
);
},
/** 机具类型 */
equipmentType() {
equipmentTypeTree().then(response => {
this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item,index)=>{
if(item.children&&item.children.length>0){
item.children.forEach((item2,index2)=>{
if(item2.children&&item2.children.length>0){
item2.children.forEach(item3=>{
if(item3.children&&item3.children.length>0){
item3.children.forEach(item4=>{
item4.machineTypeName = item3.typeName
item4.specificationType = item4.typeName
this.$set(item4, 'purchasePrice', 0);
this.$set(item4, 'purchaseNum', 1);
})
}
})
}
})
}
})
});
},
//
select(row){
console.log(row)
if(row.level==4){
for(let i = 0; i < this.equipmentList.length; i++) {
if (this.equipmentList[i].typeId == row.typeId) {
this.equipmentList.splice(i,1)
break;
}
}
this.$set(row, 'createTime', null);
this.$set(row, 'productionTime', '');
this.$set(row, 'supplierId', '');
this.$set(row, 'purchasePrice', 0);
this.$set(row, 'purchaseNum', 1);
this.equipmentList.unshift(row)
}
},
//
changeSupplier(supplierId){
this.equipmentList.forEach(item=>{
this.$set(item, 'supplierId', supplierId);
})
},
//
changeTime(time){
console.log(time)
this.equipmentList.forEach(item=>{
this.$set(item, 'productionTime', time);
})
},
//---
getTaskInfo(){
// this.loading = true;
getPurchaseCheckInfo({taskId:this.taskId,keyWord:this.queryParams.keyWord}).then(response => {
// this.taskInfo = response.data
this.maForm.purchaseTime = response.data.purchaseTime;
this.maForm.arrivalTime = response.data.arrivalTime;
this.maForm.purchaser = response.data.purchaser;
this.maForm.remark = response.data.remark;
this.equipmentList = response.data.checkDetailsList;
// this.loading = false;
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleSave() {
if(this.equipmentList.length>0){
this.$refs["maForm"].validate(valid => {
if (valid) {
// console.log(this.maForm,'maForm')
// console.log(this.equipmentList,'equipmentList')
let isEmpty = true
this.equipmentList.forEach(item=>{
if(item.purchaseNum=='' || !item.purchaseNum){
isEmpty = false
}
})
// console.log(this.taskId)
this.maForm.taskId = this.taskId
this.maForm.checkDetailsList = this.equipmentList;
// console.log(this.maForm)
if(isEmpty){
if(this.equipmentList.length>0){
this.$modal.confirm('是否确认保存当前页面').then(function() { }).then(() => {
if(this.isEdit){
console.log('编辑')
// this.loading = true;
// updatePurchaseCheckInfo(this.maForm).then(response => {
// if(response.code == 200){
// this.$modal.msgSuccess("");
// this.$tab.closeOpenPage({ path: "/store/plan/plan"});
// }
// this.loading = false;
// })
}else if(!this.isEdit){
console.log('新增')
// this.loading = true;
// addPurchaseCheckInfo(this.maForm).then(response => {
// if(response.code == 200){
// this.$modal.msgSuccess("");
// this.$tab.closeOpenPage({ path: "/store/plan/plan"});
// }
// this.loading = false;
// })
}
}).catch(() => {});
}else{
this.$modal.msgError("请先选择并添加机具类型!!!");
}
}else{
this.$modal.msgError("请填写采购数量!!!");
}
}
})
}else{
this.$modal.msgError("请先添加机具类型");
}
},
backList(){
const obj = { path: "/store/plan/plan" }
this.$tab.closeOpenPage(obj);
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row.id)
this.$modal.confirm('是否确认删除该数据项?').then(() => {
this.equipmentList.forEach((item,index)=>{
if(item.id == row.id){
this.equipmentList.splice(index,1)
}
})
}).catch(() => {});
},
}
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
},
created() {
const planId = this.$route.query && this.$route.query.planId;
this.planId = planId;
if (this.planId == '' || !this.planId) {
this.isEdit = false
} else if (this.planId != '') {
this.isEdit = true;
this.getTaskInfo()
}
//
this.getUserList()
//
this.equipmentType();
//
this.supplierInfoList();
//
this.getunitInfoAll()
},
methods: {
/** 查询用户列表--采购员 */
getUserList() {
getUserByRoleList({ roleId: '104' }).then(response => {
this.userList = response.data;
}
);
},
/** 基层单位 */
getunitInfoAll() {
getunitInfoAll().then(response => {
console.log(response, 's');
this.unitList = response.rows
}
);
},
/** 机具厂家 */
supplierInfoList() {
supplierInfoList().then(response => {
this.supplierList = response.rows;
}
);
},
/** 机具类型 */
equipmentType() {
equipmentTypeTree().then(response => {
this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (item2.children && item2.children.length > 0) {
item2.children.forEach(item3 => {
if (item3.children && item3.children.length > 0) {
item3.children.forEach(item4 => {
item4.machineTypeName = item3.typeName
item4.specificationType = item4.typeName
this.$set(item4, 'purchasePrice', 0);
this.$set(item4, 'purchaseNum', 1);
})
}
})
}
})
}
})
});
},
//
select(row) {
console.log(row)
if (row.level == 4) {
for (let i = 0; i < this.equipmentList.length; i++) {
if (this.equipmentList[i].typeId == row.typeId) {
this.equipmentList.splice(i, 1)
break;
}
}
// this.$set(row, 'createTime', null);
// this.$set(row, 'productionTime', '');
this.$set(row, 'unitId', '');
this.$set(row, 'purchasePrice', 0);
this.$set(row, 'purchaseNum', 1);
this.equipmentList.unshift(row)
}
},
//
changeUnit(unitId) {
this.equipmentList.forEach(item => {
this.$set(item, 'unitId', unitId);
})
},
//
changeSupplier(supplierId) {
this.equipmentList.forEach(item => {
this.$set(item, 'supplierId', supplierId);
})
},
//
changeTime(time) {
console.log(time)
this.equipmentList.forEach(item => {
this.$set(item, 'productionTime', time);
})
},
//---
getTaskInfo() {
// this.loading = true;
getPurchaseCheckInfo({ planId: this.planId, keyWord: this.queryParams.keyWord }).then(response => {
// this.taskInfo = response.data
// this.maForm.purchaseTime = response.data.purchaseTime;
// this.maForm.arrivalTime = response.data.arrivalTime;
// this.maForm.purchaser = response.data.purchaser;
this.maForm.remark = response.data.remark;
this.equipmentList = response.data.checkDetailsList;
// this.loading = false;
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleSave() {
if (this.equipmentList.length > 0) {
this.$refs["maForm"].validate(valid => {
if (valid) {
// console.log(this.maForm,'maForm')
// console.log(this.equipmentList,'equipmentList')
let isEmpty = true
this.equipmentList.forEach(item => {
if (item.purchaseNum == '' || !item.purchaseNum) {
isEmpty = false
}
})
// console.log(this.planId)
this.maForm.planId = this.planId
this.maForm.checkDetailsList = this.equipmentList;
console.log(this.maForm, 'sasa')
if (isEmpty) {
if (this.equipmentList.length > 0) {
this.$modal.confirm('是否确认保存当前页面').then(function () { }).then(() => {
if (this.isEdit) {
console.log('编辑')
// this.loading = true;
// updatePurchaseCheckInfo(this.maForm).then(response => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// this.$tab.closeOpenPage({ path: "/store/plan/plan" });
// }
// this.loading = false;
// })
} else if (!this.isEdit) {
console.log('新增')
// this.loading = true;
// addPurchaseCheckInfo(this.maForm).then(response => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// this.$tab.closeOpenPage({ path: "/store/plan/plan" });
// }
// this.loading = false;
// })
}
}).catch(() => { });
} else {
this.$modal.msgError("请先选择并添加机具类型!!!");
}
} else {
this.$modal.msgError("请填写采购数量!!!");
}
}
})
} else {
this.$modal.msgError("请先添加机具类型");
}
},
backList() {
const obj = { path: "/store/plan/plan" }
this.$tab.closeOpenPage(obj);
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row.id)
this.$modal.confirm('是否确认删除该数据项?').then(() => {
this.equipmentList.forEach((item, index) => {
if (item.id == row.id) {
this.equipmentList.splice(index, 1)
}
})
}).catch(() => { });
},
}
::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
::v-deep input[type="number"] {
-moz-appearance: textfield !important;
}
</style>
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
::v-deep input[type="number"] {
-moz-appearance: textfield !important;
}
</style>

View File

@ -1,15 +1,15 @@
'use strict'
const path = require('path')
"use strict";
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir)
return path.join(__dirname, dir);
}
const CompressionPlugin = require('compression-webpack-plugin')
const CompressionPlugin = require("compression-webpack-plugin");
const name = process.env.VUE_APP_TITLE || '施工装备管理系统' // 网页标题
const name = process.env.VUE_APP_TITLE || "施工装备管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口
const port = process.env.port || process.env.npm_config_port || 80; // 端口
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@ -18,18 +18,18 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",///gl/
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", ///gl/
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: 'dist',
outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
assetsDir: "static",
// 是否开启eslint保存检测有效值ture | false | 'error'
lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: process.env.NODE_ENV === "development",
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
// webpack-dev-server 相关配置
devServer: {
host: '0.0.0.0',
host: "0.0.0.0",
port: port,
open: true,
proxy: {
@ -42,7 +42,7 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
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.209:8080`,//川/
@ -59,97 +59,96 @@ module.exports = {
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
["^" + process.env.VUE_APP_BASE_API]: "",
},
},
},
disableHostCheck: true
disableHostCheck: true,
},
css: {
loaderOptions: {
sass: {
sassOptions: { outputStyle: "expanded" }
}
}
sassOptions: { outputStyle: "expanded" },
},
},
},
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
"@": resolve("src"),
},
},
plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: '[path].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩
})
cache: false, // 不启用文件缓存
test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: "[path].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8, // 压缩率小于1才会压缩
}),
],
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.plugins.delete("preload"); // TODO: need test
config.plugins.delete("prefetch"); // TODO: need test
// set svg-sprite-loader
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module
.rule('icons')
.rule("icons")
.test(/\.svg$/)
.include.add(resolve('src/assets/icons'))
.include.add(resolve("src/assets/icons"))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: 'icon-[name]'
symbolId: "icon-[name]",
})
.end()
.end();
config.when(process.env.NODE_ENV !== 'development', config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single'),
config.when(process.env.NODE_ENV !== "development", (config) => {
config
.plugin("ScriptExtHtmlWebpackPlugin")
.after("html")
.use("script-ext-html-webpack-plugin", [
{
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: './' //到根目录下
}
})
}
}
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/,
},
])
.end();
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: "initial", // only package third parties that are initially dependent
},
elementUI: {
name: "chunk-elementUI", // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: "chunk-commons",
test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true,
},
},
});
config.optimization.runtimeChunk("single"),
{
from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
to: "./", //到根目录下
};
});
},
};