feat:计划管理新增页面开发
This commit is contained in:
parent
8df7bf0faf
commit
ad2c9e0db4
|
|
@ -1,308 +1,288 @@
|
||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
//机具类型管理
|
//机具类型管理
|
||||||
export function getMaTypeList(query) {
|
export function getMaTypeList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type/getMaTypeList',
|
url: "/base/type/getMaTypeList",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//获取机具类型列表
|
//获取机具类型列表
|
||||||
export function getListByMaType(query) {
|
export function getListByMaType(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type/getListByMaType',
|
url: "/base/type/getListByMaType",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//获取机具类型树2
|
//获取机具类型树2
|
||||||
export function equipmentTypeTree(query) {
|
export function equipmentTypeTree(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type/equipmentType',
|
url: "/base/type/equipmentType",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//机具类型-详情
|
//机具类型-详情
|
||||||
export function getMaType(typeId) {
|
export function getMaType(typeId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type/' + typeId,
|
url: "/base/type/" + typeId,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
//获取基层单位
|
||||||
|
export function getunitInfoAll(query) {
|
||||||
|
return request({
|
||||||
|
url: "/base/bmUnitInfo/unitInfoAll",
|
||||||
|
method: "get",
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//机具类型--新增
|
//机具类型--新增
|
||||||
export function addMaType(data) {
|
export function addMaType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type',
|
url: "/base/type",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 机具类型--修改
|
// 机具类型--修改
|
||||||
export function updateMaType(data) {
|
export function updateMaType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type',
|
url: "/base/type",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//供应商管理--删除
|
//供应商管理--删除
|
||||||
export function delMaType(typeId) {
|
export function delMaType(typeId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/type/' + typeId,
|
url: "/base/type/" + typeId,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//供应商管理-列表
|
//供应商管理-列表
|
||||||
export function listSupplierInfo(query) {
|
export function listSupplierInfo(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo/list',
|
url: "/base/supplierInfo/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//供应商管理-详情
|
//供应商管理-详情
|
||||||
export function getSupplierInfo(supplierId) {
|
export function getSupplierInfo(supplierId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo/' + supplierId,
|
url: "/base/supplierInfo/" + supplierId,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//供应商管理--新增
|
//供应商管理--新增
|
||||||
export function addSupplier(data) {
|
export function addSupplier(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo',
|
url: "/base/supplierInfo",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 供应商管理--修改
|
// 供应商管理--修改
|
||||||
export function updateSupplier(data) {
|
export function updateSupplier(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo',
|
url: "/base/supplierInfo",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//供应商管理--删除
|
//供应商管理--删除
|
||||||
export function delSupplier(supplierIds) {
|
export function delSupplier(supplierIds) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo/' + supplierIds,
|
url: "/base/supplierInfo/" + supplierIds,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//供应商管理-下拉数据
|
//供应商管理-下拉数据
|
||||||
export function supplierInfoList(query) {
|
export function supplierInfoList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/supplierInfo/supplierInfoList',
|
url: "/base/supplierInfo/supplierInfoList",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//机具设备管理-列表
|
//机具设备管理-列表
|
||||||
export function listMachine(query) {
|
export function listMachine(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/machine/getMachine',
|
url: "/base/machine/getMachine",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//机具设备管理-详情
|
//机具设备管理-详情
|
||||||
export function getMachine(maId) {
|
export function getMachine(maId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/machine/' + maId,
|
url: "/base/machine/" + maId,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//机具设备管理--新增
|
//机具设备管理--新增
|
||||||
export function addMachine(data) {
|
export function addMachine(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/machine',
|
url: "/base/machine",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 机具设备管理--修改
|
// 机具设备管理--修改
|
||||||
export function updateMachine(data) {
|
export function updateMachine(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/machine',
|
url: "/base/machine",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//机具设备管理--删除
|
//机具设备管理--删除
|
||||||
export function delMachine(maIds) {
|
export function delMachine(maIds) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/machine/' + maIds,
|
url: "/base/machine/" + maIds,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// //配件管理-列表
|
// //配件管理-列表
|
||||||
export function listPartType(query) {
|
export function listPartType(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType/list',
|
url: "/base/maPartType/list",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//配件管理--新增
|
//配件管理--新增
|
||||||
export function addPartType(data) {
|
export function addPartType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType',
|
url: "/base/maPartType",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//配件管理--新增
|
//配件管理--新增
|
||||||
export function addMaPartType(data) {
|
export function addMaPartType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType',
|
url: "/base/maPartType",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 配件管理--修改
|
// 配件管理--修改
|
||||||
export function updatePartType(data) {
|
export function updatePartType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType',
|
url: "/base/maPartType",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 配件管理--修改
|
// 配件管理--修改
|
||||||
export function updatePartTypeById(data) {
|
export function updatePartTypeById(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType/updateById',
|
url: "/base/maPartType/updateById",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//配件管理--删除
|
//配件管理--删除
|
||||||
export function delPartType(maIds) {
|
export function delPartType(maIds) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType/' + maIds,
|
url: "/base/maPartType/" + maIds,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//配件管理--查询
|
//配件管理--查询
|
||||||
export function getPartType(maIds) {
|
export function getPartType(maIds) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maPartType/' + maIds,
|
url: "/base/maPartType/" + maIds,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取库管员配置列表
|
// 获取库管员配置列表
|
||||||
export function warehouseKeeperInfoAll(query) {
|
export function warehouseKeeperInfoAll(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maWarehouseKeeper/warehouseKeeperInfoAll',
|
url: "/base/maWarehouseKeeper/warehouseKeeperInfoAll",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//库管员配置-根据人员名称查询左侧列表
|
//库管员配置-根据人员名称查询左侧列表
|
||||||
export function getMaUserList(query) {
|
export function getMaUserList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maWarehouseKeeper/getMaUserList',
|
url: "/base/maWarehouseKeeper/getMaUserList",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//库管员配置-保存
|
//库管员配置-保存
|
||||||
export function addHouseKeeper(data) {
|
export function addHouseKeeper(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maWarehouseKeeper/addList',
|
url: "/base/maWarehouseKeeper/addList",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//库管员配置-删除
|
//库管员配置-删除
|
||||||
export function delHouseKeeper(data) {
|
export function delHouseKeeper(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maWarehouseKeeper/remove',
|
url: "/base/maWarehouseKeeper/remove",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取维修班配置列表
|
// 获取维修班配置列表
|
||||||
export function wareRepairerInfoAll(query) {
|
export function wareRepairerInfoAll(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maintenanceGang/maintenanceGangInfoAll',
|
url: "/base/maintenanceGang/maintenanceGangInfoAll",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//维修班配置-根据人员名称查询左侧列表
|
//维修班配置-根据人员名称查询左侧列表
|
||||||
export function getRepairerList(query) {
|
export function getRepairerList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maintenanceGang/getMaUserList',
|
url: "/base/maintenanceGang/getMaUserList",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: query
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//维修班配置-保存
|
//维修班配置-保存
|
||||||
export function addRepairer(data) {
|
export function addRepairer(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maintenanceGang/addList',
|
url: "/base/maintenanceGang/addList",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//维修班配置-删除
|
//维修班配置-删除
|
||||||
export function delRepairer(data) {
|
export function delRepairer(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/maintenanceGang/remove',
|
url: "/base/maintenanceGang/remove",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//机具厂家-下拉数据
|
//机具厂家-下拉数据
|
||||||
export function getDeviceFactoryCbx(data) {
|
export function getDeviceFactoryCbx(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/select/getDeviceFactoryCbx',
|
url: "/base/select/getDeviceFactoryCbx",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,8 @@
|
||||||
<div class="app-container" id="plan">
|
<div class="app-container" id="plan">
|
||||||
<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="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input
|
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable maxlength="50" style="width: 240px"
|
||||||
v-model="queryParams.name"
|
@keyup.enter.native="handleQuery" />
|
||||||
placeholder="请输入名称"
|
|
||||||
clearable maxlength="50"
|
|
||||||
style="width: 240px"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
@ -19,23 +14,12 @@
|
||||||
|
|
||||||
<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" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
@ -52,31 +36,16 @@
|
||||||
<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" 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" type="primary" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['store:labelType:edit']">编辑</el-button>
|
||||||
type="primary"
|
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
icon="el-icon-edit"
|
v-hasPermi="['store:labelType:remove']">删除</el-button>
|
||||||
@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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -120,10 +89,10 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listType(this.queryParams).then(response => {
|
listType(this.queryParams).then(response => {
|
||||||
this.planList = response.rows;
|
this.planList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
|
|
@ -138,20 +107,24 @@ export default {
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$tab.closeOpenPage({ path: "/store/plan/planAdd"});
|
this.$tab.closeOpenPage({
|
||||||
|
path: "/store/plan/planAdd",
|
||||||
|
});
|
||||||
|
// console.log(this.$router);
|
||||||
|
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
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
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
let query = { taskId:row.taskId }
|
let query = { taskId: row.taskId }
|
||||||
this.$tab.closeOpenPage({ path: "/store/plan/planAdd", query });
|
this.$tab.closeOpenPage({ path: "/store/plan/planAdd", query });
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
// const dictIds = row.dictId || this.ids;
|
// const dictIds = row.dictId || this.ids;
|
||||||
|
|
|
||||||
|
|
@ -1,500 +1,468 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container" id="newDevicesArrival">
|
<div class="app-container" id="newDevicesArrival">
|
||||||
<el-row :gutter="24" class="mb8">
|
<el-row :gutter="24" class="mb8">
|
||||||
<!-- <el-col :span="4" style="text-align:center;"><h4>新购任务信息:</h4></el-col> -->
|
<!-- <el-col :span="4" style="text-align:center;"><h4>新购任务信息:</h4></el-col> -->
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" >
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
|
||||||
<el-col :span="6">
|
<el-col :span="10">
|
||||||
<el-form-item label="机具类型" prop="equipmentId">
|
<el-form-item label="机具类型" prop="equipmentId">
|
||||||
<treeselect
|
<treeselect v-model="queryParams.equipmentId" default-expand-all :options="equipmentTypeList"
|
||||||
v-model="queryParams.equipmentId"
|
placeholder="请选择机具类型" @select="select" :disable-branch-nodes="true" style="width: 240px;"
|
||||||
default-expand-all :options="equipmentTypeList"
|
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" />
|
||||||
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>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="到货日期" prop="arrivalTime">
|
</el-col>
|
||||||
<el-date-picker
|
<el-col :span="10">
|
||||||
v-model="maForm.arrivalTime"
|
|
||||||
style="width: 240px"
|
<el-form-item label="基层单位" prop="unitId">
|
||||||
value-format="yyyy-MM-dd"
|
<el-select v-model="queryParams.unitId" filterable placeholder="请选择基层单位" style="width: 100%;"
|
||||||
:picker-options="pickerOptions"
|
@change="changeUnit">
|
||||||
type="date"
|
<!-- <el-option label="请选择基层单位" :value="0"></el-option> -->
|
||||||
placeholder="请选择到货日期"
|
<el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName"
|
||||||
></el-date-picker>
|
:value="item.unitId"></el-option>
|
||||||
</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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
</el-col>
|
||||||
<el-input
|
<!-- <el-col :span="6">
|
||||||
v-model="maForm.remark"
|
<el-form-item label="出厂日期">
|
||||||
placeholder="请输入备注"
|
<el-date-picker v-model="queryParams.productionTime" style="width: 240px" value-format="yyyy-MM-dd"
|
||||||
clearable maxlength="150"
|
type="date" placeholder="出厂日期" @change="changeTime"></el-date-picker>
|
||||||
type="textarea"
|
|
||||||
style="width: 240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</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-form>
|
||||||
<el-row :gutter="10" class="mb8">
|
</el-row>
|
||||||
<el-col :span="2">
|
<el-form :model="maForm" ref="maForm" size="small" :inline="true">
|
||||||
<el-button
|
<!-- <el-row> -->
|
||||||
type="success"
|
<!-- <el-form-item label="采购日期" prop="purchaseTime">
|
||||||
plain
|
<el-date-picker v-model="maForm.purchaseTime" style="width: 240px" value-format="yyyy-MM-dd" type="date"
|
||||||
icon="el-icon-back"
|
placeholder="请选择采购日期"></el-date-picker>
|
||||||
size="mini"
|
</el-form-item>
|
||||||
@click="backList"
|
<el-form-item label="到货日期" prop="arrivalTime">
|
||||||
>返回</el-button>
|
<el-date-picker v-model="maForm.arrivalTime" style="width: 240px" value-format="yyyy-MM-dd"
|
||||||
</el-col>
|
:picker-options="pickerOptions" type="date" placeholder="请选择到货日期"></el-date-picker>
|
||||||
<el-col :span="1.5">
|
</el-form-item>
|
||||||
<el-button
|
<el-form-item label="采购员" prop="purchaser">
|
||||||
type="primary"
|
<el-select v-model="maForm.purchaser" filterable placeholder="请选择采购员" style="width: 100%;">
|
||||||
plain
|
<el-option label="请选择" :value="0"></el-option>
|
||||||
icon="el-icon-plus"
|
<el-option v-for="item in userList" :key="item.userId" :label="item.userName"
|
||||||
size="mini"
|
:value="item.userId"></el-option>
|
||||||
@click="handleSave"
|
</el-select>
|
||||||
>保存</el-button>
|
</el-form-item> -->
|
||||||
</el-col>
|
<el-form-item label="备注" prop="remark">
|
||||||
</el-row>
|
<el-input v-model="maForm.remark" placeholder="请输入备注" clearable maxlength="150" type="textarea"
|
||||||
|
style="width: 240px" />
|
||||||
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
|
</el-form-item>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<!-- </el-row> -->
|
||||||
<el-table-column label="序号" type="index" width="55"/>
|
</el-form>
|
||||||
<el-table-column label="机具类型" prop="machineTypeName" :show-overflow-tooltip="true" width="200">
|
<el-row :gutter="10" class="mb8">
|
||||||
</el-table-column>
|
<el-col :span="2">
|
||||||
<el-table-column label="规格型号" prop="specificationType" :show-overflow-tooltip="true" width="200"/>
|
<el-button type="success" plain icon="el-icon-back" size="mini" @click="backList">返回</el-button>
|
||||||
<el-table-column label="单位" prop="unitName" width="100" />
|
</el-col>
|
||||||
<el-table-column label="购置单价(元)" prop="purchasePrice" align="center" width="150">
|
<el-col :span="1.5">
|
||||||
<template slot-scope="scope">
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave">保存</el-button>
|
||||||
<el-input-number v-model="scope.row.purchasePrice" controls-position="right" style="width: 100%;" :min="0"></el-input-number>
|
</el-col>
|
||||||
</template>
|
</el-row>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
|
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
|
||||||
<template slot-scope="scope">
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-input-number v-model="scope.row.purchaseNum" controls-position="right" style="width: 100%;" :min="1"></el-input-number>
|
<el-table-column label="序号" type="index" width="55" />
|
||||||
</template>
|
<el-table-column label="机具类型" prop="machineTypeName" :show-overflow-tooltip="true" width="200">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="机具厂家" prop="supplierId" width="200" >
|
<el-table-column label="规格型号" prop="specificationType" :show-overflow-tooltip="true" width="200" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="单位" prop="unitName" width="100" />
|
||||||
<el-select v-model="scope.row.supplierId" placeholder="机具厂家" filterable clearable style="width: 180px">
|
<el-table-column label="购置单价(元)" prop="purchasePrice" align="center" width="150">
|
||||||
<el-option v-for="item in supplierList" :key="item.supplierId" :label="item.supplier" :value="item.supplierId" />
|
<template slot-scope="scope">
|
||||||
</el-select>
|
<el-input-number v-model="scope.row.purchasePrice" controls-position="right" style="width: 100%;"
|
||||||
|
:min="0"></el-input-number>
|
||||||
<!-- <el-input v-model="scope.row.supplierId"></el-input> -->
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="采购数量" prop="purchaseNum" width="150" type="number" maxlength="10">
|
||||||
<el-table-column label="出厂日期" align="center" prop="productionTime" width="200">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
<el-input-number v-model="scope.row.purchaseNum" controls-position="right" style="width: 100%;"
|
||||||
<el-date-picker
|
:min="1"></el-input-number>
|
||||||
v-model="scope.row.productionTime"
|
</template>
|
||||||
style="width: 180px"
|
</el-table-column>
|
||||||
value-format="yyyy-MM-dd"
|
<el-table-column label="基层单位" prop="unitId" width="200">
|
||||||
type="date"
|
<template slot-scope="scope">
|
||||||
range-separator="-"
|
<el-select v-model="scope.row.unitId" placeholder="基层单位" filterable clearable style="width: 180px">
|
||||||
placeholder="出厂日期"
|
<el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" />
|
||||||
></el-date-picker>
|
</el-select>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
<!-- <el-input v-model="scope.row.supplierId"></el-input> -->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
</template>
|
||||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
</el-table-column>
|
||||||
<el-button
|
<!-- <el-table-column label="出厂日期" align="center" prop="productionTime" width="200">
|
||||||
size="mini"
|
<template slot-scope="scope">
|
||||||
type="danger"
|
<el-date-picker v-model="scope.row.productionTime" style="width: 180px" value-format="yyyy-MM-dd" type="date"
|
||||||
icon="el-icon-delete"
|
range-separator="-" placeholder="出厂日期"></el-date-picker>
|
||||||
@click="handleDelete(scope.row)"
|
</template>
|
||||||
>删除</el-button>
|
</el-table-column> -->
|
||||||
</template>
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
</el-table-column>
|
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||||
</el-table>
|
<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>
|
</div>
|
||||||
import { addPurchaseCheckInfo,getPurchaseCheckInfo,updatePurchaseCheckInfo } from "@/api/store/newBuy";
|
</template>
|
||||||
import { getUserByRoleList } from "@/api/system/user";
|
|
||||||
import { equipmentTypeTree ,supplierInfoList} from "@/api/store/tools";
|
<script>
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import { addPurchaseCheckInfo, getPurchaseCheckInfo, updatePurchaseCheckInfo } from "@/api/store/newBuy";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import { getUserByRoleList } from "@/api/system/user";
|
||||||
|
import { equipmentTypeTree, supplierInfoList, getunitInfoAll } from "@/api/store/tools";
|
||||||
import { } from "@/api/store/newBuy";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
export default {
|
|
||||||
name: "NewDevicesArrival",
|
import { } from "@/api/store/newBuy";
|
||||||
dicts: ['sys_normal_disable'],
|
|
||||||
components: { Treeselect },
|
export default {
|
||||||
data() {
|
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 {
|
return {
|
||||||
taskId:'',
|
disabledDate(time) {
|
||||||
isEdit:false,
|
if (that.maForm.purchaseTime) {
|
||||||
// 遮罩层
|
return (
|
||||||
loading: false,
|
time.getTime() < Date.now() - 8.64e7 ||
|
||||||
// 选中数组
|
time.getTime() < new Date(that.maForm.purchaseTime).getTime() - 8.64e7
|
||||||
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: "仅本人数据权限"
|
|
||||||
}
|
}
|
||||||
],
|
return time.getTime() < Date.now(); //实现1效果
|
||||||
// 菜单列表
|
|
||||||
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" }
|
|
||||||
// ]
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
},
|
||||||
pickerOptions() {
|
watch: {
|
||||||
const that = this;
|
'maForm.purchaseTime'() {
|
||||||
return {
|
if (this.maForm.purchaseTime != '') {
|
||||||
disabledDate(time) {
|
this.maForm.arrivalTime = ''
|
||||||
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 = ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
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>
|
created() {
|
||||||
<style lang="scss" scoped>
|
const planId = this.$route.query && this.$route.query.planId;
|
||||||
::v-deep.el-table .fixed-width .el-button--mini {
|
this.planId = planId;
|
||||||
width: 60px !important;
|
if (this.planId == '' || !this.planId) {
|
||||||
margin-bottom: 10px;
|
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 {
|
</script>
|
||||||
-webkit-appearance: none !important;
|
<style lang="scss" scoped>
|
||||||
}
|
::v-deep.el-table .fixed-width .el-button--mini {
|
||||||
::v-deep input[type="number"] {
|
width: 60px !important;
|
||||||
-moz-appearance: textfield !important;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
::v-deep input::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep input[type="number"] {
|
||||||
|
-moz-appearance: textfield !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
'use strict'
|
"use strict";
|
||||||
const path = require('path')
|
const path = require("path");
|
||||||
|
|
||||||
function resolve(dir) {
|
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 配置说明
|
||||||
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
||||||
|
|
@ -18,18 +18,18 @@ module.exports = {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 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)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: 'dist',
|
outputDir: "dist",
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
assetsDir: 'static',
|
assetsDir: "static",
|
||||||
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === "development",
|
||||||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
// webpack-dev-server 相关配置
|
// webpack-dev-server 相关配置
|
||||||
devServer: {
|
devServer: {
|
||||||
host: '0.0.0.0',
|
host: "0.0.0.0",
|
||||||
port: port,
|
port: port,
|
||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|
@ -42,7 +42,7 @@ module.exports = {
|
||||||
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
|
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
|
||||||
// target: `https://z.csgmall.com.cn`,
|
// 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.253:8080`,//韩
|
||||||
// target: `http://10.40.92.209:8080`,//川/
|
// target: `http://10.40.92.209:8080`,//川/
|
||||||
|
|
||||||
|
|
@ -59,97 +59,96 @@ module.exports = {
|
||||||
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
["^" + process.env.VUE_APP_BASE_API]: "",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
disableHostCheck: true
|
disableHostCheck: true,
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
loaderOptions: {
|
loaderOptions: {
|
||||||
sass: {
|
sass: {
|
||||||
sassOptions: { outputStyle: "expanded" }
|
sassOptions: { outputStyle: "expanded" },
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
name: name,
|
name: name,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve('src')
|
"@": resolve("src"),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
||||||
new CompressionPlugin({
|
new CompressionPlugin({
|
||||||
cache: false, // 不启用文件缓存
|
cache: false, // 不启用文件缓存
|
||||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||||
filename: '[path].gz[query]', // 压缩后的文件名
|
filename: "[path].gz[query]", // 压缩后的文件名
|
||||||
algorithm: 'gzip', // 使用gzip压缩
|
algorithm: "gzip", // 使用gzip压缩
|
||||||
minRatio: 0.8 // 压缩率小于1才会压缩
|
minRatio: 0.8, // 压缩率小于1才会压缩
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
config.plugins.delete('preload') // TODO: need test
|
config.plugins.delete("preload"); // TODO: need test
|
||||||
config.plugins.delete('prefetch') // TODO: need test
|
config.plugins.delete("prefetch"); // TODO: need test
|
||||||
|
|
||||||
// set svg-sprite-loader
|
// set svg-sprite-loader
|
||||||
|
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
|
||||||
config.module
|
config.module
|
||||||
.rule('svg')
|
.rule("icons")
|
||||||
.exclude.add(resolve('src/assets/icons'))
|
|
||||||
.end()
|
|
||||||
config.module
|
|
||||||
.rule('icons')
|
|
||||||
.test(/\.svg$/)
|
.test(/\.svg$/)
|
||||||
.include.add(resolve('src/assets/icons'))
|
.include.add(resolve("src/assets/icons"))
|
||||||
.end()
|
.end()
|
||||||
.use('svg-sprite-loader')
|
.use("svg-sprite-loader")
|
||||||
.loader('svg-sprite-loader')
|
.loader("svg-sprite-loader")
|
||||||
.options({
|
.options({
|
||||||
symbolId: 'icon-[name]'
|
symbolId: "icon-[name]",
|
||||||
})
|
})
|
||||||
.end()
|
.end();
|
||||||
|
|
||||||
config.when(process.env.NODE_ENV !== 'development', config => {
|
config.when(process.env.NODE_ENV !== "development", (config) => {
|
||||||
config
|
config
|
||||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
.plugin("ScriptExtHtmlWebpackPlugin")
|
||||||
.after('html')
|
.after("html")
|
||||||
.use('script-ext-html-webpack-plugin', [{
|
.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'),
|
|
||||||
{
|
{
|
||||||
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||||
to: './' //到根目录下
|
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: "./", //到根目录下
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue