rev:组盘页面修改
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
package org.nl.wms.md_manage.group_dick.service;
|
|
||||||
|
|
||||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGroupMst;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 载具组盘主表 服务类
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author generator
|
|
||||||
* @since 2024-04-28
|
|
||||||
*/
|
|
||||||
public interface IMdGroupMstService extends IService<MdGroupMst> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
package org.nl.wms.md_manage.group_dick.service.dao;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 载具组盘主表
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author generator
|
|
||||||
* @since 2024-04-28
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@TableName("md_group_mst")
|
|
||||||
public class MdGroupMst implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主载具编码
|
|
||||||
*/
|
|
||||||
private String parent_vehicle_code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 子载具数量
|
|
||||||
*/
|
|
||||||
private Integer child_qty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
private String update_name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private String update_time;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义字段
|
|
||||||
*/
|
|
||||||
private String form_data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package org.nl.wms.md_manage.group_dick.service.impl;
|
|
||||||
|
|
||||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGroupMst;
|
|
||||||
import org.nl.wms.md_manage.group_dick.service.dao.mapper.MdGroupMstMapper;
|
|
||||||
import org.nl.wms.md_manage.group_dick.service.IMdGroupMstService;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 载具组盘主表 服务实现类
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author generator
|
|
||||||
* @since 2024-04-28
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class MdGroupMstServiceImpl extends ServiceImpl<MdGroupMstMapper, MdGroupMst> implements IMdGroupMstService {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -95,7 +95,7 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
|||||||
for (int i = 0; i < items_arr.size(); i++) {
|
for (int i = 0; i < items_arr.size(); i++) {
|
||||||
JSONObject itemTarget = items_arr.getJSONObject(i);
|
JSONObject itemTarget = items_arr.getJSONObject(i);
|
||||||
itemTarget.put("id", IdUtil.getStringId());
|
itemTarget.put("id", IdUtil.getStringId());
|
||||||
itemTarget.put("code", CodeUtil.getNewCode(formMapping.getForm_type()));
|
// itemTarget.put("code", CodeUtil.getNewCode(formMapping.getForm_type()));
|
||||||
itemTarget.put("create_time", DateUtil.now());
|
itemTarget.put("create_time", DateUtil.now());
|
||||||
itemTarget.put("create_name", SecurityUtils.getCurrentNickName());
|
itemTarget.put("create_name", SecurityUtils.getCurrentNickName());
|
||||||
itemTarget.put("parent_id", mst.getId());
|
itemTarget.put("parent_id", mst.getId());
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -48,81 +49,86 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
|||||||
@Override
|
@Override
|
||||||
public IPage<SysCodeRule> queryAll(CodeRuleQuery form, PageQuery pageable) {
|
public IPage<SysCodeRule> queryAll(CodeRuleQuery form, PageQuery pageable) {
|
||||||
IPage<SysCodeRule> page = this.page(pageable.build(SysCodeRule.class), form.build());
|
IPage<SysCodeRule> page = this.page(pageable.build(SysCodeRule.class), form.build());
|
||||||
page.getRecords().forEach(sysCodeRule -> sysCodeRule.setDemo(codeDemo("0",sysCodeRule.getCode())));
|
page.getRecords().forEach(sysCodeRule -> {
|
||||||
|
if (StringUtils.isNotEmpty(sysCodeRule.getCode())){
|
||||||
|
sysCodeRule.setDemo(codeDemo("0",sysCodeRule.getCode()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String codeDemo(String flag, String code) {
|
public String codeDemo(String flag, String code) {
|
||||||
List<SysCodeRuleDetail> ruleDtl = this.baseMapper.findBycode(code);
|
SysCodeRule codeRule = this.getOne(new QueryWrapper<SysCodeRule>().eq("code", code));
|
||||||
if (CollectionUtils.isEmpty(ruleDtl)){
|
if (codeRule == null){
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isEmpty(ruleDtl)){
|
|
||||||
throw new BadRequestException("编码规则不存在"+code);
|
throw new BadRequestException("编码规则不存在"+code);
|
||||||
}
|
}
|
||||||
|
List<SysCodeRuleDetail> ruleDtl = this.baseMapper.findBycode(code);
|
||||||
String demo = "";
|
String demo = "";
|
||||||
boolean isSame = true;
|
if (!CollectionUtils.isEmpty(ruleDtl)){
|
||||||
for(SysCodeRuleDetail detail : ruleDtl) {
|
boolean isSame = true;
|
||||||
String value = "";
|
for(SysCodeRuleDetail detail : ruleDtl) {
|
||||||
String type = detail.getType();
|
String value = "";
|
||||||
//固定直接取值
|
String type = detail.getType();
|
||||||
if (type.equals(CodeRuleTypeEnum.FIXED.getType())) {
|
//固定直接取值
|
||||||
value = detail.getInit_value();
|
if (type.equals(CodeRuleTypeEnum.FIXED.getType())) {
|
||||||
}
|
value = detail.getInit_value();
|
||||||
//日期判断数据库的值与当前值是否相同来决定顺序的值
|
|
||||||
if (type.equals(CodeRuleTypeEnum.DATE.getType())) {
|
|
||||||
String currentValue = detail.getCurrent_value();
|
|
||||||
Date date = DateUtil.date();
|
|
||||||
String format = detail.getFormat();
|
|
||||||
String nowDate = DateUtil.format(date, format);
|
|
||||||
if (!nowDate.equals(currentValue)) {
|
|
||||||
isSame = false;
|
|
||||||
}
|
}
|
||||||
if (flag.equals("1")) {
|
//日期判断数据库的值与当前值是否相同来决定顺序的值
|
||||||
detail.setInit_value(nowDate);
|
if (type.equals(CodeRuleTypeEnum.DATE.getType())) {
|
||||||
detail.setCurrent_value(nowDate);
|
String currentValue = detail.getCurrent_value();
|
||||||
|
Date date = DateUtil.date();
|
||||||
|
String format = detail.getFormat();
|
||||||
|
String nowDate = DateUtil.format(date, format);
|
||||||
|
if (!nowDate.equals(currentValue)) {
|
||||||
|
isSame = false;
|
||||||
|
}
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
detail.setInit_value(nowDate);
|
||||||
|
detail.setCurrent_value(nowDate);
|
||||||
|
}
|
||||||
|
value = nowDate;
|
||||||
}
|
}
|
||||||
value = nowDate;
|
//顺序的值:如果日期一样就+步长,等于最大值就归为初始值;日期不一样就归为初始值
|
||||||
}
|
if (type.equals(CodeRuleTypeEnum.ORDER.getType())) {
|
||||||
//顺序的值:如果日期一样就+步长,等于最大值就归为初始值;日期不一样就归为初始值
|
String numValue = "";
|
||||||
if (type.equals(CodeRuleTypeEnum.ORDER.getType())) {
|
int step = Integer.parseInt(detail.getStep());
|
||||||
String numValue = "";
|
Long maxValue = Long.valueOf(detail.getMax_value());
|
||||||
int step = Integer.parseInt(detail.getStep());
|
if (!isSame && (Long.parseLong(detail.getCurrent_value()) + step) > maxValue) {
|
||||||
Long maxValue = Long.valueOf(detail.getMax_value());
|
numValue = detail.getInit_value();
|
||||||
if (!isSame && (Long.parseLong(detail.getCurrent_value()) + step) > maxValue) {
|
|
||||||
numValue = detail.getInit_value();
|
|
||||||
} else {
|
|
||||||
numValue = Integer.parseInt(detail.getCurrent_value()) + step + "";
|
|
||||||
}
|
|
||||||
int size = numValue.length();
|
|
||||||
int length = detail.getLength();
|
|
||||||
String fillchar = detail.getFillchar();
|
|
||||||
for (int m = 0; m < (length - size); m++) {
|
|
||||||
value += fillchar;
|
|
||||||
}
|
|
||||||
value += numValue;
|
|
||||||
if (flag.equals("1")) {
|
|
||||||
if (!isSame) {
|
|
||||||
int initValue = Integer.parseInt(detail.getInit_value());
|
|
||||||
if (StrUtil.isEmpty((initValue + ""))) {
|
|
||||||
throw new BadRequestException("请完善编码数值的初始值!");
|
|
||||||
}
|
|
||||||
detail.setCurrent_value(String.valueOf(initValue));
|
|
||||||
} else {
|
} else {
|
||||||
int numCurr = Integer.parseInt(detail.getCurrent_value());
|
numValue = Integer.parseInt(detail.getCurrent_value()) + step + "";
|
||||||
if (numCurr >= maxValue) {
|
}
|
||||||
numCurr = Integer.parseInt(detail.getInit_value());
|
int size = numValue.length();
|
||||||
detail.setCurrent_value(String.valueOf(numCurr));
|
int length = detail.getLength();
|
||||||
}else{
|
String fillchar = detail.getFillchar();
|
||||||
detail.setCurrent_value(String.valueOf(numCurr + step));
|
for (int m = 0; m < (length - size); m++) {
|
||||||
|
value += fillchar;
|
||||||
|
}
|
||||||
|
value += numValue;
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
if (!isSame) {
|
||||||
|
int initValue = Integer.parseInt(detail.getInit_value());
|
||||||
|
if (StrUtil.isEmpty((initValue + ""))) {
|
||||||
|
throw new BadRequestException("请完善编码数值的初始值!");
|
||||||
|
}
|
||||||
|
detail.setCurrent_value(String.valueOf(initValue));
|
||||||
|
} else {
|
||||||
|
int numCurr = Integer.parseInt(detail.getCurrent_value());
|
||||||
|
if (numCurr >= maxValue) {
|
||||||
|
numCurr = Integer.parseInt(detail.getInit_value());
|
||||||
|
detail.setCurrent_value(String.valueOf(numCurr));
|
||||||
|
}else{
|
||||||
|
detail.setCurrent_value(String.valueOf(numCurr + step));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
demo += value;
|
||||||
demo += value;
|
if (flag.equals("1")) {
|
||||||
if (flag.equals("1")) {
|
codeRuleDetailMapper.updateById(detail);
|
||||||
codeRuleDetailMapper.updateById(detail);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return demo;
|
return demo;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:password}
|
password: ${DB_PWD:123456}
|
||||||
|
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
|
|||||||
@@ -79,7 +79,17 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="insertEvent()"
|
@click="insertEvent()"
|
||||||
>
|
>
|
||||||
添加物料
|
物料组盘
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="insertForm()"
|
||||||
|
>
|
||||||
|
单据组盘
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
@@ -166,12 +176,19 @@
|
|||||||
:mater-opt-code="materType"
|
:mater-opt-code="materType"
|
||||||
@setMaterValue="tableDtlMaterial"
|
@setMaterValue="tableDtlMaterial"
|
||||||
/>
|
/>
|
||||||
|
<FormDialog
|
||||||
|
:dialog-show.sync="formShow"
|
||||||
|
:is-single="false"
|
||||||
|
:mater-opt-code="materType"
|
||||||
|
@setMaterValue="tableDtlMaterial"
|
||||||
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CRUD, { crud, form } from '@crud/crud'
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
|
import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
|
||||||
|
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||||
|
|
||||||
|
|
||||||
@@ -189,7 +206,7 @@ const defaultForm = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddDialog',
|
name: 'AddDialog',
|
||||||
components: { formstruc, MaterDialog },
|
components: { formstruc, MaterDialog, FormDialog },
|
||||||
mixins: [crud(), form(defaultForm)],
|
mixins: [crud(), form(defaultForm)],
|
||||||
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area', 'PCS_SAL_TYPE'],
|
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area', 'PCS_SAL_TYPE'],
|
||||||
props: {
|
props: {
|
||||||
@@ -208,6 +225,7 @@ export default {
|
|||||||
tableData:[],
|
tableData:[],
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
materShow: false,
|
materShow: false,
|
||||||
|
formShow: false,
|
||||||
dtlShow: false,
|
dtlShow: false,
|
||||||
opendtlParam: null,
|
opendtlParam: null,
|
||||||
materType: '03', // 关键成品
|
materType: '03', // 关键成品
|
||||||
@@ -271,6 +289,9 @@ export default {
|
|||||||
insertEvent(row) {
|
insertEvent(row) {
|
||||||
this.materShow = true
|
this.materShow = true
|
||||||
},
|
},
|
||||||
|
insertForm(row) {
|
||||||
|
this.formShow = true
|
||||||
|
},
|
||||||
queryMater(index, row) {
|
queryMater(index, row) {
|
||||||
this.nowindex = index
|
this.nowindex = index
|
||||||
this.nowrow = row
|
this.nowrow = row
|
||||||
|
|||||||
264
wms_pro/qd/src/views/wms/pm_manage/form_data/FormDialog.vue
Normal file
264
wms_pro/qd/src/views/wms/pm_manage/form_data/FormDialog.vue
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
<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 fromTypes"
|
||||||
|
: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"
|
||||||
|
lazy
|
||||||
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
|
:data="crud.data"
|
||||||
|
row-key="id"
|
||||||
|
@select="crud.selectChange"
|
||||||
|
@select-all="crud.selectAllChange"
|
||||||
|
@selection-change="crud.selectionChangeHandler"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"/>
|
||||||
|
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
|
||||||
|
<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
|
||||||
|
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 />
|
||||||
|
<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 crudMaterialbase from '@/views/wms/base_manage/material/material'
|
||||||
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
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, Treeselect },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudMaterialbase }, optShow: {}})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header()],
|
||||||
|
dicts: ['product_series'],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
materOptCode: {
|
||||||
|
type: String,
|
||||||
|
default: '00'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fromTypes: [],
|
||||||
|
cols: [],
|
||||||
|
dialogVisible: false,
|
||||||
|
classes: [],
|
||||||
|
tableRadio: null,
|
||||||
|
class_idStr: null,
|
||||||
|
checkrow: null,
|
||||||
|
rows: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.getFromTypes()
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
console.log("created......")
|
||||||
|
this.getFromTypes()
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
if (this.fromTypes.length > 0){
|
||||||
|
formstruc.getHeader(this.query.form_type).then(res => {
|
||||||
|
this.cols = res
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
getFromTypes() {
|
||||||
|
crudFormData.getFormType().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
|
||||||
|
this.fromTypes = res
|
||||||
|
if (this.fromTypes.length > 0) {
|
||||||
|
this.$set(this.query, 'form_type', this.fromTypes[0].value)
|
||||||
|
this.crud.toQuery()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toView(row){},
|
||||||
|
clickChange(item) {
|
||||||
|
this.tableRadio = item
|
||||||
|
},
|
||||||
|
seriesFormat(row) {
|
||||||
|
return this.dict.label.product_series[row.product_series]
|
||||||
|
},
|
||||||
|
|
||||||
|
queryClassId() {
|
||||||
|
const param = {
|
||||||
|
'class_idStr': this.class_idStr
|
||||||
|
}
|
||||||
|
crudClassstandard.queryClassById(param).then(res => {
|
||||||
|
this.classes = res.content.map(obj => {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('setMaterValue', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.rows = this.$refs.table.selection
|
||||||
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选物料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('setMaterValue', this.rows)
|
||||||
|
},
|
||||||
|
loadClass({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.content.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
Reference in New Issue
Block a user