add:拣选页面机功能

This commit is contained in:
zhangzq
2024-06-17 09:39:18 +08:00
parent 66793b7655
commit 6399080695
21 changed files with 1406 additions and 43 deletions

View File

@@ -31,7 +31,7 @@ public enum StatusEnum {
/** /**
* 出入库单据类型 * 出入库单据类型
*/ */
IOBILL_TYPE_IN(ForkMap.of("生产入库", "10","inStorageTask", "调拨入库", "11","inStorageTask", "退货入库", "12","inStorageTask")), IOBILL_TYPE_IN(ForkMap.of("生产入库", "10","inStorageTask", "调拨入库", "11","inStorageTask", "退货入库", "12","inStorageTask","拣选回库", "13","inStorageTask")),
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20","outStorageTask","生产出库", "21","outStorageTask", "调拨出库", "22","outStorageTask", "拣选出库", "23","outStorageTask")), IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20","outStorageTask","生产出库", "21","outStorageTask", "调拨出库", "22","outStorageTask", "拣选出库", "23","outStorageTask")),
/** /**

View File

@@ -75,11 +75,11 @@ public class BmFormStrucController {
public ResponseEntity<Object> update(@RequestBody JSONObject param){ public ResponseEntity<Object> update(@RequestBody JSONObject param){
//逻辑判断:如果有数据了则不允许修改 //逻辑判断:如果有数据了则不允许修改
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class); BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
List<PmFormData> formDatas = iPmFormDataService.getByType(param.getString("form_type")); // List<PmFormData> formDatas = iPmFormDataService.getByType(param.getString("form_type"));
if (!CollectionUtils.isEmpty(formDatas)){ // if (!CollectionUtils.isEmpty(formDatas)){
throw new BadRequestException("当前表单存在数据,不允许直接修改"); // throw new BadRequestException("当前表单存在数据,不允许直接修改");
} // }
formStruc.setUpdate_time(DateUtil.now()); // formStruc.setUpdate_time(DateUtil.now());
formStruc.setUpdate_name(SecurityUtils.getCurrentUserId()); formStruc.setUpdate_name(SecurityUtils.getCurrentUserId());
iBmFormStrucService.updateById(formStruc); iBmFormStrucService.updateById(formStruc);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -69,7 +69,7 @@ public class BmFormStrucServiceImpl extends ServiceImpl<BmFormStrucMapper, BmFor
List<BmFormStruc> childList = childMap.get(strucDto.getId()); List<BmFormStruc> childList = childMap.get(strucDto.getId());
if (CollectionUtil.isNotEmpty(childList)) { if (CollectionUtil.isNotEmpty(childList)) {
strucDto.setHasChildren(true); strucDto.setHasChildren(true);
strucDto.setChildren(CopyUtil.copyList(childList,BmFormStrucDto.class)); strucDto.setChildren(CopyUtil.copyList(findChildren(childList),BmFormStrucDto.class));
} }
} }
} }

View File

@@ -81,8 +81,8 @@ public class StrucFormActivityBehavior extends FlowNodeActivityBehavior<JSONObje
//TODO:id,code等非映射字段后续可以通过SpringEL表达式生成 //TODO:id,code等非映射字段后续可以通过SpringEL表达式生成
JSONObject mst_json = handler.getJSONObject("t"); JSONObject mst_json = handler.getJSONObject("t");
mst_json.put("id",IdUtil.getStringId()); mst_json.put("id",IdUtil.getStringId());
mst_json.put("create_time",DateUtil.now());
mst_json.put("form_type",targetStruc.getForm_type()); mst_json.put("form_type",targetStruc.getForm_type());
mst_json.put("create_time",DateUtil.now());
mst_json.put("create_name",SecurityUtils.getCurrentNickName()); mst_json.put("create_name",SecurityUtils.getCurrentNickName());
mst_json.put("status",StatusEnum.FORM_STATUS.code("生成")); mst_json.put("status",StatusEnum.FORM_STATUS.code("生成"));
mst_json.put("code",CodeUtil.getNewCode(currentNode.getForm_type())); mst_json.put("code",CodeUtil.getNewCode(currentNode.getForm_type()));
@@ -92,11 +92,18 @@ public class StrucFormActivityBehavior extends FlowNodeActivityBehavior<JSONObje
JSONArray itemArr = handler.getJSONArray("item"); JSONArray itemArr = handler.getJSONArray("item");
if(itemArr !=null){ if(itemArr !=null){
for (int i = 0; i < itemArr.size(); i++) { for (int i = 0; i < itemArr.size(); i++) {
JSONObject dtl = itemArr.getJSONObject(i); JSONObject item = itemArr.getJSONObject(i);
dtl.put("inv_id",mst.getId()); JSONObject dtl = item.getJSONObject("t");
dtl.put("parent_id",mst.getId());
dtl.put("create_time",DateUtil.now());
dtl.put("create_name",SecurityUtils.getCurrentNickName());
dtl.put("status",StatusEnum.FORM_STATUS.code("生成")); dtl.put("status",StatusEnum.FORM_STATUS.code("生成"));
dtl.put("id",IdUtil.getStringId()); dtl.put("id",IdUtil.getStringId());
dtl.put("source_form_id",item.getString("source_form_id"));
dtl.put("source_form_type",item.getString("source_form_type"));
dtl.put("form_type",item.getString("form_type"));
PmFormData iostorinvdtl= dtl.toJavaObject(PmFormData.class); PmFormData iostorinvdtl= dtl.toJavaObject(PmFormData.class);
item.put("form_id",iostorinvdtl.getId());
iPmFormDataService.save(iostorinvdtl); iPmFormDataService.save(iostorinvdtl);
} }
} }

View File

@@ -75,9 +75,13 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
if (skip.contains("#M")){ if (skip.contains("#M")){
formDataSpelMap.put(item,skip); formDataSpelMap.put(item,skip);
continue; continue;
}else {
value = sourceFormData.getString(skip);
} }
if(skip.contains("#V[]")){
//直接指定参数
value = sourceFormData.getString(skip);
continue;
}
value = sourceFormData.getString(skip);
} }
} }
form_data.put(item,value); form_data.put(item,value);

View File

@@ -45,16 +45,17 @@ public class PmFormData implements Serializable {
/** /**
* 业务单据编号 * 业务单据编号
*/ */
private String biz_id; private String source_form_id;
/** /**
* 业务单据编号 * 业务单据编号
*/ */
private String biz_code; private String source_form_type;
/** /**
* 业务单据日期 * 业务单据日期
*/ */
private String biz_date; private String source_form_date;
/** /**
* 单据类型 * 单据类型

View File

@@ -6,9 +6,9 @@
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="code" column="code"/> <result property="code" column="code"/>
<result property="proc_inst_id" column="proc_inst_id"/> <result property="proc_inst_id" column="proc_inst_id"/>
<result property="biz_code" column="biz_code"/> <result property="source_form_type" column="source_form_type"/>
<result property="biz_id" column="biz_id"/> <result property="source_form_id" column="source_form_id"/>
<result property="biz_date" column="biz_date"/> <result property="source_form_date" column="source_form_date"/>
<result property="form_type" column="form_type"/> <result property="form_type" column="form_type"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="create_name" column="create_name"/> <result property="create_name" column="create_name"/>
@@ -26,9 +26,9 @@
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="code" column="code"/> <result property="code" column="code"/>
<result property="proc_inst_id" column="proc_inst_id"/> <result property="proc_inst_id" column="proc_inst_id"/>
<result property="biz_code" column="biz_code"/> <result property="source_form_type" column="source_form_type"/>
<result property="biz_id" column="biz_id"/> <result property="source_form_id" column="source_form_id"/>
<result property="biz_date" column="biz_date"/> <result property="source_form_type" column="source_form_type"/>
<result property="form_type" column="form_type"/> <result property="form_type" column="form_type"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="create_name" column="create_name"/> <result property="create_name" column="create_name"/>
@@ -75,6 +75,9 @@
<if test="query.form_type != null and query.form_type != ''"> <if test="query.form_type != null and query.form_type != ''">
and form_type = #{query.form_type} and form_type = #{query.form_type}
</if> </if>
<if test="query.parent_id != null and query.parent_id != ''">
and parent_id = #{query.parent_id}
</if>
<if test="query.form_query != null and query.form_query.size() > 0"> <if test="query.form_query != null and query.form_query.size() > 0">
<foreach collection="query.form_query" item="value" index="key" > <foreach collection="query.form_query" item="value" index="key" >
<if test="value != null and value != ''"> <if test="value != null and value != ''">

View File

@@ -14,5 +14,6 @@ import java.util.Map;
public class FormDataQuery extends BaseQuery<PmFormData> { public class FormDataQuery extends BaseQuery<PmFormData> {
private String form_type; private String form_type;
private String parent_id;
private Map<String,String> form_query; private Map<String,String> form_query;
} }

View File

@@ -43,16 +43,16 @@ public class PmFormDataDto implements Serializable {
/** /**
* 业务单据编号 * 业务单据编号
*/ */
private String biz_id; private String source_form_id;
/** /**
* 业务单据编号 * 业务单据编号
*/ */
private String biz_code; private String source_form_type;
/** /**
* 业务单据日期 * 业务单据日期
*/ */
private String biz_date; private String source_form_date;
/** /**
* 单据类型 * 单据类型

View File

@@ -146,9 +146,12 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
@Override @Override
public Object getSonDtlFormData(String id) { public Object getSonDtlFormData(String id) {
LambdaQueryWrapper<PmFormData> lqw = new LambdaQueryWrapper<>(); if (StringUtils.isEmpty(id)){
lqw.eq(PmFormData::getParent_id, id); throw new BadRequestException("请求参数不能为空");
return this.list(lqw); }
FormDataQuery query = new FormDataQuery();
query.setParent_id(id);
return this.baseMapper.queryTree(query);
} }
@Override @Override

View File

@@ -0,0 +1,49 @@
package org.nl.wms.stor_manage.pick.controller;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.entity.PageQuery;
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 表单信息表 前端控制器
* </p>
*
* @author generator
* @since 2024-03-25
*/
@RestController
@RequestMapping("/api/picking")
public class PickingController {
@Autowired
private IPmFormDataService formDataService;
@GetMapping()
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
return new ResponseEntity<>(TableDataInfo.build(formDataService.queryTree(query,page)), HttpStatus.CREATED);
}
@GetMapping("/getSonFormData/{id}")
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
//参数判读,参数解析,调用参数入库
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
return new ResponseEntity<>(formDataService.getSonDtlFormData(id),HttpStatus.OK);
}
@GetMapping("/sync/{type}")
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
//参数判读,参数解析,调用参数入库
formDataService.syncFormData("type", formDtl);
return new ResponseEntity<>(HttpStatus.CREATED);
}
}

View File

@@ -317,9 +317,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
@Override @Override
public List<MenuDto> buildTree(List<MenuDto> menuDtos) { public List<MenuDto> buildTree(List<MenuDto> menuDtos) {
menuDtos.sort(Comparator.comparingInt(MenuDto::getMenu_sort));
List<MenuDto> trees = new ArrayList<>(); List<MenuDto> trees = new ArrayList<>();
Set<String> ids = new HashSet<>(); Set<String> ids = new HashSet<>();
List<MenuDto> collect = menuDtos.stream().filter(a -> a.getType().equals("2")).collect(Collectors.toList()); List<MenuDto> collect = menuDtos.stream().filter(a -> a.getType().equals("2")).collect(Collectors.toList());
collect.sort(Comparator.comparingInt(MenuDto::getMenu_sort));
for (MenuDto menuDTO : collect) { for (MenuDto menuDTO : collect) {
if (menuDTO.getPid() == null) { if (menuDTO.getPid() == null) {
trees.add(menuDTO); trees.add(menuDTO);
@@ -348,6 +350,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
} else { } else {
queryWrapper = new QueryWrapper<SysMenu>().isNull("pid"); queryWrapper = new QueryWrapper<SysMenu>().isNull("pid");
} }
queryWrapper.orderByAsc("menu_sort");
return baseMapper.selectList(queryWrapper); return baseMapper.selectList(queryWrapper);
} }
@@ -461,4 +464,4 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
baseMapper.getMenusByRole(systemType,category); baseMapper.getMenusByRole(systemType,category);
return null; return null;
} }
} }

View File

@@ -31,6 +31,7 @@ const user = {
const rememberMe = userInfo.rememberMe const rememberMe = userInfo.rememberMe
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => { login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => {
debugger
setToken(res.token, rememberMe) setToken(res.token, rememberMe)
commit('SET_TOKEN', res.token) commit('SET_TOKEN', res.token)
setUserInfo(res.user, commit) setUserInfo(res.user, commit)

View File

@@ -16,10 +16,13 @@
<el-form-item label="单据类型" prop="form_type"> <el-form-item label="单据类型" prop="form_type">
<el-input v-model="form.form_type" disabled clearable style="width: 210px"/> <el-input v-model="form.form_type" disabled clearable style="width: 210px"/>
</el-form-item> </el-form-item>
<el-form-item label="业务单据编码" prop="biz_code"> <el-form-item label="业务单据类型" prop="source_form_type">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/> <el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item> </el-form-item>
<el-form-item label="业务单据时间" prop="biz_date"> <el-form-item label="业务单据id" prop="source_form_id">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据时间" prop="source_form_date">
<!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"--> <!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>--> <!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.biz_date" disabled clearable style="width: 210px"/> <el-input v-model="form.biz_date" disabled clearable style="width: 210px"/>
@@ -79,13 +82,14 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange" @current-change="handleDtlCurrentChange"
> >
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/> <el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/> <el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/> <el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/> <el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="分配数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/> <el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"> <el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -94,13 +98,16 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/> <el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_type" label="业务单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/> <el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" <el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
:label="item.lable"> :label="item.lable">
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template> <template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" label="创建时间"/> <el-table-column prop="create_time" label="创建时间"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table> </el-table>
</el-card> </el-card>
</el-dialog> </el-dialog>
@@ -129,6 +136,7 @@ export default {
data() { data() {
return { return {
cols: [], cols: [],
dtlCols: [],
dialogVisible: false, dialogVisible: false,
tableDtl: [], tableDtl: [],
tabledis: [], tabledis: [],
@@ -172,9 +180,13 @@ export default {
setForm(row) { setForm(row) {
this.dialogVisible = true this.dialogVisible = true
this.form = row this.form = row
let dtl_form_type = this.form.children[0].form_type;
formstruc.getHeader(this.form.form_type).then(res => { formstruc.getHeader(this.form.form_type).then(res => {
this.cols = res this.cols = res
}) })
formstruc.getHeader(dtl_form_type).then(res => {
this.dtlCols = res
})
this.queryTableDtl(row.id) this.queryTableDtl(row.id)
}, },
close() { close() {

View File

@@ -92,12 +92,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" /> <el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"> <el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-for="item in formStatus"> <template v-for="item in formStatus">
@@ -105,9 +99,16 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" /> <el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120" />
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120" />
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
<el-table-column prop="unit_id" label="单位" show-overflow-tooltip width="120" />
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" /> <el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" />
<el-table-column prop="create_time" label="创建时间" />
<el-table-column <el-table-column
v-for="(item, index) in cols" v-for="(item, index) in cols"
:key="item.value" :key="item.value"
@@ -117,6 +118,8 @@
> >
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template> <template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" label="创建时间" />
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
<el-table-column <el-table-column
v-permission="['admin','Classstandard:edit','Classstandard:del']" v-permission="['admin','Classstandard:edit','Classstandard:del']"
label="操作" label="操作"

View File

@@ -0,0 +1,255 @@
<template>
<el-dialog
title="单据选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="单据类型">
<el-select
v-model="query.form_type"
filterable
size="mini"
placeholder="请选择/搜索"
class="filter-item"
@change="crud.toQuery()"
>
<el-option
v-for="item in tableEnum.bm_form_struc"
:key="item.value"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item label="单据编码">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
@current-change="clickChange"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :label="item.lable" >
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
<el-table-column
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
<el-dialog
title="单据明细"
append-to-body
:visible.sync="dtlVisible"
destroy-on-close
width="1000px"
>
<!--表格渲染-->
<el-table
:data="childrenList">
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :label="item.lable" >
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
</el-table>
<!--分页组件-->
<span slot="footer" class="dialog-footer">
<el-button @click="dtlVisible = false"> </el-button>
</span>
</el-dialog>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
import crudFormData from "./formData";
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'FormDia',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
},
mixins: [presenter(), header()],
tableEnums: [ 'bm_form_struc#form_name#form_type' ],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
}
},
data() {
return {
cols: [],
dialogVisible: false,
dtlVisible: false,
childrenList: [],
tableRadio: null,
checkrow: null,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
},
[CRUD.HOOK.beforeRefresh]() {
if (this.query.form_type !=null){
formstruc.getHeader(this.query.form_type).then(res => {
this.cols = res
})
return true
}
return false
},
toView(row){
if (row.hasChildren){
this.dtlVisible = true
this.childrenList = row.children;
}
},
clickChange(item) {
this.tableRadio = item
},
handleSelectionChange(val, row) {
if (this.isSingle) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.dialogVisible = false
let subData = {}
this.$set(subData, 't', this.form)
this.$set(subData, 'item', this.tableRadio)
this.$emit('update:dialogShow', false)
this.$emit('setMaterValue', subData)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
let subData = {}
this.$set(subData, 't', this.rows[0])
this.$set(subData, 'item', this.rows[0].children)
this.$emit('setMaterValue', subData)
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,284 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
title="拣选作业"
:visible.sync="dialogVisible"
fullscreen
@close="close"
@open="open"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" size="mini" label-width="100px" label-suffix=":">
<el-form-item label="单据编号" prop="code">
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据类型" prop="form_type">
<el-input v-model="form.form_type" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据类型" prop="source_form_type">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据id" prop="source_form_id">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据时间" prop="source_form_date">
<!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.biz_date" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="批次" prop="pcsn">
<el-input v-model="form.pcsn" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="物料数量" prop="qty">
<el-input v-model="form.qty" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="载具编号" prop="vehicle_code">
<el-input v-model="form.vehicle_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据状态" prop="status">
<el-select
v-model="form.status"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 180px;"
disabled
>
<el-option
v-for="item in formStatus"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.create_time" disabled clearable style="width: 210px"/>
</el-form-item>
<template v-for="(col,index) in cols">
<el-form-item label="col.lable" prop="bill_code">
<label slot="label">{{ col.lable }}:</label>
<el-input disabled v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px"/>
</el-form-item>
</template>
</el-form>
<div class="crud-opts2">
<span class="role-span2">作业明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="拣选载具" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_type" label="业务单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
:label="item.lable">
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import {crud} from '@crud/crud'
import crudFormData, {getSonFormData} from './formData'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'ViewDialog',
components: {formstruc},
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
cols: [],
dtlCols: [],
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {},
formStatus: [
{
value: '10',
label: '生成'
},
{
value: '20',
label: '执行中'
},
{
value: '99',
label: '完成'
}
]
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
},
setForm(row) {
this.dialogVisible = true
this.form = row
let dtl_form_type = this.form.children[0].form_type;
formstruc.getHeader(this.form.form_type).then(res => {
this.cols = res
})
formstruc.getHeader(dtl_form_type).then(res => {
this.dtlCols = res
})
this.queryTableDtl(row.id)
},
close() {
this.dialogVisible = false
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
statusFormat(row) {
return this.dict.label.status[row.status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl(id) {
crudFormData.getSonFormData(id).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.status[row.status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,125 @@
<!--<template>-->
<!-- <el-dialog-->
<!-- title="导入Excel文件"-->
<!-- append-to-body-->
<!-- :visible.sync="dialogVisible"-->
<!-- destroy-on-close-->
<!-- width="400px"-->
<!-- :show-close="true"-->
<!-- @close="close"-->
<!-- @open="open"-->
<!-- >-->
<!-- <el-upload-->
<!-- ref="upload"-->
<!-- class="upload-demo"-->
<!-- action=""-->
<!-- drag-->
<!-- :on-exceed="is_one"-->
<!-- :limit="1"-->
<!-- :auto-upload="false"-->
<!-- :multiple="false"-->
<!-- :show-file-list="true"-->
<!-- :on-change="uploadByJsqd"-->
<!-- :file-list="fileList"-->
<!-- accept=".xlsx,.xls"-->
<!-- >-->
<!-- <i class="el-icon-upload" />-->
<!-- <div class="el-upload__text">-->
<!-- 将文件拖到此处-->
<!-- <em>点击上传</em>-->
<!-- </div>-->
<!-- <div slot="tip" class="el-upload__tip">只能上传Excel文件且不超过10MB</div>-->
<!-- </el-upload>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button @click="dialogVisible = false"> </el-button>-->
<!-- <el-button type="primary" @click="submit"> </el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<!--</template>-->
<!--<script>-->
<!--import crudClassstandard from './classstandard'-->
<!--import CRUD, { crud } from '@crud/crud'-->
<!--import { download2 } from '@/api/data'-->
<!--import { downloadFile } from '@/utils'-->
<!--export default {-->
<!-- name: 'UploadDialog',-->
<!-- mixins: [crud()],-->
<!-- components: {},-->
<!-- props: {-->
<!-- dialogShow: {-->
<!-- type: Boolean,-->
<!-- default: false-->
<!-- },-->
<!-- openParam: {-->
<!-- type: String-->
<!-- }-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- dialogVisible: false,-->
<!-- fileList: [],-->
<!-- file1: ''-->
<!-- }-->
<!-- },-->
<!-- watch: {-->
<!-- dialogShow: {-->
<!-- handler(newValue, oldValue) {-->
<!-- this.dialogVisible = newValue-->
<!-- }-->
<!-- },-->
<!-- openParam: {-->
<!-- handler(newValue, oldValue) {-->
<!-- this.opendtlParam = newValue-->
<!-- }-->
<!-- }-->
<!-- },-->
<!-- methods: {-->
<!-- open() {-->
<!-- },-->
<!-- close() {-->
<!-- this.$emit('update:dialogShow', false)-->
<!-- },-->
<!-- is_one() {-->
<!-- this.crud.notify('只能上传一个excel文件', CRUD.NOTIFICATION_TYPE.WARNING)-->
<!-- },-->
<!-- // 文件校验方法-->
<!-- beforeAvatarUpload(file) {-->
<!-- // 不能导入大小超过2Mb的文件-->
<!-- if (file.size > 10 * 1024 * 1024) {-->
<!-- return false-->
<!-- }-->
<!-- return true-->
<!-- },-->
<!-- // 文件发生改变就会触发的事件-->
<!-- uploadByJsqd(file) {-->
<!-- this.file1 = file-->
<!-- },-->
<!-- submit() {-->
<!-- if (this.beforeAvatarUpload(this.file1)) {-->
<!-- this.fileList.name = this.file1.name-->
<!-- this.fileList.url = ''-->
<!-- var formdata = new FormData()-->
<!-- formdata.append('file', this.file1.raw)-->
<!-- // excelImport请求接口 formdata传递参数-->
<!-- crudClassstandard.excelImport(formdata).then((res) => {-->
<!-- this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)-->
<!-- this.$emit('tableChanged3', '')-->
<!-- this.$emit('update:dialogShow', false)-->
<!-- }).catch(err => {-->
<!-- const list = err.response.data.message-->
<!-- download2('/api/produceWorkorder/download', list).then(result => {-->
<!-- downloadFile(result, '错误信息汇总', 'xlsx')-->
<!-- crud.downloadLoading = false-->
<!-- })-->
<!-- })-->
<!-- } else {-->
<!-- this.crud.notify('文件过大请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)-->
<!-- }-->
<!-- }-->
<!-- }-->
<!--}-->
<!--</script>-->

View File

@@ -0,0 +1,272 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
title="单据详情"
:visible.sync="dialogVisible"
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" size="mini" label-width="100px" label-suffix=":">
<el-form-item label="单据编号" prop="code">
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据类型" prop="form_type">
<el-input v-model="form.form_type" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据类型" prop="source_form_type">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据id" prop="source_form_id">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据时间" prop="source_form_date">
<!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.biz_date" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="批次" prop="pcsn">
<el-input v-model="form.pcsn" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="物料数量" prop="qty">
<el-input v-model="form.qty" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="载具编号" prop="vehicle_code">
<el-input v-model="form.vehicle_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据状态" prop="status">
<el-select
v-model="form.status"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 180px;"
disabled
>
<el-option
v-for="item in formStatus"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.create_time" disabled clearable style="width: 210px"/>
</el-form-item>
<template v-for="(col,index) in cols">
<el-form-item label="col.lable" prop="bill_code">
<label slot="label">{{ col.lable }}:</label>
<el-input disabled v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px"/>
</el-form-item>
</template>
</el-form>
<div class="crud-opts2">
<span class="role-span2">单据明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="拣选载具" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_type" label="业务单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
:label="item.lable">
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import {crud} from '@crud/crud'
import crudFormData, {getSonFormData} from './formData'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'ViewDialog',
components: {formstruc},
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
cols: [],
dtlCols: [],
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {},
formStatus: [
{
value: '10',
label: '生成'
},
{
value: '20',
label: '执行中'
},
{
value: '99',
label: '完成'
}
]
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
},
setForm(row) {
this.dialogVisible = true
this.form = row
let dtl_form_type = this.form.children[0].form_type;
formstruc.getHeader(this.form.form_type).then(res => {
this.cols = res
})
formstruc.getHeader(dtl_form_type).then(res => {
this.dtlCols = res
})
this.queryTableDtl(row.id)
},
close() {
this.dialogVisible = false
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
statusFormat(row) {
return this.dict.label.status[row.status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl(id) {
crudFormData.getSonFormData(id).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.status[row.status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/pmFormData',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/pmFormData',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/pmFormData',
method: 'put',
data
})
}
export function getFormType() {
return request({
url: 'api/bmFormStruc/getTypes',
method: 'get',
})
}
export function getParentFormTypes() {
return request({
url: 'api/bmFormStruc/getParentFormTypes',
method: 'get',
})
}
export function getSonFormData(id) {
return request({
url: 'api/pmFormData/getSonFormData/' + id,
method: 'get',
})
}
export default {add, edit, del, getFormType, getParentFormTypes, getSonFormData}

View File

@@ -0,0 +1,291 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="单据类型">
<el-select
v-model="query.form_type"
filterable
size="mini"
placeholder="请选择/搜索"
class="filter-item"
@change="crud.toQuery()"
>
<el-option
v-for="item in fromTypes"
:key="item.value"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<template v-for="(col,index) in cols" v-if="hideShowDialog">
<el-form-item label="col.lable">
<label slot="label">{{ col.lable }}:</label>
<el-input v-model="query.form_query[col.value]" :value="col.value" clearable style="width: 210px" />
</el-form-item>
</template>
<rrOperation :crud="crud" />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
size="mini"
type="success"
icon="el-icon-s-operation"
@click="ToExpandall"
>
全部展开
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-upload2"
size="mini"
>
导入
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="dis_flag"
@click="disOpen"
>
拣选作业
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- icon="el-icon-view"-->
<!-- size="mini"-->
<!-- @click="hideShow"-->
<!-- >-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"
icon="el-icon-view"
size="mini"
@click="hideShow"
/>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
@select="handleCurrentChange"
:data="crud.data"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-link v-if="scope.row.hasChildren" type="warning" @click="toView(scope.row)">{{
scope.row.code
}}
</el-link>
<span v-else>{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in statusEnum.FORM_STATUS">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120" />
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120" />
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
<el-table-column prop="unit_id" label="单位" show-overflow-tooltip width="120" />
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" />
<el-table-column
v-for="(item, index) in cols"
:key="item.value"
width="130"
show-overflow-tooltip
:label="item.lable"
>
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" />
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
<el-table-column
v-permission="['admin','Classstandard:edit','Classstandard:del']"
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:permission="permission"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<ViewDialog ref="viewDialog" />
<TaskDialog ref="taskDis"/>
</div>
</template>
<script>
import crudFormData from './formData'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
import ViewDialog from './ViewDialog'
import TaskDialog from './TaskDialog'
// import UploadDialog from './UploadDialog'
const defaultForm = {
id: null,
code: null,
proc_inst_id: null,
biz_id: null,
boz_code: null,
biz_date: null,
form_type: null,
status: null,
create_time: null,
create_name: null,
material_id: null,
qty: null,
pcsn: null,
vehicle_code: null,
from_data: null,
parent_id: null
}
export default {
name: 'FormData',
statusEnums: ['FORM_STATUS'],
components: { pagination, crudOperation, rrOperation, udOperation, ViewDialog, TaskDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '基础类别',
url: 'api/pmFormData',
idField: 'id',
sort: 'id,desc',
crudMethod: { ...crudFormData },
optShow: {
add: true,
reset: true
},
query: {
form_type:'Picking',
form_data: {}
}
})
},
data() {
return {
cols: [],
classes: [],
currentRow: null,
uploadShow: false,
dis_flag: true,
fromTypes: [],
permission: {},
rules: {},
hideShowDialog: false
}
},
mounted() {
},
created() {
// 获取分类
formstruc.getHeader('Picking').then(res => {
this.cols = res
res.forEach(a => {
this.form.form_data[a.value, '']
})
})
},
methods: {
ToExpandall() {
const els = document.getElementsByClassName('el-table__expand-icon')
if (this.crud.data.length !== 0 && els.length !== 0) {
for (let j1 = 0; j1 < els.length; j1++) {
els[j1].classList.add('dafult')
}
if (this.$el.getElementsByClassName('el-table__expand-icon--expanded')) {
const open = this.$el.getElementsByClassName('el-table__expand-icon--expanded')
for (let j = 0; j < open.length; j++) {
open[j].classList.remove('dafult')
}
const dafult = this.$el.getElementsByClassName('dafult')
for (let a = 0; a < dafult.length; a++) {
dafult[a].click()
}
}
}
},
hideShow() {
if (this.hideShowDialog) {
// this.$set(this.query, 'form_query', {})
}
this.hideShowDialog = !this.hideShowDialog
},
toView(row) {
if (row !== null) {
this.$refs.viewDialog.setForm(row)
}
},
handleCurrentChange(val, row) {
if (val.length > 1) {
this.dis_flag = true
this.currentRow = {}
} else if (val.length === 1) {
this.dis_flag = false
this.currentRow = row
}
},
disOpen(row) {
if (this.currentRow !== null) {
this.$refs.taskDis.setForm(this.currentRow)
}
}
}
}
</script>
<style scoped>
</style>