import request from '@/utils/request' // 机床名称 export function getMachines() { return request({ url: '', method: 'post', data: { type: '1', name: '车间生产管理工艺_传递后_机床名称_根据机床查询', param: '是否传递=2=int&考核状态=6=int&工艺任务分配状态=2=int&定额任务分配状态=2=int&单件是否外协=1=int' } }) } // 获取组号 export function getGroups(stepNumber) { return request({ url: '', method: 'post', data: { type: '1', name: '车间生产管理工艺_传递后_组件名称_查询数据_查询所有组', param: '机床流水号=' + stepNumber + '=int' } }) } export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize) { return request({ url: '', method: 'post', data: { type: '1', name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_横向赋值新建存储过程_新', param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m, Pagination: pageCurrent + '&' + pageSize } }) } // 获取组号 export function gettabledata1(num) { return request({ url: '', method: 'post', data: { type: '1', name: '车间生产管理工艺_加工进度查询_查询_New', param: '工艺计划流水号=' + num + '=int' } }) } // 补录加工完成日期 export function editdata(processSerialNumber) { return request({ url: '', method: 'post', data: { type: '2', name: '车间生产管理工艺_加工进度查询_查询_New', param: '工艺计划流水号=' + processSerialNumber + '=int' } }) } // 初始化人员信息 弹出框 export function getTree() { return request({ url: '', method: 'post', data: { type: 1, name: '人事档案管理_部门关系_查询节点', param: '子节点=0=int' } }) } export function fn(data, pid) { const result = [] let temp for (let i = 0; i < data.length; i++) { if (data[i].父节点 === pid) { const obj = { label: data[i].节点名称, id: data[i].子节点 } temp = fn(data, data[i].子节点) if (temp.length > 0) { obj.children = temp } result.push(obj) } } return result } export function getTable8(code) { return request({ url: '', method: 'post', data: { type: 1, name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param: '考核部门编号=' + code + '=int' } }) } export function submitEdit(Number1, completetime, processSerialNumber) { return request({ url: '', method: 'post', data: { type: 2, name: '车间生产管理工艺_零件工序_修改数据_工作者_根据人员编号和完成日期', param: '人员编号=' + Number1 + '=string&完成日期=' + completetime + '=string&工序流水号=' + processSerialNumber + '=string' } }) } export function getExport(num) { return request({ url: '', method: 'post', data: { type: '3', name: `select s1.* from ( select a1.*, row_number() over (partition by 工艺计划流水号 order by 工序顺序) as group_idx from (select TOP 100 PERCENT 零件图号,工艺计划流水号,机床流水号,工序顺序,工艺名称,材料,零件名称,投产数量,组号,机床图号 from dbo.车间生产管理工艺_零件工序_视图 where 考核状态 =6 and 机床流水号 = ${num} and 工艺编号 is not null and 完成日期 is null group by 零件图号,工艺计划流水号,考核状态,机床流水号,工艺名称,工序顺序,材料,零件名称,投产数量,组号,机床图号 order by 工艺计划流水号,工序顺序) as a1 ) s1 where s1.group_idx= 1` } }) } export function searchWorkTime(code) { return request({ url: '', method: 'post', data: { type: 1, name: '车间生产管理工艺_零件工艺计划_完成零件数量状态更改查询', param: '工序流水号=' + code + '=int' } }) } export function submit2(num, num1, num2) { return request({ url: '', method: 'post', data: { type: '2', name: '车间生产管理工艺_零件工艺计划_完成零件数量状态更改', param: `工序流水号=${num}&完成数量=${num1}&操作者=${num2}` } }) }