rev:工单导入/缓存线物料更新
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>poi</artifactId>-->
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -5,6 +5,8 @@ import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
@@ -39,6 +41,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -131,6 +134,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
String status = row.getString("status");
|
||||
// 任务处理类
|
||||
try {
|
||||
|
||||
AbstractAcsTask taskHandler = (AbstractAcsTask)SpringContextHolder.getBean(Class.forName(processing_class));
|
||||
if (taskHandler!=null){
|
||||
taskHandler.updateTaskStatus(row,status);
|
||||
}
|
||||
//发布一个任务执行事件
|
||||
TaskEvent event = TaskEvent.builder()
|
||||
.task_id(task_id)
|
||||
@@ -138,9 +146,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
.status(status)
|
||||
.build();
|
||||
BussEventMulticaster.Publish(event);
|
||||
|
||||
/*AbstractAcsTask taskHandler = (AbstractAcsTask)SpringContextHolder.getBean(Class.forName(processing_class));
|
||||
taskHandler.updateTaskStatus(row,status);*/
|
||||
} catch (Exception e) {
|
||||
log.error("任务状态更新失败:{}", e.getMessage());
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -292,15 +297,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
@Override
|
||||
@Async
|
||||
public void feedOrderRealQty(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
return;
|
||||
}
|
||||
Iterator<String> iterator = param.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
String workorderCode = iterator.next();
|
||||
String real_qty = param.getString(workorderCode);
|
||||
wo.update(MapOf.of("real_qty",real_qty),"workorder_code = '"+workorderCode+"'");
|
||||
BigDecimal dq_real_qty = param.getBigDecimal(workorderCode);
|
||||
workorderService.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("dq_real_qty",dq_real_qty).eq("workorder_code",workorderCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.ext.bigScreen.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -23,6 +24,7 @@ import java.util.Map;
|
||||
@Api(tags = "监控大屏")
|
||||
@RequestMapping("/api/bigScreenScreen")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
@CrossOrigin
|
||||
public class BigScreenController {
|
||||
private final BigScreenService bigScreenService;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.ext.bigScreen.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "设备监控大屏")
|
||||
@RequestMapping("/api/deviceScreen")
|
||||
@SaIgnore
|
||||
@Slf4j
|
||||
public class DeviceScreenController {
|
||||
private final DeviceScreenService deviceScreenService;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.ext.bigScreen.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -26,6 +27,7 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "大屏生产监控中心")
|
||||
@RequestMapping("/api/bigscreen/product")
|
||||
@SaIgnore
|
||||
@Slf4j
|
||||
public class ProductController {
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.WorkerOrderEnum;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.api.RestBusinessTemplate;
|
||||
import org.nl.common.utils.api.ResultCode;
|
||||
import org.nl.modules.common.exception.BizCoreException;
|
||||
@@ -22,8 +23,11 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author qinx
|
||||
@@ -86,7 +90,8 @@ public class ProduceshiftorderController{
|
||||
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
|
||||
}
|
||||
/** @see org.nl.common.enums.WorkerOrderEnum */
|
||||
param.put("workorder_status","'2','3','4','5'");
|
||||
param.put("workorder_status","'2','3','4'");
|
||||
param.put("optuser",SecurityUtils.getCurrentUserId());
|
||||
List<Map> list = iPdmProduceWorkorderService.getOrderList(param, page);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ import org.nl.wms.scheduler_manage.service.scheduler.ISchProcessRouteService;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.FlowElement;
|
||||
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -64,6 +66,8 @@ public class SpeEmpTask extends AbstractAcsTask {
|
||||
private ISchCachelineVehilematerialService vehilematerialService;
|
||||
@Autowired
|
||||
private ISchProcessRouteService schProcessRouteService;
|
||||
@Autowired
|
||||
private ISysParamService sysParamService;
|
||||
|
||||
private final Map<String,SpeStatusHandler > SpeHandles= new HashMap<>();
|
||||
|
||||
@@ -86,6 +90,10 @@ public class SpeEmpTask extends AbstractAcsTask {
|
||||
@Override
|
||||
@Transactional
|
||||
public String createTask(JSONObject param) {
|
||||
Param speemp = sysParamService.getOne(new QueryWrapper<Param>().eq("code", "speemp"));
|
||||
if (speemp !=null){
|
||||
return "speemp";
|
||||
}
|
||||
//{"workorder_code":230523019,"device_code":"A1_TW_15_6_D","type":"1"}
|
||||
String cahceLine = getRouteXmlFlowByWorkprodure(param);
|
||||
if (cahceLine == null) { return null; }
|
||||
|
||||
@@ -103,6 +103,10 @@
|
||||
<if test="realproduceend_date != null and realproduceend_date != ''">
|
||||
and #{realproduceend_date} >= workorder.realproducestart_date
|
||||
</if>
|
||||
|
||||
<if test="optuser != null and optuser != ''">
|
||||
and workorder.current_produce_person_id = #{optuser}
|
||||
</if>
|
||||
order by workorder_code desc
|
||||
</select>
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
if (j == 0) {
|
||||
//物料
|
||||
workorder.setShift_type_scode(col.equals("夜班") ? "0" : "1");
|
||||
workorder.setShift_type_scode(col.equals("晚上") ? "2" : "1");
|
||||
}
|
||||
if (j == 1) {
|
||||
//物料
|
||||
@@ -302,12 +302,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
errorMap.put("第" + i + "行" + col, "物料规格对应物料信息不存在");
|
||||
error_message = error_message + col + "物料规格对应物料信息不存在,";
|
||||
} else {
|
||||
Optional<MdMeMaterialbase> first = material_specs.stream().filter(new Predicate<MdMeMaterialbase>() {
|
||||
@Override
|
||||
public boolean test(MdMeMaterialbase mdMeMaterialbase) {
|
||||
return mdMeMaterialbase.getMaterial_code().contains("S") && !mdMeMaterialbase.getMaterial_code().contains("TH");
|
||||
}
|
||||
}).findFirst();
|
||||
Optional<MdMeMaterialbase> first = material_specs.stream().filter(mdMeMaterialbase -> mdMeMaterialbase.getMaterial_code().contains("S") && !mdMeMaterialbase.getMaterial_code().contains("TH")).findFirst();
|
||||
if (!first.isPresent()) {
|
||||
errorMap.put("第" + i + "行" + col, "物料规格对应物料信息不存在");
|
||||
}
|
||||
@@ -333,7 +328,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
if (j == 8) {
|
||||
//操作工
|
||||
SysUser user = userService.getOne(new QueryWrapper<SysUser>().eq("username", col));
|
||||
SysUser user = userService.getOne(new QueryWrapper<SysUser>().eq("person_name", col));
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
errorMap.put("第" + i + "行" + col, " 操作工没有账号");
|
||||
} else {
|
||||
|
||||
@@ -43,6 +43,7 @@ public class SysMenuController {
|
||||
|
||||
@GetMapping(value = "/build")
|
||||
@ApiOperation("根据用户获取菜单")
|
||||
@Log("caidan")
|
||||
public ResponseEntity<Object> buildMenus(@Validated String systemType) {
|
||||
//校验系统表是否存在该系统类型
|
||||
return new ResponseEntity(iSysMenuService.buildMenus(systemType),HttpStatus.OK);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8099
|
||||
port: 8011
|
||||
#配置数据源
|
||||
spring:
|
||||
data:
|
||||
@@ -8,30 +8,32 @@ spring:
|
||||
enabled: true
|
||||
client:
|
||||
reactive:
|
||||
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
# endpoints: 192.168.46.2255:8200 #外网
|
||||
endpoints: http://192.168.46.2255:9200 #外网
|
||||
#endpoints: 172.31.185.110:8200,172.31.154.9:8200 #内网
|
||||
# endpoints: 47.96.133.178:8200 #外网
|
||||
endpoints: http://192.168.46.225:9200 #外网
|
||||
elasticsearch:
|
||||
rest:
|
||||
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
# uris: 192.168.46.2255:8200 #外网
|
||||
uris: http://192.168.46.2255:8200 #外网
|
||||
username: elastic
|
||||
password: 123456
|
||||
#uris: 172.31.185.110:8200,172.31.154.9:8200 #内网
|
||||
# uris: 47.96.133.178:8200 #外网
|
||||
uris: http://192.168.46.225:9200 #外网
|
||||
# username: elastic
|
||||
# password: 123456
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:123456}
|
||||
#password: ${DB_PWD:Root.123456}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 45
|
||||
min-idle: 15
|
||||
# 最大连接数
|
||||
max-active: 90
|
||||
max-active: 30
|
||||
# 是否自动回收超时连接
|
||||
remove-abandoned: true
|
||||
# 超时时间(以秒数为单位)
|
||||
@@ -61,11 +63,12 @@ spring:
|
||||
reset-enable: false
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:6}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
#host: ${REDIS_HOST:localhost}
|
||||
database: ${REDIS_DB:1}
|
||||
#host: ${REDIS_HOST:127.0.0.1}
|
||||
host: ${REDIS_HOST:localhost}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
#连接超时时间
|
||||
@@ -169,29 +172,31 @@ sa-token:
|
||||
cookie:
|
||||
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
|
||||
domain:
|
||||
is-read-cookie: false
|
||||
|
||||
jetcache:
|
||||
defaultCacheType: LOCAL
|
||||
statIntervalMinutes: 15
|
||||
areaInCacheName: false
|
||||
hiddenPackages: com.yb
|
||||
local:
|
||||
default:
|
||||
type: caffeine
|
||||
limit: 100
|
||||
keyConvertor: fastjson
|
||||
expireAfterWriteInMillis: 60000
|
||||
remote:
|
||||
default:
|
||||
type: redis.lettuce
|
||||
keyConvertor: fastjson
|
||||
valueEncoder: kryo
|
||||
valueDecoder: kryo
|
||||
poolConfig:
|
||||
minIdle: 5
|
||||
maxIdle: 200
|
||||
maxTotal: 1000
|
||||
uri:
|
||||
- redis://127.0.0.1:6379
|
||||
#jetcache:
|
||||
# defaultCacheType: LOCAL
|
||||
# statIntervalMinutes: 15
|
||||
# areaInCacheName: false
|
||||
# hiddenPackages: com.yb
|
||||
# local:
|
||||
# default:
|
||||
# type: caffeine
|
||||
# limit: 100
|
||||
# keyConvertor: fastjson
|
||||
# expireAfterWriteInMillis: 60000
|
||||
# remote:
|
||||
# default:
|
||||
# type: redis.lettuce
|
||||
# keyConvertor: fastjson
|
||||
# valueEncoder: kryo
|
||||
# valueDecoder: kryo
|
||||
# poolConfig:
|
||||
# minIdle: 5
|
||||
# maxIdle: 200
|
||||
# maxTotal: 1000
|
||||
# uri:
|
||||
# - redis://127.0.0.1:6379
|
||||
es:
|
||||
index: mes_log
|
||||
schedulerFile: C:\mes\scheduler.xml
|
||||
|
||||
@@ -145,11 +145,11 @@ https://juejin.cn/post/6844903775631572999
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
<springProfile name="dev3">
|
||||
<root level="debug">
|
||||
<springProfile name="prod">
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="esLogAppender"/>
|
||||
</root>
|
||||
|
||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
@@ -185,7 +185,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="warn">
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
|
||||
@@ -644,7 +644,7 @@ export default {
|
||||
// 默认选中
|
||||
const deptIds = []
|
||||
for (var index in row.depts) {
|
||||
deptIds.push(row.depts[index].dept_ud)
|
||||
deptIds.push(row.depts[index].dept_id)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptUser.setCheckedKeys(deptIds)
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="发货单导入"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="true"
|
||||
width="500px"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
@close="close"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<el-form ref="form" :model="form1" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="日期区间:" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="form.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货单号:" prop="bill_code">
|
||||
<el-input v-model="form.bill_code" style="width: 350px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">确认
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, {header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudSap from '@/api/wms/ext/sap'
|
||||
|
||||
export default {
|
||||
name: 'importOrder',
|
||||
components: {rrOperation, pagination, DateRangePicker},
|
||||
cruds() {
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fullscreenLoading: false,
|
||||
dialogVisible: false,
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.form = {}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
},
|
||||
queryStruct() {
|
||||
|
||||
this.fullscreenLoading = true
|
||||
if (this.form.createTime) {
|
||||
this.form.date_begin = this.form.createTime[0]
|
||||
this.form.date_end = this.form.createTime[1]
|
||||
}
|
||||
crudSap.getDeliveryNote(this.form).then(res => {
|
||||
this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,283 +0,0 @@
|
||||
<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="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="发货单号">
|
||||
<el-input v-model="query.deliver_code" clearable placeholder="发货单号" style="width: 200px;"
|
||||
class="filter-item"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料搜索">
|
||||
<el-input
|
||||
v-model="query.material"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="物料编码、名称或规格"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00','23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
style="width: 200px"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.PCS_DELI_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品系列">
|
||||
<treeselect
|
||||
v-model="query.product_series"
|
||||
:options="classes3"
|
||||
:auto-load-root-options="false"
|
||||
:load-options="loadChildNodes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否正常">
|
||||
<el-select
|
||||
v-model="query.is_success"
|
||||
style="width: 200px"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IS_OR_NOT"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud"/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="importin"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="deliver_code" label="发货单号"/>
|
||||
<el-table-column prop="seq_no" label="明细序号"/>
|
||||
<el-table-column prop="deliver_type" label="发货单类型" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.PCS_DELIVER_TYPE[scope.row.deliver_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码"/>
|
||||
<el-table-column prop="material_name" label="物料名称"/>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.PCS_DELI_STATUS[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="delivery_qty" label="发货数量"/>
|
||||
<el-table-column prop="cust_code" label="客户编码"/>
|
||||
<el-table-column prop="cust_coname" label="客户名称"/>
|
||||
<el-table-column prop="unit_name" label="计量单位" show-overflow-tooltip min-width="150"/>
|
||||
<el-table-column prop="sale_code" label="销售单号"/>
|
||||
<el-table-column prop="sale_seq_no" label="销售明细序号" show-overflow-tooltip min-width="150"/>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip min-width="200"/>
|
||||
<el-table-column prop="create_name" label="创建人"/>
|
||||
<el-table-column prop="create_time" label="创建时间"/>
|
||||
<el-table-column prop="update_optname" label="修改人"/>
|
||||
<el-table-column prop="update_time" label="修改时间"/>
|
||||
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<Dialog :dialog-show.sync="dialogShow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDeliveryOrder from '@/api/wms/pcs/deliveryOrder'
|
||||
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import Dialog from '@/views/wms/pcs/deliveryorder/Dialog'
|
||||
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 '@/api/wms/basedata/master/classstandard'
|
||||
|
||||
const defaultForm = {
|
||||
deliver_id: null,
|
||||
deliver_code: null,
|
||||
seq_no: null,
|
||||
deliver_type: null,
|
||||
material_id: null,
|
||||
status: null,
|
||||
delivery_qty: null,
|
||||
cust_id: null,
|
||||
qty_unit_id: null,
|
||||
sale_id: null,
|
||||
sale_code: null,
|
||||
sale_seq_no: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
cust_code: null,
|
||||
cust_name: null
|
||||
}
|
||||
export default {
|
||||
name: 'DeliveryOrder',
|
||||
dicts: ['PCS_DELIVER_TYPE', 'PCS_DELI_STATUS'],
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, Treeselect, Dialog},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '发货单', url: 'api/deliveryOrder', idField: 'deliver_id', sort: 'deliver_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: {...crudDeliveryOrder}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
classes3: [],
|
||||
dialogShow: false,
|
||||
permission: {},
|
||||
rules: {},
|
||||
queryTypeOptions: [
|
||||
{key: 'deliver_code', display_name: '发货单号'}
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initClass3()
|
||||
},
|
||||
methods: {
|
||||
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
|
||||
})
|
||||
})
|
||||
},
|
||||
importin() {
|
||||
this.dialogShow = true
|
||||
},
|
||||
buildTree(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildTree(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null // 重点代码
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取子节点数据
|
||||
loadChildNodes({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)
|
||||
})
|
||||
}
|
||||
},
|
||||
initClass3() {
|
||||
const param = {
|
||||
parent_class_code: '07'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes3 = data
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user