| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- import request from '@/utils/request';
- /**
- * 列表
- */
- export async function getList(data) {
- const res = await request.post('/aps/productionplan/page', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 保存
- */
- export async function save(data) {
- const res = await request.post('/aps/productionplan/save', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 基本信息
- */
- export async function getById(id) {
- console.log(id);
- const res = await request.get(`/aps/productionplan/getById/` + id);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 发布信息返显
- */
- export async function getReleaseInfoById(id) {
- const res = await request.get(`/aps/productionplan/getReleaseInfoById/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 详情
- */
- export async function getProductPlanDetail(id) {
- const res = await request.get(
- `/aps/productionplan/getProductPlanDetail/${id}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 根据计划id获取物料信息
- */
- export async function getMaterialinfo(planId) {
- const res = await request.get(`/aps/materialinfo/listByPlanId`, {
- params: { planId }
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 删除
- */
- export async function del(id) {
- const res = await request.delete(`/aps/productionplan/delete/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 删除
- */
- export async function factoryDelete(id) {
- const res = await request.delete(`/aps/productionplan/delete/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 拆分
- export async function splitWork(params) {
- const res = await request.post(`/aps/productionplan/splitBatch`, params);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 计划合批
- export async function mergeBatch(params) {
- const res = await request.post(`/aps/productionplan/mergeBatch`, params);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 修改优先级
- export async function updatePriority(data) {
- const res = await request.post(`/aps/productionplan/updatePriority`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 生产详情列表
- */
- export async function queryTaskDetail(data) {
- const res = await request.get(
- '/aps/quality_details_work_order/queryPlanId/' + data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 计划分解(获取产品BOM)
- // export async function getBom(params) {
- // const res = await request.get(`/main/bomCategory/getBom`, { params });
- // if (res.data.code == 0) {
- // return res.data.data;
- // }
- // return Promise.reject(new Error(res.data.message));
- // }
- export async function getBom(params) {
- const res = await request.get(`/main/bomCategory/getBomByPlanSplit`, {
- params
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 计划分解 (保存)
- export async function batchSave(data) {
- const res = await request.post(`/aps/productionplan/batchSave`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 计划分解 (保存并发布)
- export async function issueProductionPlan(data) {
- const res = await request.post(
- `/aps/productionplan/issueProductionPlan`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 齐套性检查
- export async function homogeneityInspect(data) {
- const res = await request.post(
- `/aps/productionplan/homogeneityInspect`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function getStockList(params) {
- const res = await request.get('/wms/outindetailtwo/page', { params });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function getCurrentList(data) {
- const res = await request.post('/eom/purchaseorder/getZtDetail', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 齐套性检查
- export async function homogeneityInspectMerge(data) {
- const res = await request.post(
- `/aps/productionplan/homogeneityInspectMerge`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // PBOM树
- export async function getBomRoot(data) {
- const res = await request.post(`/aps/productionplan/getBomRoot`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // PBOM 齐套性检查
- export async function pbomHomogeneityInspect(data) {
- const res = await request.post(
- `/aps/productionplan/pbomHomogeneityInspect`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function orderPbomHomogeneityInspect(data) {
- const res = await request.post(
- `/aps/productionplan/orderPbomHomogeneityInspect`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function getPlanStatistics(params) {
- const res = await request.get('/aps/productionplan/getPlanStatistics', {
- params
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function getOrderBomRoot(data) {
- const res = await request.post(`/aps/productionplan/getOrderBomRoot`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询BOM分类
- export async function findBomCategoryByCategoryIdV2(bomId, produceType) {
- const res = await request.get(
- `/aps/productionplan/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询BOM分类
- export async function bomVersionList(params) {
- const res = await request.get(`/main/bomCategory/versionList`, { params });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询bom类型
- export async function listBomType(params) {
- const res = await request.get(`/main/bomCategory/listBomType`, { params });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询BOM分类
- export async function findBomCategoryByCategoryId(
- categoryId,
- produceType = ''
- ) {
- const res = await request.get(
- `/aps/productionplan/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据计划id查询物料信息
- export async function findMaterialInfoByPlanId(params) {
- const res = await request.get(
- '/aps/productionplan/findMaterialInfoByPlanId',
- {
- params
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function workOrderFindMaterialInfoByPlanId(params) {
- const res = await request.get('/aps/workorder/findMaterialInfoByPlanId', {
- params
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询BOM分类
- export async function findBomSalesorderCategoryIdV2(bomId, produceType) {
- const res = await request.get(
- `/aps/salesorder/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品查询BOM分类
- export async function findBomSalesorderCategoryId(categoryId, produceType) {
- const res = await request.get(
- `/aps/salesorder/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据计划id查询物料信息
- export async function findMaterialInfoSalesorder(params) {
- const res = await request.get(
- '/aps/salesorder/findMaterialInfoBySalesOrderId',
- {
- params
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品ID查询物料信息
- export async function findMaterialInfoByCategory(params) {
- const res = await request.get(
- '/aps/salesorder/findMaterialInfoByCategoryId',
- {
- params
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据产品ID查询物料信息
- export async function getProductKitting(params) {
- const res = await request.get('/aps/productionplan/getProductKitting', {
- params
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据生产计划ID查询江南产品齐套数据
- export async function getJNProductKitting(params) {
- const res = await request.get('/aps/productionplan/getJNProductKitting', {
- params
- });
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //发布计划是否需要审核
- export async function planIsReview(data) {
- const res = await request.post(
- `/aps/productionplan/releaseSaveByApproval`,
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //生产前准备
- export async function completenessCheck(data) {
- const res = await request.post(`/aps/productionplan/preRelease`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //任务派单
- export async function taskReleaseWork(data) {
- const res = await request.post(`/aps/assign/saveEventAssign`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //提醒材料员领料
- export async function remindMaterialPicking(planCode) {
- const res = await request.post(
- `/sys/notifysend/materialRequisitionReminderNotice`,
- null,
- {
- params: { planCode }
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //任务齐套性检查
- export async function updatePreRelease(data) {
- const res = await request.post(`/aps/productionplan/updatePreRelease`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- //任务齐套性检查 订单
- export async function updatePreReleaseOrder(data) {
- const res = await request.post(`/aps/workorder/updatePreRelease`, data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据bomId和工艺路线id获取nc代码
- export async function listBomTaskFile(bomCategoryId, routingId) {
- const res = await request.get(
- `/main/categoryparam/listBomTaskFile/${bomCategoryId}/${routingId}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- export async function newFilePageAPI(data) {
- const res = await request.post('/fm/file/queryIds', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据bomId和工艺路线id获取nc代码
- export async function listBomRoutingFile(bomCategoryId, routingId) {
- const res = await request.get(
- `/main/categoryparam/listBomRoutingFile/${bomCategoryId}/${routingId}`
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据计划id查询辅材信息
- export async function findAssistMaterialInfoByPlanId(params) {
- const res = await request.get(
- '/aps/productionplan/findAssistMaterialInfoByPlanId',
- {
- params
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- // 根据计划id查询制造资源
- export async function findFrockMaterialInfoByPlanId(params) {
- const res = await request.get(
- '/aps/productionplan/findFrockMaterialInfoByPlanId',
- {
- params
- }
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 生产计划排程
- */
- export async function scheduling(data) {
- const res = await request.post('/aps/scheduling/scheduling', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 生产计划排程
- */
- export async function teamSchedulingGanttChart(data) {
- const res = await request.post(
- '/aps/scheduling/teamSchedulingGanttChart',
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 班组排程工位/设备/人员甘特图
- */
- export async function workstationSchedulingGanttChart(data) {
- const res = await request.post(
- '/aps/scheduling/workstationSchedulingGanttChart',
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 生产计划工厂排程
- */
- export async function factorySchedulingGanttChart(data) {
- const res = await request.post(
- '/aps/scheduling/planSchedulingGanttChart',
- data
- );
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 根据计划id查询多个生产计划
- */
- export async function getPlansByIds(ids) {
- const res = await request.post('/aps/productionplan/listByIds', ids);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 检查终止计划
- */
- export async function checkTerminatePlan(data) {
- const res = await request.post('/aps/productionplan/checkKillPlan', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * 终止计划
- */
- export async function terminatePlan(data) {
- const res = await request.post('/aps/productionplan/killPlan', data);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
|