Merge branch 'master2'

# Conflicts:
#	nladmin-ui/src/views/wms/basedata/material/UploadDialog.vue
This commit is contained in:
zhangzq
2025-07-15 17:58:21 +08:00
38 changed files with 782 additions and 138 deletions

Binary file not shown.

View File

@@ -7,6 +7,9 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
import org.nl.wms.bigscreen_manage.service.dto.IvtAnalyse;
import java.util.List;
/**
* @author dsh
@@ -15,5 +18,8 @@ import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
@Mapper
public interface BsrealStorattrMapper extends BaseMapper<BsrealStorattr> {
List<IvtAnalyse> sumMaterQty(String storCode);
IPage<BsrealStorattrDto> queryAllByPage(Page<BsrealStorattrDto> page, @Param("search") String search);
}

View File

@@ -14,4 +14,22 @@
</where>
ORDER BY stor.update_time Desc
</select>
<select id="sumMaterQty" resultType="org.nl.wms.bigscreen_manage.service.dto.IvtAnalyse">
SELECT
st_ivt_structattr.stor_code,
md_me_materialbase.material_id,
md_me_materialbase.material_name,
SUM( qty ) as sum_qty
FROM
st_ivt_structattr
LEFT JOIN md_pb_groupplate ON st_ivt_structattr.storagevehicle_code = md_pb_groupplate.storagevehicle_code
LEFT JOIN md_me_materialbase ON md_me_materialbase.material_id = md_pb_groupplate.material_id
WHERE
st_ivt_structattr.storagevehicle_code IS NOT NULL
and md_pb_groupplate.material_id is not null
and stor_code = #{storCode}
GROUP BY
stor_code,material_id
ORDER BY sum_qty
</select>
</mapper>

View File

@@ -0,0 +1,50 @@
package org.nl.wms.bigscreen_manage.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.bigscreen_manage.service.BigScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 大屏显示 控制层
* </p>
*
* @author Liuxy
* @since 2025-06-24
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/bigScreen")
@Slf4j
public class BigScreenController {
@Autowired
private BigScreenService bigScreenService;
@PostMapping("/getData")
@Log("大屏数据")
@SaIgnore
public ResponseEntity<Object> getData(@RequestBody JSONObject stors) {
List<String> list = new ArrayList<>();
list.add("GW");
list.add("GW");
List<JSONObject> data = bigScreenService.getData(list);
return new ResponseEntity<>(TableDataInfo.build(data), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package org.nl.wms.bigscreen_manage.service;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
/**
* <p>
* 大屏显示 服务类
* </p>
*
* @author Liuxy
* @since 2025-06-24
*/
public interface BigScreenService {
/**
* 获取大屏数据
*根据配置的仓库
* @return PdaResponse
*/
List<JSONObject> getData(List<String> stors);
}

View File

@@ -0,0 +1,11 @@
package org.nl.wms.bigscreen_manage.service.dto;
import lombok.Data;
@Data
public class IvtAnalyse {
private String stor_code;
private String material_id;
private String material_name;
private Integer sum_qty;
}

View File

@@ -0,0 +1,355 @@
package org.nl.wms.bigscreen_manage.service.impl;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.wms.basedata_manage.service.IStructattrService;
import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
import org.nl.wms.bigscreen_manage.service.BigScreenService;
import org.nl.wms.bigscreen_manage.service.dto.IvtAnalyse;
import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.warehouse_management.enums.IOSConstant;
import org.nl.wms.warehouse_management.enums.IOSEnum;
import org.nl.wms.warehouse_management.service.IOutBillService;
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 大屏显示 实现类
* </p>
*
* @author Liuxy
* @since 2025-06-24
*/
@Service
public class BigScreenServiceImpl implements BigScreenService {
@Autowired
private IStructattrService iStructattrService;
@Resource
private IOutBillService iOutBillService;
@Resource
private BsrealStorattrMapper screenMapper;
@Resource
private IOStorInvDisMapper ioStorInvDisMapper;
@Autowired
private ISchBaseTaskService iSchBaseTaskService;
@Override
public List<JSONObject> getData(List<String> stors) {
// String storCode = "GW";
List result = new ArrayList<>();
if (CollectionUtils.isEmpty(stors)){
return result;
}
for (String storCode : stors) {
JSONObject item = new JSONObject();
//1.【货位使用】数据
item.put("title","GW仓库");
item.put("pointUse", pointUse(storCode));
// //2.【实时库存分析】数据
item.put("ivtAnalyse", ivtAnalyse(storCode));
//3.【出入库趋势】数据
item.put("inAndOutTrend", inAndOutTrend(storCode));
// //4.【今日出入库】数据
item.put("toDayInAndOut", toDayInAndOut(storCode));
// //5.【今日出入库】数据
item.put("realTask", realTask(storCode));
//6.【未完成单据】数据
item.put("unIos", unIos(storCode));
result.add(item);
}
return result;
}
/**
//
// * 货位使用
// *
// * @return JSONObject {
// * total_qty: 总货位数
// * use_qty: 已用货位
// * emp_qty: 空余货位
// * use_percentage: 百分比(使用货位百分比)
// * }
// */
private JSONObject pointUse(String storCode) {
// 返回数据
JSONObject result = new JSONObject();
// 查询所有未删除且启用仓位
int emp_qty = iStructattrService.count(
new QueryWrapper<Structattr>().lambda()
.eq(Structattr::getIs_used, Boolean.TRUE)
.eq(Structattr::getStor_code, storCode)
.isNull(Structattr::getStoragevehicle_code));
int use_qty = iStructattrService.count(
new QueryWrapper<Structattr>().lambda()
.eq(Structattr::getIs_used, Boolean.TRUE)
.eq(Structattr::getStor_code, storCode)
.isNotNull(Structattr::getStoragevehicle_code));
int total_qty = iStructattrService.count(
new QueryWrapper<Structattr>().lambda()
.eq(Structattr::getIs_used, Boolean.TRUE)
.eq(Structattr::getStor_code, storCode));
// 总货位数
result.put("total_qty", total_qty);
// 已用货位数
result.put("use_qty", use_qty);
// 空余货位
result.put("emp_qty", emp_qty);
// 使用货位百分比
double use_percentage = NumberUtil.mul(NumberUtil.div(use_qty, total_qty), 100);
result.put("use_percentage", NumberUtil.round(use_percentage, 2));
return result;
}
/**
* 实时库存分析
*
* @return JSONObject {
* total_qty: 总数
* data: [
* material_name: 物料名称
* ivt_qty: 库存数量
* percentage: 百分比
* ]
* }
*/
private JSONObject ivtAnalyse(String storCode) {
JSONObject result = new JSONObject();
List<IvtAnalyse> list = screenMapper.sumMaterQty(storCode);
int sum = list.stream().mapToInt(IvtAnalyse::getSum_qty).sum();
result.put("total_qty", sum);
List<JSONObject> topFiveList = new ArrayList<>();
int i = 0;
int top5 = 0;
for (IvtAnalyse json : list) {
if (i==5){break;}
JSONObject item = new JSONObject();
item.put("ivt_qty", json.getSum_qty());
item.put("material_name", json.getMaterial_name());
double percentage = NumberUtil.mul(json.getSum_qty()/sum, 100);
item.put("percentage", NumberUtil.round(percentage, 2));
topFiveList.add(item);
i++;
top5 = top5+json.getSum_qty();
}
if (sum>top5){
JSONObject other = new JSONObject();
other.put("ivt_qty", sum-top5);
other.put("material_name", "其他物料");
other.put("percentage", NumberUtil.round(1-top5/sum, 2));
topFiveList.add(other);
}
result.put("data", topFiveList);
return result;
}
/**
* 出入库趋势
*
* @return JSONObject {
* in: [{date:日期qty:数量}]
* out: [{date:日期qty:数量}]
* }
*/
private JSONObject inAndOutTrend(String storCode) {
// 获取七天天数集合
DateTime dateTime = DateUtil.offsetDay(DateUtil.parseDate(DateUtil.today()), -6);
List<String> dateList = DateUtil.rangeToList(dateTime, DateUtil.parse(DateUtil.today()), DateField.DAY_OF_YEAR).stream()
.map(DateTime::toString)
.map(row -> row.substring(0, 10))
.collect(Collectors.toList());
// 查询七天内的出入库数据
List<IOStorInv> allIosList = iOutBillService.list(
new QueryWrapper<IOStorInv>().lambda()
.in(IOStorInv::getBiz_date, dateList)
.eq(IOStorInv::getIs_delete, IOSConstant.IS_DELETE_NO)
.eq(IOStorInv::getStor_code, storCode)
.eq(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
);
// 查询入库单据
List<IOStorInv> inIosList = allIosList.stream()
.filter(row -> row.getIo_type().equals(IOSEnum.IO_TYPE.code("入库")))
.collect(Collectors.toList());
// 查询出库单据
List<IOStorInv> outIosList = allIosList.stream()
.filter(row -> row.getIo_type().equals(IOSEnum.IO_TYPE.code("出库")))
.collect(Collectors.toList());
// 组织数据
List<JSONObject> inList = new ArrayList<>();
List<JSONObject> outList = new ArrayList<>();
for (String date : dateList) {
// 处理入库数量
JSONObject jsonIn = new JSONObject();
jsonIn.put("date", date);
double in_qty = inIosList.stream()
.filter(row -> row.getBiz_date().equals(date))
.map(row -> row.getTotal_qty().doubleValue())
.reduce(Double::sum).orElse(0.00);
jsonIn.put("qty", NumberUtil.round(in_qty, 2));
inList.add(jsonIn);
// 处理出库数据
JSONObject jsonOut = new JSONObject();
jsonOut.put("date", date);
double out_qty = outIosList.stream()
.filter(row -> row.getBiz_date().equals(date))
.map(row -> row.getTotal_qty().doubleValue())
.reduce(Double::sum).orElse(0.00);
jsonOut.put("qty", NumberUtil.round(out_qty, 2));
outList.add(jsonOut);
}
JSONObject result = new JSONObject();
result.put("in", inList);
result.put("out", outList);
return result;
}
/**
* 今日出入库
*
* @return JSONObject {
* in: {total_qty:总数量vehicle_qty:托盘数量}
* out: {total_qty:总数量vehicle_qty:托盘数量}
* }
*/
private JSONObject toDayInAndOut(String storCode) {
// 查询今天出入库单据
List<IOStorInv> inList = iOutBillService.list(
new QueryWrapper<IOStorInv>().lambda()
.eq(IOStorInv::getBiz_date, DateUtil.today())
.eq(IOStorInv::getIs_delete, IOSConstant.IS_DELETE_NO)
.eq(IOStorInv::getStor_code, storCode)
.eq(IOStorInv::getIo_type, IOSEnum.IO_TYPE.code("入库"))
.eq(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
);
// 查询今天出库单据
List<IOStorInv> outList = iOutBillService.list(
new QueryWrapper<IOStorInv>().lambda()
.eq(IOStorInv::getBiz_date, DateUtil.today())
.eq(IOStorInv::getIs_delete, IOSConstant.IS_DELETE_NO)
.eq(IOStorInv::getStor_code, storCode)
.eq(IOStorInv::getIo_type, IOSEnum.IO_TYPE.code("出库"))
.eq(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
);
// 入库
JSONObject jsonIn = new JSONObject();
// 总数量
double total_qty_in = inList.stream()
.map(row -> row.getTotal_qty().doubleValue())
.reduce(Double::sum).orElse(0.0);
jsonIn.put("total_qty", NumberUtil.round(total_qty_in, 2));
// 托盘数
List<IOStorInvDis> inDisList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(inList)) {
inDisList = ioStorInvDisMapper.selectList(
new QueryWrapper<IOStorInvDis>().lambda()
.in(IOStorInvDis::getIostorinv_id, inList.stream()
.map(IOStorInv::getIostorinv_id)
.collect(Collectors.toList())
)
);
}
jsonIn.put("vehicle_qty", inDisList.size());
// 出库
JSONObject jsonOut = new JSONObject();
// 总数量
double total_qty_out = outList.stream()
.map(row -> row.getTotal_qty().doubleValue())
.reduce(Double::sum).orElse(0.0);
jsonOut.put("total_qty", NumberUtil.round(total_qty_out, 2));
// 托盘数
List<IOStorInvDis> outDisList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(outList)) {
outDisList = ioStorInvDisMapper.selectList(
new QueryWrapper<IOStorInvDis>().lambda()
.in(IOStorInvDis::getIostorinv_id, outList.stream()
.map(IOStorInv::getIostorinv_id)
.collect(Collectors.toList())
)
);
}
jsonOut.put("vehicle_qty", outDisList.size());
JSONObject result = new JSONObject();
result.put("in", jsonIn);
result.put("out", jsonOut);
return result;
}
/**
* 实时任务
*
* @return List<SchBaseTask> {
* 任务实体列
* }
*/
private List<SchBaseTask> realTask(String storCode) {
List<SchBaseTask> list = iSchBaseTaskService.list(
new QueryWrapper<SchBaseTask>().lambda()
.le(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())
.eq(SchBaseTask::getIs_delete, IOSConstant.IS_DELETE_NO)
.ge(SchBaseTask::getCreate_time,DateUtil.today())
);
list.stream().forEach(item -> {
item.setTask_status(TaskStatus.convertName(item.getTask_status()));
});
return list;
}
/**
* 未完成单据
*
* @return List<IOStorInv>{
* 出入库实体类
* }
*/
private List<IOStorInv> unIos(String storCode) {
List<IOStorInv> list = iOutBillService.list(
new QueryWrapper<IOStorInv>().lambda()
.eq(IOStorInv::getIs_delete, IOSConstant.IS_DELETE_NO)
.eq(IOStorInv::getStor_code, storCode)
.ne(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
);
list.stream().forEach(item -> {
item.setIo_type(item.getIo_type().equals(IOSEnum.IO_TYPE.code("入库"))?"入库":"出库");
if (item.getBill_status().equals(IOSEnum.BILL_STATUS.code("生成"))) {
item.setBill_status("生成");
}
if (item.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配中"))) {
item.setBill_status("分配中");
}
if (item.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完"))) {
item.setBill_status("分配完");
}
item.setBill_type("dict.getLabel()");
});
return list;
}
}

View File

@@ -111,6 +111,7 @@
SELECT
pm_form_data.*,
md_me_materialbase.material_code,
md_me_materialbase.material_id,
md_me_materialbase.material_name,
md_me_materialbase.material_spec,
md_me_materialbase.net_weight

View File

@@ -46,7 +46,7 @@ public class PmFormDataDto implements Serializable {
* 物料code
*/
private String material_code;
private String material_id;
/**
* 物料规格
*/

View File

@@ -73,4 +73,13 @@ public enum TaskStatus {
public void setDesc(String desc) {
this.desc = desc;
}
public static String convertName(String code){
for (TaskStatus value : TaskStatus.values()) {
if (value.getCode().equals(code)){
return value.getName();
}
}
return "";
}
}

View File

@@ -310,6 +310,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id"));
ioStorInvDtl.put("qty_unit_name", row.getString("qty_unit_name"));
ioStorInvDtl.put("plan_qty", row.get("qty"));
ioStorInvDtl.put("source_bill_code", row.get("source_bill_code"));
ioStorInvDtl.put("source_bill_type", row.get("source_bill_type"));
ioStorInvDtl.put("source_billdtl_id", row.get("source_billdtl_id"));
ioStorInvDtl.put("remark", row.getString("remark"));
ioStorInvDtl.put("assign_qty", "0");
ioStorInvDtl.put("unassign_qty", row.get("qty"));

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title>欧伦可视化看板</title><link href=./static/css/app.7eb34c7823b484f76dbdbf24cd625cff.css rel=stylesheet></head><body class=clearfix><div id=app></div><script type=text/javascript src=./static/js/manifest.7b7124d31a251fc046ff.js></script><script type=text/javascript src=./static/js/app.12b9502b60b1dab9d8a5.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
webpackJsonp([4],{"2L/E":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={data:function(){return{loginname:"",password:"",baseUrl:this.$store.getters.baseUrl,setJxtTime:this.$store.getters.setJxtTime/1e3,setTime:this.$store.getters.setTime/1e3,options:[{value:"01",label:"仓储监控1"},{value:"02",label:"仓储监控2"}],value:this.$store.getters.pageNo,secCode:this.$store.getters.secCode||""}},created:function(){"02"===this.$store.getters.iskb?(console.log(this.$store.getters.iskb,1),"01"!==this.value&&this.secCode?this.$router.push("/screen02"):this.$router.push("/screen01")):console.log(this.$store.getters.iskb,2)},methods:{_config:function(){if(this.setTime<1||this.setJxtTime<1)this.$message({message:"刷新时间设置过短",type:"warning"});else if(this.setTime>10800||this.setJxtTime>10800)this.$message({message:"刷新时间设置过长",type:"warning"});else{var e={baseUrl:this.baseUrl,setTime:1e3*this.setTime,setJxtTime:1e3*this.setJxtTime,pageNo:this.value,iskb:"1",secCode:this.secCode};console.log(),this.$store.dispatch("setConfig",e),this.$router.push("/screen"+this.value)}}}},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"body-container"},[s("h1",[e._v("仓储监控")]),e._v(" "),s("div",{staticClass:"login_wrap"},[s("div",{staticClass:"login_cnt"},[s("div",{staticClass:"title-name"},[e._v("系统配置")]),e._v(" "),s("div",{staticClass:"login_card"},[s("div",{staticClass:"card_wrap"},[s("div",{staticClass:"inputOuter"},[s("label",[e._v("域名地址")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.baseUrl,expression:"baseUrl"}],staticClass:"inputStyle",attrs:{type:"text"},domProps:{value:e.baseUrl},on:{input:function(t){t.target.composing||(e.baseUrl=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"inputOuter"},[s("label",[e._v("看板")]),e._v(" "),s("el-select",{staticClass:"selectWraper",attrs:{placeholder:"请选择"},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},e._l(e.options,function(e){return s("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:1===Number(e.value),expression:"Number(value) === 1"}],staticClass:"inputOuter"},[s("label",[e._v("刷新时间(秒)")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.setJxtTime,expression:"setJxtTime"}],staticClass:"inputStyle",attrs:{type:"number"},domProps:{value:e.setJxtTime},on:{input:function(t){t.target.composing||(e.setJxtTime=t.target.value)}}})]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:2===Number(e.value),expression:"Number(value) === 2"}],staticClass:"inputOuter"},[s("label",[e._v("刷新时间(秒)")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.setTime,expression:"setTime"}],staticClass:"inputStyle",attrs:{type:"number"},domProps:{value:e.setTime},on:{input:function(t){t.target.composing||(e.setTime=t.target.value)}}})]),e._v(" "),s("div",{staticClass:"inputOuter"},[s("label",[e._v("仓库编码")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:e.secCode,expression:"secCode"}],staticClass:"inputStyle",attrs:{type:"text"},domProps:{value:e.secCode},on:{input:function(t){t.target.composing||(e.secCode=t.target.value)}}})])]),e._v(" "),s("button",{staticClass:"btn",on:{click:e._config}},[e._v("配置")])])])])])},staticRenderFns:[]};var l=s("VU/8")(i,a,!1,function(e){s("6f9t")},"data-v-16b21ccb",null);t.default=l.exports},"6f9t":function(e,t){}});
//# sourceMappingURL=4.e43104d0a0bc6d6e3e94.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={6:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"f8b57ab4d9de4af7357a",1:"aa1371a9cb75c5e6363a",2:"51f40f46d4c4ef29cd6c",3:"814b882c67752c331ed3",4:"e43104d0a0bc6d6e3e94"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.7b7124d31a251fc046ff.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,180 @@
{
"code":"1",
"desc":"查询成功",
"result":{
"yDateMax":6000,
"xDate":[
{
"id":"12-25"
},
{
"id":"12-26"
},
{
"id":"12-27"
},
{
"id":"12-28"
},
{
"id":"12-29"
},
{
"id":"12-30"
},
{
"id":"12-31"
},
{
"id":"1-1"
},
{
"id":"1-2"
},
{
"id":"1-3"
},
{
"id":"1-4"
},
{
"id":"1-5"
},
{
"id":"1-6"
},
{
"id":"1-7"
}
],
"yDate0":[
{
"num":"1000"
},
{
"num":"1500"
},
{
"num":"0"
},
{
"num":"2300"
},
{
"num":"4300"
},
{
"num":"3900"
},
{
"num":"2800"
},
{
"num":"2600"
},
{
"num":"2500"
},
{
"num":"4500"
},
{
"num":"1200"
},
{
"num":"1800"
},
{
"num":"1900"
},
{
"num":"1700"
}
],
"yDate1":[
{
"num":"900"
},
{
"num":"1400"
},
{
"num":"2600"
},
{
"num":"2200"
},
{
"num":"4200"
},
{
"num":"3800"
},
{
"num":"2500"
},
{
"num":"2300"
},
{
"num":"2400"
},
{
"num":"4000"
},
{
"num":"1000"
},
{
"num":"1200"
},
{
"num":"1100"
},
{
"num":"1100"
}
],
"yDate2":[
{
"num":"0"
},
{
"num":"0"
},
{
"num":"1200"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
},
{
"num":"0"
}
]
}
}

View File

@@ -1,12 +1,11 @@
<template>
<el-dialog
title="单据选择"
append-to-body
:visible.sync="dialogVisible"
append-to-body
destroy-on-close
title="单据选择"
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
@@ -25,8 +24,8 @@
@change="crud.toQuery()"
>
<el-option
v-for="item in tableEnum.bm_form_struc"
:key="item.value"
v-for="item in dict.INANDOUT_BILL_TYPE"
:key="item.dict_id"
:value="item.value"
:label="item.label"
/>
@@ -50,47 +49,23 @@
v-loading="crud.loading"
:data="crud.data"
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
highlight-current-row
@current-change="clickChange"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px">
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
{{ dict.label.INANDOUT_BILL_TYPE[scope.row.form_type] }}
</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="source_form_date" label="业务单据日期" show-overflow-tooltip width="120" />
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip width="120" />
<el-table-column prop="material_name" 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="vehicle_code" 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 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 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
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 />
@@ -98,48 +73,13 @@
<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 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>
<!--分页组件-->
<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.vue'
import pagination from '@crud/Pagination.vue'
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
// import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
import crudFormData from './formData'
export default {
name: 'FormDia',
@@ -148,7 +88,7 @@ export default {
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
},
mixins: [presenter(), header()],
tableEnums: ['bm_form_struc#form_name#form_type'],
dicts: ['INANDOUT_BILL_TYPE'],
props: {
dialogShow: {
type: Boolean,
@@ -168,8 +108,6 @@ export default {
cols: [],
dialogVisible: false,
dtlVisible: false,
childrenList: [],
tableRadio: null,
checkrow: null,
rows: []
}
@@ -182,66 +120,17 @@ export default {
}
},
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()
this.checkrow = item
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.dialogVisible = false
const 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)
const subData = {}
this.$set(subData, 't', this.rows[0])
this.$set(subData, 'item', this.rows[0].children)
this.$emit('setMaterValue', subData)
this.$emit('setFormValue', this.checkrow)
}
}
}

View File

@@ -116,7 +116,17 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
@click="addFormDtl()"
>
添加单据
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="addMaterDtl()"
>
添加物料
</el-button>
@@ -154,6 +164,12 @@
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="source_bill_code" label="源单号" align="center" />
<el-table-column prop="source_bill_type" label="源单类型" align="center">
<template slot-scope="scope">
{{ dict.label.INANDOUT_BILL_TYPE[scope.row.source_bill_type] }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
<template scope="scope">
<el-input v-model="scope.row.remark" size="mini" />
@@ -169,6 +185,7 @@
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
<FormDialog :dialog-show.sync="formShow" @setFormValue="setFormValue" />
</el-dialog>
</template>
@@ -176,6 +193,7 @@
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/st/outbill/AddDtl'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
@@ -196,7 +214,7 @@ const defaultForm = {
}
export default {
name: 'AddDialog',
components: { AddDtl, MaterDialog },
components: { AddDtl, MaterDialog, FormDialog },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
@@ -204,13 +222,14 @@ export default {
default: false
}
},
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_INV_OUT_TYPE'],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_INV_OUT_TYPE', 'INANDOUT_BILL_TYPE'],
data() {
return {
dialogVisible: false,
dtlShow: false,
materType: '',
materShow: false,
formShow: false,
flagnow: false,
nowrow: {},
nowindex: '',
@@ -302,13 +321,8 @@ export default {
this.materShow = true
this.nowindex = index
this.nowrow = row
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
this.materType = res.materType
this.nowindex = index
this.nowrow = row
})*/
},
queryDtl(index, row) {
addMaterDtl(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
@@ -320,6 +334,18 @@ export default {
this.storId = this.form.stor_id
this.dtlShow = true
},
addFormDtl(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.form.stor_id === '') {
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.storId = this.form.stor_id
this.formShow = true
},
tableChanged(rows) {
rows.forEach((item) => {
// 添加plan_qty
@@ -360,6 +386,21 @@ export default {
this.nowrow.edit = false
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
setFormValue(data) {
this.nowrow.material_id = data.material_id
this.nowrow.material_code = data.material_code
this.nowrow.material_name = data.material_name
this.nowrow.qty_unit_id = data.unit_id
this.nowrow.qty_unit_name = data.unit_name
this.nowrow.pcsn = data.pcsn
this.nowrow.plan_qty = data.qty
this.nowrow.qty = data.qty
this.nowrow.source_bill_code = data.code
this.nowrow.source_billdtl_id = data.id
this.nowrow.source_bill_type = data.form_type
this.nowrow.edit = false
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
deleteRow(index, rows) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)