This commit is contained in:
zty 2024-09-09 10:51:46 +08:00
commit 70b7427044
72 changed files with 7767 additions and 638 deletions

View File

@ -18,7 +18,8 @@
"babylonjs-gui": "^6.46.0",
"babylonjs-loaders": "^6.46.0",
"cesium": "1.75",
"codemirror": "5.65.5",
"codemirror": "^5.65.17",
"codemirror-editor-vue3": "^2.7.0",
"core-js": "3.29.0",
"cropperjs": "1.5.13",
"crypto-browserify": "^3.12.0",

View File

@ -301,5 +301,18 @@ export default {
width: 9vh !important;
height: 9vh !important;
}
#progressbwlq .el-progress-bar__innerText{
width: 100%;
position: absolute;
top: 4px;
left: 50%;
color: #cccccc;
}
.el-select-dropdown__item{
height:auto!important;
}
.el-select-dropdown__item div{
margin-left:15px!important;
}
//
</style>

View File

@ -3,6 +3,64 @@ import http from "@/utils/request"
/*EM接口*/
export default {
// 测点
xscript: {
list: {
name: "脚本",
req: async function(data){
return await http.get(
`${config.API_URL}/enm/xscript/`,
data
);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(
`${config.API_URL}/enm/xscript/${id}/`
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/enm/xscript/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/enm/xscript/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/enm/xscript/${id}/`);
}
},
toggle: {
name: "启用/禁用",
req: async function(id, data){
return await http.put(
`${config.API_URL}/enm/xscript/${id}/toggle/`,
data);
}
},
change_data: {
name: "变更数据",
req: async function(id, data){
return await http.put(
`${config.API_URL}/enm/xscript/${id}/change_data/`,
data);
}
}
},
mpoint: {
mplog: {
name: "测点原始记录",

View File

@ -94,6 +94,64 @@ export default {
}
},
},
mtaskbAdd: {
name: "创建",
req: async function(id,data){
return await http.post(
`${config.API_URL}/pm/mtask/${id}/add_mtaskb/`,
data);
}
},
mtaskb:{
list: {
name: "生产任务列表",
req: async function(data){
return await http.get(
`${config.API_URL}/pm/mtaskb/`,
data
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/pm/mtaskb/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/pm/mtaskb/cquery/`,
data);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(
`${config.API_URL}/pm/mtaskb/${id}/`
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/pm/mtaskb/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/pm/mtaskb/${id}/`);
}
},
},
// 生产大任务
utask: {
list: {

View File

@ -126,9 +126,53 @@ export default {
},
},
},
fmlog: {
list: {
name: "列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/fmlog/`, data);
},
},
item: {
name: "获取详情",
req: async function (id) {
return await http.get(`${config.API_URL}/wpm/fmlog/${id}/`);
},
},
cquery: {
name: "复杂查询",
req: async function (data) {
return await http.post(
`${config.API_URL}/wpm/fmlog/cquery/`,
data
);
},
},
update: {
name: "更新",
req: async function (id, data) {
return await http.put(
`${config.API_URL}/wpm/fmlog/${id}/`,
data
);
},
},
create: {
name: "创建",
req: async function (data) {
return await http.post(`${config.API_URL}/wpm/fmlog/`, data);
},
},
delete: {
name: "删除",
req: async function (id) {
return await http.delete(`${config.API_URL}/wpm/fmlog/${id}/`);
},
},
},
mlog: {
list: {
name: "值班记录列表",
name: "列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/mlog/`, data);
},

View File

@ -0,0 +1,5 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
<path fill="currentColor" fill-rule="evenodd" d="M12.428 2c-1.114 0-2.129.6-4.157 1.802l-.686.406C5.555 5.41 4.542 6.011 3.985 7c-.557.99-.557 2.19-.557 4.594v.812c0 2.403 0 3.605.557 4.594s1.57 1.59 3.6 2.791l.686.407C10.299 21.399 11.314 22 12.428 22s2.128-.6 4.157-1.802l.686-.407c2.028-1.2 3.043-1.802 3.6-2.791c.557-.99.557-2.19.557-4.594v-.812c0-2.403 0-3.605-.557-4.594s-1.572-1.59-3.6-2.792l-.686-.406C14.555 2.601 13.542 2 12.428 2m-3.75 10a3.75 3.75 0 1 1 7.5 0a3.75 3.75 0 0 1-7.5 0" clip-rule="evenodd" />
</svg>
</template>

View File

@ -23,4 +23,5 @@ export { default as Xiaoshou } from './Xiaoshou.vue'
export { default as Zhixing } from './Zhixing.vue'
export { default as Zhizao } from './Zhizao.vue'
export { default as Env } from './Env.vue'
export { default as Elec } from './Elec.vue'
export { default as Elec } from './Elec.vue'
export { default as Jcpz } from './Jcpz.vue'

View File

@ -35,6 +35,16 @@ const routes = [
},
component: "home/testx",
},
{
name: "blank",
path: "/blank",
meta: {
title: "控制台",
// icon: "el-icon-monitor",
perms: ["home_blank"],
},
component: "home/blank",
},
{
name: "dashboard",
path: "/dashboard",
@ -53,7 +63,7 @@ const routes = [
title: "控制台",
// icon: "el-icon-monitor",
affix: true,
perms: ["enm"],
perms: ["enmdashboard"],
},
component: "home/enm_home",
},
@ -1841,6 +1851,33 @@ const routes = [
},
component: "inm/mioitem",
},
{
name: "workshop",
path: "/inm/workshop",
meta: {
title: "车间库存",
hidden: true,
},
component: "inm/workshop",
},
{
name: "workshop_mio",
path: "/inm/workshop_mio",
meta: {
title: "车间出入库记录",
hidden: true,
},
component: "inm/workshop_mio",
},
{
name: "inmScrap",
path: "/inm/inmScrap",
meta: {
title: "废品库",
perms: ["inmScrap"],
},
component: "inm/inmScrap",
},
],
},
//采购 pum
@ -2697,13 +2734,46 @@ const routes = [
},
component: "enm_base/search",
},
//计算中心
{
name: "fac_cal",
path: "/fac_cal",
meta: {
title: "计算中心",
icon: "el-icon-menu",
type: "menu",
perms: ["fac_cal"],
},
children: [
{
path: "/fac_cal/mpointstat",
meta: {
title: "计算结果",
// icon: "el-icon-postcard",
type: "menu",
perms: ["mpointstat"],
},
component: "fac_cal/mpointstat",
},
{
path: "/fac_cal/caltask",
meta: {
title: "计算任务",
// icon: "el-icon-postcard",
type: "menu",
perms: ["caltask"],
},
component: "fac_cal/caltask",
},
]
},
//基础配置
{
name: "enm_base",
path: "/enm_base",
meta: {
title: "基础配置",
icon: "el-icon-management",
icon: "sc-icon-jcpz",
type: "menu",
perms: ["enm_base"],
},
@ -2720,7 +2790,7 @@ const routes = [
component: "enm_base/team",
},
{
name: "mgruop",
name: "mgroup",
path: "/enm_base/mgruop",
meta: {
title: "工段",
@ -2869,6 +2939,16 @@ const routes = [
},
component: "sys/role",
},
{
path: "/sys/myschedule",
name: "myschedule",
meta: {
title: "定时策略",
type: "menu",
perms: ["myschedule"],
},
component: "sys/myschedule"
},
{
path: "/sys/dict",
name: "dict",
@ -2966,6 +3046,17 @@ const routes = [
perms: ["bigScreenP_dept"],
},
children: [
{
path: "/bigScreenP_heihua",
name: "bigScreenP_heihua",
meta: {
title: "黑化车间",
icon: "el-icon-trend-charts",
perms: ["bigScreenP_dept_hh"],
fullpage: true,
},
component: "bigScreen/index_heihuadept.vue",
},
{
path: "/bigScreenP_10",
name: "bigScreenP_10",
@ -3181,6 +3272,72 @@ const routes = [
},
component: "statistics/stock_statistics.vue",
},
//合格数统计——光芯
{
name: "pass_num_gx",
path: "/statistic/pass_num_gx",
meta: {
title: "合格数统计",
icon: "el-icon-DataAnalysis",
perms: ["pass_num_gx"],
},
component: "statistics/pass_num_gx.vue",
},
//任务进度统计——光芯
{
name: "task_rate_gx",
path: "/statistic/task_rate_gx",
meta: {
title: "任务进度",
icon: "el-icon-DataAnalysis",
perms: ["task_rate_gx"],
},
component: "statistics/task_rate_gx.vue",
},
//库存统计——光芯
{
path: "/statistic_inm",
name: "statistic_inm",
meta: {
title: "库存统计",
icon: "el-icon-trend-charts",
perms: ["statistic_inm_gx"],
},
component: "statistics/statistics_inm.vue",
},
//过程检验统计——光芯
{
path: "/process_check_gx",
name: "process_check_gx",
meta: {
title: "过程检验统计",
icon: "el-icon-trend-charts",
perms: ["process_check_gx"],
},
component: "statistics/process_check_gx.vue",
},
//成品检验统计——光芯
{
path: "/good_check_gx",
name: "good_check_gx",
meta: {
title: "成品检验统计",
icon: "el-icon-trend-charts",
perms: ["good_check_gx"],
},
component: "statistics/good_check_gx.vue",
},
//扫边车间数据汇总——光芯
// {
// path: "/statistics_saobian",
// name: "statistics_saobian",
// meta: {
// title: "扫边车间统计",
// icon: "el-icon-trend-charts",
// perms: ["statistic_inm"],
// },
// component: "statistics/statistics_saobian.vue",
// },
//综合查询
{
name: "total_statistics",

View File

@ -355,7 +355,7 @@ export default {
// let baseInFo = data[data.current];
let base_logo =
this.$TOOL.data.get("BASE_INFO") !== null
? this.$TOOL.data.get("BASE_INFO").base.base_logo
? this.$TOOL.data.get("BASE_INFO").base.base_logo_i
: "img/logo.png";
// let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png';
return base_logo;

View File

@ -223,6 +223,21 @@
<el-col :span="12">
<div><span class="infotitle">TSP</span> 0.000 /h</div>
</el-col>
</el-row>
<div class="typeLine">
<div class="greenBlock">
<div class="greenBlockInner"></div>
</div>
<span>监控设备</span>
</div>
<div class="infoLine">
<span class="circles"></span>
<span>{{ eqj.name }}</span>
</div>
<el-row class="infoLine">
<el-col :span="12">
<div id="divPlugin" class="plugin"></div>
</el-col>
</el-row>
</div>
</div>
@ -255,6 +270,7 @@ export default {
eqs: {},
eqc: {},
eqz: {},
eqj: {},
pollutantDetail: false,
query: {},
apiObj: this.$API.enp.drain.list,
@ -316,7 +332,8 @@ export default {
}
},
mounted() {
let that = this;
that.init();
},
methods: {
initDom() {
@ -363,7 +380,13 @@ export default {
that.getDetailData(2, id);
} else if (res.type == 30) { //
that.eqz = res;
that.getDetailData(3, id);
}
else if (res.type == 50) { //
debugger;
this.login(res);//
that.eqj = res;
}
})
});
@ -425,6 +448,70 @@ export default {
this.pollutantDetail = false;
this.detailItem = {};
},
//
//
init() {
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
//
alert(1)
WebVideoCtrl.I_InitPlugin("divPlugin", 200, 200, {
iWndowType: 2, //N*N
bWndFull: true, //
cbInitPluginCompleted: function () {
alert(1)
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => {
//
WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => {
if (bFlag) {
alert("检测到新的插件版本双击开发包目录里的HCWebSDKPlugin.exe升级");
}
});
}, () => {
alert("插件初始化失败请确认是否已安装插件如果未安装请双击开发包目录里的HCWebSDKPlugin.exe安装");
});
},
});
},
//
login(jkdata){
WebVideoCtrl.I_Login(
jkdata.ip,
1,
jkdata.port,
jkdata.login_name,
jkdata.login_pwd,
{
async: true,
cgi: 1,
success: (xmlDoc) => {
console.log("登录成功", xmlDoc);
//
WebVideoCtrl.I_StartRealPlay(szIp + "_" + ipPort, {
success: () => {
console.log("预览成功");
},
});
},
error: (xmlDoc) => {
console.log("登录失败", xmlDoc);
},
}
);
}
}
}
</script>
</script>
<style scoped>
.plugin {
width: 200px;
height: 200px;
/* background: #ffffff; */
}
</style>

View File

@ -58,27 +58,27 @@
background-color: rgb(4, 50, 83);
box-shadow: inset 0px 0px 30px 15px rgb(7, 79, 109)" v-model="dialogFormVisible" title="车辆运输台账详情" >
<el-descriptions :column="3" width="600px">
<el-descriptions-item label="出入口编号">{{ ysdata.crkbh }}</el-descriptions-item>
<el-descriptions-item label="道闸编号">{{ ysdata.dzbh }}</el-descriptions-item>
<el-descriptions-item label="抬杆方式">{{ ysdata.tgfs }}</el-descriptions-item>
<el-descriptions-item label="进厂时间">{{ ysdata.jcsj }}</el-descriptions-item>
<el-descriptions-item label="出厂时间">{{ ysdata.ccsj }}</el-descriptions-item>
<el-descriptions-item label="车辆类型">{{ ysdata.cllx }}</el-descriptions-item>
<el-descriptions-item label="车牌颜色">{{ ysdata.clys }}</el-descriptions-item>
<el-descriptions-item label="车牌号">{{ ysdata.cph }}</el-descriptions-item>
<el-descriptions-item label="注册登记日期">{{ ysdata.zcdjsj }}</el-descriptions-item>
<el-descriptions-item label="车辆识别代码VIN">{{ ysdata.cpsbdm }}</el-descriptions-item>
<el-descriptions-item label="车辆品牌型号">{{ ysdata.clppxh }}</el-descriptions-item>
<el-descriptions-item label="发动机号码">{{ ysdata.fdjhm }}</el-descriptions-item>
<el-descriptions-item label="燃料类型">{{ ysdata.rllx }}</el-descriptions-item>
<el-descriptions-item label="排放阶段">{{ ysdata.pfjd }}</el-descriptions-item>
<el-descriptions-item label="使用性质">{{ ysdata.syxz }}</el-descriptions-item>
<el-descriptions-item label="联网状态">{{ ysdata.lwzt }}</el-descriptions-item>
<el-descriptions-item label="进厂运输货物名称">{{ ysdata.jcyshwmc }}</el-descriptions-item>
<el-descriptions-item label="进厂运输货物量">{{ ysdata.jchwl }}</el-descriptions-item>
<el-descriptions-item label="出厂运输货物名称">{{ ysdata.cchwmc }}</el-descriptions-item>
<el-descriptions-item label="出厂运输货物量">{{ ysdata.cchwl }}</el-descriptions-item>
<el-descriptions-item label="车队名称">{{ ysdata.cdmc }}</el-descriptions-item>
<el-descriptions-item label="出入口编号">{{ ysdata.crkbh }}</el-descriptions-item>
<el-descriptions-item label="道闸编号">{{ ysdata.dzbh }}</el-descriptions-item>
<el-descriptions-item label="抬杆方式">{{ ysdata.tgfs }}</el-descriptions-item>
<el-descriptions-item label="进厂时间">{{ ysdata.jcsj }}</el-descriptions-item>
<el-descriptions-item label="出厂时间">{{ ysdata.ccsj }}</el-descriptions-item>
<el-descriptions-item label="车辆类型">{{ ysdata.cllx }}</el-descriptions-item>
<el-descriptions-item label="车牌颜色">{{ ysdata.clys }}</el-descriptions-item>
<el-descriptions-item label="车牌号">{{ ysdata.cph }}</el-descriptions-item>
<el-descriptions-item label="注册登记日期">{{ ysdata.zcdjsj }}</el-descriptions-item>
<el-descriptions-item label="车辆识别代码VIN">{{ ysdata.cpsbdm }}</el-descriptions-item>
<el-descriptions-item label="车辆品牌型号">{{ ysdata.clppxh }}</el-descriptions-item>
<el-descriptions-item label="发动机号码">{{ ysdata.fdjhm }}</el-descriptions-item>
<el-descriptions-item label="燃料类型">{{ ysdata.rllx }}</el-descriptions-item>
<el-descriptions-item label="排放阶段">{{ ysdata.pfjd }}</el-descriptions-item>
<el-descriptions-item label="使用性质">{{ ysdata.syxz }}</el-descriptions-item>
<el-descriptions-item label="联网状态">{{ ysdata.lwzt }}</el-descriptions-item>
<el-descriptions-item label="进厂运输货物名称">{{ ysdata.jcyshwmc }}</el-descriptions-item>
<el-descriptions-item label="进厂运输货物量">{{ ysdata.jchwl }}</el-descriptions-item>
<el-descriptions-item label="出厂运输货物名称">{{ ysdata.cchwmc }}</el-descriptions-item>
<el-descriptions-item label="出厂运输货物量">{{ ysdata.cchwl }}</el-descriptions-item>
<el-descriptions-item label="车队名称">{{ ysdata.cdmc }}</el-descriptions-item>
<el-descriptions-item label="进厂照片">
<div class="demo-image__preview">

View File

@ -3,18 +3,29 @@
<el-main>
<div class="about">
<div id="divPlugin" class="plugin"></div>
<el-button @click="Login" type="primary">登录</el-button>
<el-button @click="vShow" type="primary">预览</el-button>
<el-button @click="stopShow" type="warning">停止预览</el-button>
<el-button @click="logOut" type="warning">登出设备</el-button>
<el-button @click="breakdom" type="warning">销毁设备</el-button>
<el-button @click="init" type="warning">初始化设备</el-button>
<div style="margin-top: 30px;">
<el-button @click="Login" type="primary">登录</el-button>
<el-button @click="vShow" type="primary">预览</el-button>
<el-button @click="stopShow" type="warning">停止预览</el-button>
<el-button @click="logOut" type="warning">登出设备</el-button>
<el-button @click="breakdom" type="warning">销毁设备</el-button>
<el-button @click="init" type="warning">初始化设备</el-button>
<el-select v-model="video_value" placeholder="请选择" @change="changeWndNum()">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</el-main>
</el-container>
</template>
<script>
import { ThinRenderTargetTexture } from "babylonjs";
export default {
data() {
@ -23,8 +34,26 @@ export default {
szIp: "192.168.1.65",
ipPort: "80",
username: "admin",
password: "9093QQww",
password: "zc2024!!!",
iPrototocol: 1, //http:1:http2:https
video_value:1,
options: [{
value: 1,
label: '1x1'
},
{
value: 2,
label: '2x2'
},
{
value: 3,
label: '3x3'
},
{
value: 4,
label: '4x4'
}
]
};
},
mounted() {
@ -32,34 +61,29 @@ export default {
that.init();
},
methods: {
//
init() {
// alert('init')
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
WebVideoCtrl.I_InitPlugin("divPlugin", 500, 500, {
WebVideoCtrl.I_InitPlugin("divPlugin", 600, 600, {
iWndowType: 2, //N*N
bWndFull: true, //
cbInitPluginCompleted: function () {
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(
() => {
WebVideoCtrl.I_CheckPluginVersion().then(
(bFlog) => {
if (bFlog) {
alert(
"插件版本有更新,请双击开发包里的HCWebSDKPlugin.exe升级"
);
}
}
);
},
() => {
alert(
"插件初始化失败,请确认是否安装插件,如果未安装,请请双击开发包里的HCWebSDKPlugin.exe安装"
);
}
);
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(() => {
//
WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => {
if (bFlag) {
alert("检测到新的插件版本双击开发包目录里的HCWebSDKPlugin.exe升级");
}
});
}, () => {
alert("插件初始化失败请确认是否已安装插件如果未安装请双击开发包目录里的HCWebSDKPlugin.exe安装");
});
},
});
},
//
Login() {
WebVideoCtrl.I_Login(
this.szIp,
@ -86,35 +110,77 @@ export default {
console.log("预览成功");
},
});
},
//
stopShow() {
WebVideoCtrl.I_Stop({
iWndIndex: 1, //tingzhichuangkou
success: () => {
console.log("停止预览成功");
},
});
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(),
szInfo = "";
if (oWndInfo != null) {
WebVideoCtrl.I_Stop({
success: function () {
console.log("停止预览成功!")
},
error: function (oError) {
console.log("停止预览失败!")
}
});
}
},
//
stopShowAll() {
WebVideoCtrl.I_StopAllPlay();
//WebVideoCtrl.I_StopAllPlay();
},
//
logOut() {
WebVideoCtrl.I_Logout(this.szIp + "_" + this.ipPort, {});
//WebVideoCtrl.I_Logout(this.szIp + "_" + this.ipPort, {});
var szDeviceIdentify =this.szIp;
if (null == szDeviceIdentify) {
return;
}
WebVideoCtrl.I_Logout(szDeviceIdentify).then(() => {
console.log(szDeviceIdentify + " " + "退出成功!");
}, () => {
console.log(szDeviceIdentify + " " + "退出失败!");
});
},
//
breakdom() {
WebVideoCtrl.I_DestroyPlugin();
},
//
changeWndNum() {
var iType = this.video_value;
if ("1*2" === iType || "2*1" === iType) {
WebVideoCtrl.I_ArrangeWindow(iType).then(() => {
console.log("窗口分割成功!");
}, (oError) => {
var szInfo = "窗口分割失败!";
console.log(szInfo, oError.errorCode, oError.errorMsg);
});
} else {
iType = parseInt(iType, 10);
WebVideoCtrl.I_ChangeWndNum(iType).then(() => {
console.log("窗口分割成功!");
}, (oError) => {
var szInfo = "窗口分割失败!";
console.log(szInfo, oError.errorCode, oError.errorMsg);
});
}
}
},
};
</script>
<style scoped>
.plugin {
width: 500px;
height: 500px;
width: 600px;
height: 600px;
/* background: #ffffff; */
}
</style>

View File

@ -0,0 +1,992 @@
<template>
<el-container class="dashboard">
<el-header class="header">
<div class="title">黑化车间生产数据看板</div>
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
</el-header>
<el-main>
<!-- 黑化 -->
<el-row style="height: 30%" :gutter="10">
<el-col :xs="7" :md="7" style="height: 100%">
<div class="box">
<div class="boxtitle bgimg">
<div class="boxlabel">昨日黑化合格统计</div>
</div>
<div style="height: 4px"></div>
<div class="boxmain bigdata border">
<div v-for="item in yesHeihuaData" :key="item.物料名" class="lineDiv">
<span>{{ item.物料名 }}</span>
<span class="boxmainItemNumber">{{item.合格数}}</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="7" :md="7">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">
昨日黑化不合格统计
</div>
</div>
<div class="boxmain" id="pieChart1"></div>
</div>
</el-col>
<el-col :xs="10" :md="10" style="height: 100%">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">黑化任务进度</div>
</div>
<div style="height: 2px"></div>
<div class="boxmain" id="scrollContainer">
<scScrollTavle
v-if="table1Visible"
:tableHeight="tableHeight"
:rowData="processData1"
:titleData="liData"
:refValue="refValue1"
></scScrollTavle>
</div>
</div>
</el-col>
</el-row>
<div style="height: 0.3%"></div>
<!-- 退火 -->
<el-row style="height: 30%" :gutter="10">
<el-col :xs="7" :md="7" style="height: 100%">
<div class="box">
<div class="boxtitle bgimg">
<div class="boxlabel">昨日退火合格统计</div>
</div>
<div style="height: 4px"></div>
<div class="boxmain bigdata border">
<!-- flex_center -->
<div v-for="item in yesTuihuoData" :key="item.物料名" class="lineDiv">
<span>{{ item.物料名 }}</span>
<span class="boxmainItemNumber">{{item.合格数}}</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="7" :md="7">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">
昨日退火不合格统计
</div>
</div>
<div class="boxmain" id="pieChart2"></div>
</div>
</el-col>
<el-col :xs="10" :md="10" style="height: 100%">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">退火任务进度</div>
</div>
<div style="height: 2px"></div>
<div class="boxmain" id="scrollContainer">
<scScrollTavle
v-if="table2Visible"
:tableHeight="tableHeight"
:rowData="processData2"
:titleData="liData"
:refValue="refValue2"
></scScrollTavle>
</div>
</div>
</el-col>
</el-row>
<!-- 合格数/合格率 -->
<div style="height: 0.3%"></div>
<el-row style="height: 39%" :gutter="10">
<el-col :xs="24" :md="12">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">黑化车间本月合格数统计</div>
</div>
<div class="boxmain" id="chart1"></div>
</div>
</el-col>
<el-col :xs="24" :md="12">
<div class="box">
<div class="boxtitle">
<div class="boxlabel">黑化车间本月合格率统计</div>
</div>
<div class="boxmain" id="chart2"></div>
</div>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
import * as echarts from "echarts";
import scScrollTavle from "@/components/scScrollTable.vue";
function deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
}
export default {
components: { scScrollTavle },
data() {
return {
basicOption: {
backgroundColor: "",
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
label: {
backgroundColor: "#6a7985",
},
},
},
legend: {
icon: "stack",
right: 0,
data: [
{
backgroundColor: "rgb(1,235,239)",
name: "黑化",
itemStyle: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(250,205,0)",
},
{
offset: 1,
color: "rgb(254,129,0)",
},
]
),
},
textStyle: {
color: "#fff",
},
},
{
backgroundColor: "rgb(250,205,0)",
name: "退火",
itemStyle: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(1,235,239)",
},
{
offset: 1,
color: "rgb(5, 158, 163)",
},
]
),
},
textStyle: {
color: "#fff",
},
},
],
},
toolbox: {
feature: {
// saveAsImage: {}
},
},
grid: {
left: "3%",
right: "2%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
boundaryGap: true,
data: [],
nameTextStyle: {
color: "#ffffff",
},
axisLabel: {
color: "#ffffff",
},
},
yAxis: {
name: "",
type: "value",
nameTextStyle: {
color: "#ffffff",
},
axisLabel: {
color: "#ffffff",
},
splitLine: {
show: false,
lineStyle: {
type: "dashed", //y线
color: "rgba(102,102,102,0.9)",
width: 1,
},
},
},
series: [
{
name: "黑化",
type: "bar",
// stack: "Ad",
barWidth: 10,
emphasis: {
focus: "series",
},
label: {
show: true,
position: "top",
color: "#fff",
},
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(250,205,0)",
},
{
offset: 1,
color: "rgb(254,129,0)",
},
]
),
},
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(250,205,0)",
},
{
offset: 1,
color: "rgb(254,129,0)",
},
]
),
},
smooth: true,
// lineStyle: {
// width: 1,
// color: "rgb(1,235,239)",
// },
data: [],
},
{
name: "退火",
type: "bar",
// stack: "Ad",
barWidth: 10,
emphasis: {
focus: "series",
},
label: {
show: true,
position: "top",
color: "#fff",
},
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(1,235,239)",
},
{
offset: 1,
color: "rgb(5, 158, 163)",
},
]
),
},
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(1,235,239)",
},
{
offset: 1,
color: "rgb(5, 158, 163)",
},
]
),
},
smooth: true,
// lineStyle: {
// width: 1,
// color: "rgb(1,235,239)",
// },
data: [10,50,80,60,65,58,70,80,90,100,110,120],
},
],
},
pieOption: {
backgroundColor: "",
tooltip: {
trigger: "item",
},
legend: {
top: "bottom",
},
series: {
name: "不合格统计",
type: "pie",
radius: "50%",
itemStyle: {
borderRadius: 2,
},
center: ["50%", "45%"],
data: [
{ value: 0, name: "划伤" },
{ value: 0, name: "气泡" },
{ value: 0, name: "水纹" },
{ value: 0, name: "崩边" },
{ value: 0, name: "雾面" },
{ value: 0, name: "麻点" },
{ value: 0, name: "线痕" },
{ value: 0, name: "破损" },
{ value: 0, name: "其他" },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
},
tableHeight: 100,
table1Visible: false,
table2Visible: false,
refValue1: "moocBox1",
refValue2: "moocBox2",
liData: ["序号","产出名称","规格","型号","开始时间","结束时间","完成进度","产量","状态"],
processData1: [],
processData2: [],
todayMtask: [],
speed: 2000,
myScroll: null,
iliHeight: 30,
time: null,
delay: 20,
start_date: "",
end_date: "",
yesterday: "",
dayInterval: null,
chartInterval1: null,
chartInterval2: null,
chartInterval3: null,
stateOption: {
30: "生产中",
40: "已完成",
},
currentTime: "",
currentDay: "",
today: "",
yesterdayObjet: {},
yesHeihuaData:[
{: 2024, : 7, : 5, 物料名: "CNC_黑化", 生产数: 260, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0},
],
yesTuihuoData:[
{: 2024, : 7, : 5, 物料名: "CNC_退火", 生产数: 250, 合格数: 240, 不合格数: 0, 划伤: 0, 气泡: 0, 水纹: 0, 崩边: 0, 雾面: 0,麻点:0},
],
};
},
mounted() {
//table
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
this.table1Visible = true;
this.table2Visible = true;
this.showTime();
this.dayInterval = setInterval(() => {
this.showTime();
}, 1000);
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let days = new Date(year, month, 0).getDate();
this.days = days;
this.currentYear = year;
this.currentMonth = month;
this.currentDay = day;
month = month < 10 ? "0" + month : month;
this.start_date = year + "-" + month + "-01";
this.end_date =
year + "-" + month + "-" + new Date(year, month, 0).getDate();
this.today = year + "-" + month + "-" + day;
let yesterday = new Date(date.getTime() - 24 * 60 * 60 * 1000);
this.yesterday =
yesterday.getFullYear() +
"-" +
(yesterday.getMonth() + 1) +
"-" +
yesterday.getDate();
this.getProductLine1();
// this.getProductLine2();
this.getMtask1();
this.getMtask2();
},
methods: {
//
showTime() {
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
this.currentDay = this.$TOOL.dateFormat(
new Date(),
"yyyy年MM月dd日"
);
},
setChart(name, option = null) {
// name , optionoption
var myChart = echarts.getInstanceByDom(
document.getElementById(name)
);
if (myChart == undefined) {
myChart = echarts.init(document.getElementById(name), "dark", {
renderer: "svg",
});
}
if (option == null) {
option = Object.assign({}, this.basicOption);
}
setTimeout(() => {
try {
myChart.setOption(option);
} catch (error) {}
}, 500);
return myChart;
},
//
getProductLine1() {
let that = this;
let obj = {
query: {
start_date: that.start_date,
end_date: that.end_date,
mgroup_name: "黑化",
"group_bys_material": "",
"order_bys_material": "",
"select_cols_material": "",
},
};
that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => {
console.log("本月黑化生产统计:", res);
let list2 = res.data2.ds0;
let seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
for (let i = 0; i < that.days; i++) {
seriesData1[i] = 0;
seriesData2[i] = 0;
}
if (list2.length > 0) {
list2.forEach((item2) => {
let index2 = item2. - 1;
//=/
seriesData1[index2] += item2.合格数;
seriesData2[index2] += item2.生产数;
});
}
for (let i = 0; i < that.days; i++) {
if(seriesData2[i]>0&&seriesData1[i] >=0){
seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ;
}else{
seriesData3[i]=0;
}
}
let chart1Option = deepCopy(this.basicOption);
let chart2Option = deepCopy(this.basicOption);
chart1Option.series[0].data = seriesData1;
chart2Option.series[0].type = 'line';
chart2Option.series[0].data = seriesData3;
that.getProductLine2(chart1Option,chart2Option);
});
//
let obj2 = {
query: {
start_date: that.yesterday,
end_date: that.yesterday,
mgroup_name: "黑化",
"group_bys_material": "",
"order_bys_material": "",
"select_cols_material": "",
},
};
that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => {
// console.log(":", res2);
that.yesHeihuaData = res2.data2.ds0;
let pieOption = deepCopy(that.pieOption);
if (res2.data2.ds0.length > 0) {
res2.data2.ds0.forEach((item) => {
pieOption.series.data[0].value += item.划伤;
pieOption.series.data[1].value += item.气泡;
pieOption.series.data[2].value = item.水纹;
pieOption.series.data[3].value = item.崩边;
pieOption.series.data[4].value = item.雾面;
pieOption.series.data[5].value = item.麻点;
pieOption.series.data[5].value = item.线痕;
pieOption.series.data[5].value = item.破损;
pieOption.series.data[5].value = item.其他;
});
}
let pieChart1 = this.setChart("pieChart1", pieOption);
let index1 = 0;
this.chartInterval3 = setInterval(function () {
if (index1 < that.pieOption.series.data.length) {
pieChart1.dispatchAction({
type: "downplay",
seriesIndex: 0,
});
pieChart1.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: index1,
});
pieChart1.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: index1,
});
index1++;
} else {
index1 = 0;
}
}, 3000);
debugger;
});
},
//退
getProductLine2(chart1Option,chart2Option) {
let that = this;
let obj = {
query: {
start_date: that.start_date,
end_date: that.end_date,
mgroup_name: "退火",
"group_bys_material": "",
"order_bys_material": "",
"select_cols_material": "",
},
};
that.$API.bi.dataset.exec.req("lineDay_m", obj).then((res) => {
// console.log("退:", res);
let list = res.data2.ds0;
let seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
xAxisData = [];
for (let i = 0; i < that.days; i++) {
let day = i + 1;
let text = day + "日";
xAxisData[i] = text;
seriesData1[i] = 0;
seriesData2[i] = 0;
}
if (list.length > 0) {
list.forEach((item2) => {
let index2 = item2. - 1;
seriesData1[index2] += item2.合格数;
seriesData2[index2] += item2.生产数;
});
}
for (let i = 0; i < that.days; i++) {
if(seriesData2[i]>0&&seriesData1[i] >=0){
seriesData3[i] = Math.round(seriesData1[i]/seriesData2[i])*100 ;
}else{
seriesData3[i]=0;
}
}
chart1Option.xAxis.data = xAxisData;
chart2Option.xAxis.data = xAxisData;
chart1Option.series[1].data = seriesData1;
chart2Option.series[1].type = 'line';
chart2Option.series[1].data = seriesData3;
let chart1 = this.setChart("chart1", chart1Option);
let chart2 = this.setChart("chart2", chart2Option);
let index2 = 0;
this.chartInterval2 = setInterval(function () {
if (index2 < chart1Option.series[0].data.length) {
chart2.dispatchAction({
type: "downplay",
seriesIndex: 0,
});
chart2.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: index2,
});
chart2.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: index2,
});
chart1.dispatchAction({
type: "downplay",
seriesIndex: 0,
});
chart1.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: index2,
});
chart1.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: index2,
});
index2++;
} else {
index2 = 0;
}
}, 3000);
});
//
let obj2 = {
query: {
start_date: that.yesterday,
end_date: that.yesterday,
mgroup_name: "退火",
"group_bys_material": "",
"order_bys_material": "",
"select_cols_material": "",
},
};
that.$API.bi.dataset.exec.req("lineDay_m", obj2).then((res2) => {
// console.log(":", res2);
that.yesTuihuoData = res2.data2.ds0;
let pieOption = deepCopy(that.pieOption);
if (res2.data2.ds0.length > 0) {
res2.data2.ds0.forEach((item) => {
pieOption.series.data[0].value += item.划伤;
pieOption.series.data[1].value += item.气泡;
pieOption.series.data[2].value = item.水纹;
pieOption.series.data[3].value = item.崩边;
pieOption.series.data[4].value = item.雾面;
pieOption.series.data[5].value = item.麻点;
pieOption.series.data[5].value = item.线痕;
pieOption.series.data[5].value = item.破损;
pieOption.series.data[5].value = item.其他;
});
}
let pieChart2 = this.setChart("pieChart2", pieOption);
let index2 = 0;
this.chartInterval3 = setInterval(function () {
if (index2 < pieOption.series.data.length) {
pieChart2.dispatchAction({
type: "downplay",
seriesIndex: 0,
});
pieChart2.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: index2,
});
pieChart2.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: index2,
});
index2++;
} else {
index2 = 0;
}
}, 3000);
debugger;
});
},
//
getMtask1() {
let that = this;
that.$API.mtm.mgroup.list.req({ page: 0, search: '黑化'})
.then((res) => {
if(res.length != 1){
that.$message.error("获取工段错误");
return;
}
let mgroup = res[0].id;
let obj = {};
// obj.start_date__gte = this.start_date;
// obj.end_date__lte = this.end_date;
obj.mgroup = mgroup;
obj.page = 0;
that.$API.pm.mtask.list.req(obj).then((res) => {
let processData = [];
res.forEach((item) => {
let arr = [],
obj1 = {},
obj2 = {},
obj3 = {},
obj4 = {},
obj5 = {},
obj6 = {},
obj7 = {},
obj8 = {};
obj1.elType = "primary";
obj1.value = item.material_out_.name;
obj2.elType = "primary";
obj2.value = item.material_out_.specification;
obj8.elType = "primary";
obj8.value = item.material_out_.model;
obj3.elType = "primary";
obj3.value = item.start_date;
obj4.elType = "primary";
obj4.value = item.end_date;
obj5.elType = "progress";
let process = Math.round(
(item.count_ok / item.count) * 100
);
obj5.value = process;
obj6.elType = "primary";
obj6.value = item.count_ok;
obj7.elType = "tag";
obj7.value = item.state;
arr.push(obj1);
arr.push(obj2);
arr.push(obj8);
arr.push(obj3);
arr.push(obj4);
arr.push(obj5);
arr.push(obj6);
arr.push(obj7);
processData.push(arr);
});
this.processData1 = processData;
});
});
},
//退
getMtask2() {
let that = this;
that.$API.mtm.mgroup.list.req({ page: 0, search: '退火'})
.then((res) => {
if(res.length != 1){
that.$message.error("获取工段错误");
return;
}
let mgroup = res[0].id;
let obj = {};
// obj.start_date__gte = this.start_date;
// obj.end_date__lte = this.end_date;
obj.mgroup = mgroup;
obj.page = 0;
that.$API.pm.mtask.list.req(obj).then((res) => {
let processData = [];
res.forEach((item) => {
let arr = [],
obj1 = {},
obj2 = {},
obj3 = {},
obj4 = {},
obj5 = {},
obj6 = {},
obj7 = {},
obj8 = {};
obj1.elType = "primary";
obj1.value = item.material_out_.name;
obj2.elType = "primary";
obj2.value = item.material_out_.specification;
obj8.elType = "primary";
obj8.value = item.material_out_.model;
obj3.elType = "primary";
obj3.value = item.start_date;
obj4.elType = "primary";
obj4.value = item.end_date;
obj5.elType = "progress";
let process = Math.round(
(item.count_ok / item.count) * 100
);
obj5.value = process;
obj6.elType = "primary";
obj6.value = item.count_ok;
obj7.elType = "tag";
obj7.value = item.state;
arr.push(obj1);
arr.push(obj2);
arr.push(obj8);
arr.push(obj3);
arr.push(obj4);
arr.push(obj5);
arr.push(obj6);
arr.push(obj7);
processData.push(arr);
});
this.processData2 = processData;
});
});
},
},
};
</script>
<style scoped>
@font-face {
font-family: "myfont";
/* 字体名称 */
src: url("../../utils/youShe.ttf");
/* 字体文件相对路径 */
}
.dashboard {
background-image: url("/public/img/photon_bg.png");
color: #fff;
font-family: "Microsoft Yahei" !important;
background-size: cover;
}
.header {
background: url("/public/img/photon_header.png");
border-bottom: none;
background-size: 100% 100%;
font-size: 26px;
display: block;
height: 80px;
color: rgb(149, 255, 255);
font-family: "Microsoft Yahei";
text-align: center;
padding: 12px 0px;
}
.header > .title {
font-weight: bold;
font-family: "myfont";
font-size: 32px;
}
.header > .timer {
font-size: 14px;
margin-top: 18px;
}
.box {
background: rgba(10, 63, 68, 0.5);
height: 100%;
}
.boxtitle {
color: #fff;
font-size: 16px;
display: flex;
height: 36px;
background: linear-gradient(
40deg,
rgba(11, 101, 140, 0.451),
rgba(0, 34, 48, 0.335),
rgba(11, 101, 140, 0.451)
);
}
.bgimg {
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
background-size: 140% 100%;
}
.boxlabel {
margin-left: 6px;
font-size: 18px;
margin-top: 6px;
}
.boxmain {
height: calc(100% - 40px);
}
.lineDiv {
height: 40px;
line-height: 40px;
padding-left: 0.5em;
}
.boxmainItemNumber {
color: rgb(42,234,200);
margin-left: 10px;
font-weight: bold;
font-face:24px;
font-family: electronicFont;
}
@media screen and (max-width: 800px) {
.boxmain {
height: 200px;
}
}
.flex_center {
display: flex;
align-items: center;
justify-content: center;
}
.border {
border: 1px dashed #49bcf7;
}
.bigdata {
font-size: 20px;
}
.title {
height: 40px;
line-height: 40px;
text-align: center;
}
.marquee_top {
transition: all 0.5s ease-in-out;
margin-top: -26px;
}
.totall {
color: #fff;
background-color: rgb(10, 63, 68);
}
.rollData {
background-color: rgb(10, 39, 50);
}
.rollData:nth-of-type(2n + 1) {
background-color: rgb(0, 59, 81);
}
.halfBox {
height: 50%;
}
</style>

View File

@ -159,7 +159,7 @@
</span>
</el-form-item>
<!-- <el-form-item label="巡检人" prop="inspect_user">
<el-select
<el-select
v-model="form.inspect_user"
placeholder="巡检人"
clearable
@ -384,4 +384,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -5,7 +5,7 @@
<el-form ref="dialogForm" :model="form" :rules="rules" :disabled="mode == 'show'" label-width="100px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="所属部门">
<el-form-item label="责任部门">
<el-cascader v-model="form.belong_dept" :options="group" :props="groupsProps" clearable
:show-all-levels="false" style="width: 100%" @change="deptChange">
</el-cascader>
@ -47,28 +47,53 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="规格型号" prop="model">
<el-input v-model="form.model" placeholder="规格型号" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="状态">
<el-form-item label="设备状态">
<el-select style="width: 100%" v-model="form.state" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-divider/>
<el-col :md="12" :sm="24">
<el-col :md="12" :sm="24">
<el-form-item label="设备分类">
<el-select v-model="form.cate" placeholder="所属大类" clearable style="width: 100%">
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-divider v-if="form.type == 50"/>
<el-row v-if="form.type == 50">
<el-col :md="12" :sm="24">
<el-form-item label="型号规格">
<el-input v-model="form.model" placeholder="规格型号规格" />
<el-form-item label="IP地址" prop="ip">
<el-input v-model="form.ip" placeholder="设备IP地址" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="端口号" prop="port">
<el-input v-model="form.port" placeholder="设备端口号" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="登录账号" prop="login_name">
<el-input v-model="form.login_name" placeholder="设备登录名" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="登录密码" prop="login_pwd">
<el-input v-model="form.login_pwd" placeholder="设备登录密码" />
</el-form-item>
</el-col>
</el-row>
<el-divider/>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="生产厂">
<el-input v-model="form.factory" placeholder="生产厂" />
@ -110,7 +135,7 @@
<el-col :md="12" :sm="24">
<el-form-item label="责任人" prop="leader_name">
<span style="display:flex">
<el-input readonly v-model="form.keeper_name"></el-input>
<el-input readonly v-model="form.keeper"></el-input>
<ehsUserSelect :multiple="false" @submit="getReceptionist" />
</span>
</el-form-item>
@ -121,7 +146,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="简要技术参数">
<el-input type="textarea" :rows="3" v-model="form.parameter" placeholder="技术参数" />
@ -185,6 +210,7 @@
<el-button @click="delJsonItem($index)" type="danger" size="small">删除</el-button>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
@ -222,8 +248,7 @@ export default {
rules: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
keeper_name: [{ required: true, message: "请输入", trigger: "blur" }],
belong_dept: [{ required: true, message: "请选择所属部门", trigger: "blur" }]
belong_dept: [{ required: true, message: "请选择责任部门", trigger: "blur" }]
},
options: [{
value: 10,

View File

@ -24,17 +24,19 @@
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" @selection-change="selectionChange">
<el-table-column type="selection" width="50" />
<el-table-column label="设备名称" prop="name" width="200" show-overflow-tooltip>
<el-table-column label="设备名称" prop="name" width="200" show-overflow-tooltip>
</el-table-column>
<el-table-column label="设备编号" prop="number">
</el-table-column>
<el-table-column label="型号规格" prop="model">
</el-table-column>
<el-table-column label="生产厂" prop="factory" show-overflow-tooltip>
<el-table-column label="设备IP" prop="ip" width="200" show-overflow-tooltip>
</el-table-column>
<el-table-column label="生产日期" prop="production_date">
<el-table-column label="端口号" prop="port">
</el-table-column>
<el-table-column label="购置日期" prop="buy_date">
<el-table-column label="登录账号" prop="login_name">
</el-table-column>
<el-table-column label="登录密码" prop="login_pwd">
</el-table-column>
<el-table-column label="状态">
<template #default="scope">
@ -52,27 +54,6 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="运行状态">
<template #default="scope">
<el-tag :type="runningStateEnum[scope.row.running_state]?.type">{{
runningStateEnum[scope.row.running_state]?.text }}</el-tag>
</template>
</el-table-column>
<el-table-column label="所在车间" show-overflow-tooltip>
<template #default="scope">{{ scope.row.belong_dept_name }}</template>
</el-table-column>
<el-table-column label="所在工段" show-overflow-tooltip>
<template #default="scope">{{ scope.row.mgroup_name }}</template>
</el-table-column>
<el-table-column label="保管人">
<template #default="scope">{{ scope.row.keeper_name }}</template>
</el-table-column>
<el-table-column label="存放位置" show-overflow-tooltip>
<template #default="scope">{{ scope.row.place }}</template>
</el-table-column>
<el-table-column label="备注" show-overflow-tooltip>
<template #default="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="180">
<template #default="scope">
<el-button link type="primary" @click="table_record(scope.row)" v-auth="'echeckrecord.create'">
@ -159,7 +140,7 @@
</span>
</el-form-item>
<!-- <el-form-item label="巡检人" prop="inspect_user">
<el-select
<el-select
v-model="form.inspect_user"
placeholder="巡检人"
clearable
@ -374,4 +355,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -161,6 +161,8 @@
<el-input
v-model="form.formula"
clearable
type="textarea"
:rows="3"
></el-input>
</el-form-item>
</el-col>

View File

@ -0,0 +1,40 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-segmented v-model="value" :options="options" size="large" />
</div>
</el-header>
<el-main class="nopadding">
<TaskResult v-if="value == 0" />
<Xscript v-if="value == 1" />
</el-main>
</el-container>
</template>
<script>
import Xscript from './xscript.vue'
import TaskResult from './taskresult.vue'
export default {
components: {
Xscript, TaskResult
},
data() {
return {
value: 0,
options: [{
label: '任务执行',
value: 0
},
{
label: '数据转储',
value: 1
}
]
}
},
methods: {
}
}
</script>

View File

@ -0,0 +1,222 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select
v-model="query.mpoint"
placeholder="测点"
clearable
style="margin: 0 6px; width: 300px"
@change="handleQuery"
>
<el-option
v-for="item in mpoints"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.type"
placeholder="类型"
style="margin: 0 6px; width: 120px"
@change="handleQuery"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<el-date-picker v-model="timeRange" type="datetimerange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" @change="handleQuery"
style="width: 100%" />
<el-button
type="primary"
icon="el-icon-search"
style="margin-left: 6px"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50" />
<el-table-column label="测点" prop="mpoint_name">
</el-table-column>
<el-table-column label="所属集合" prop="mgroup_name">
</el-table-column>
<el-table-column label="类型" prop="type" width="80"> </el-table-column>
<el-table-column label="年" prop="year" width="80"> </el-table-column>
<el-table-column label="班年" prop="year_s" width="80"> </el-table-column>
<el-table-column label="月" prop="month" width="50"> </el-table-column>
<el-table-column label="班月" prop="month_s" width="50"> </el-table-column>
<el-table-column label="日" prop="day" width="50"> </el-table-column>
<el-table-column label="班日" prop="day_s" width="50"> </el-table-column>
<el-table-column label="时" prop="hour" width="50"> </el-table-column>
<el-table-column label="当前值" prop="val"></el-table-column>
<el-table-column
label="校正值"
prop="val_correct"
></el-table-column>
<el-table-column
label="原始计算值"
prop="val_origin"
></el-table-column>
<!-- <el-table-column
label="操作"
fixed="right"
align="center"
width="140"
>
<template #default="scope">
<el-button
link
size="small"
@click="handle_edit(scope.row)"
type="primary"
>校正</el-button
>
</template>
</el-table-column> -->
</scTable>
</el-main>
<el-dialog title="校正" v-model="visible">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
label-position="right"
label-width="80px"
style="padding: 0 10px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="所属部门">
<span>{{ form.belong_dept_name }}</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="工段名称">
<span>{{ form.mgroup_name }}</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="校正值">
<el-input-number
v-model="form.val_correct"
:min="0"
controls-position="right"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-dialog>
</el-container>
</template>
<script>
export default {
name: "sflog",
data() {
return {
apiObj: this.$API.enm.mpoint.stat,
params: {},
query: {
mpoint: null,
type: "hour",
start_time: null,
end_time: null
},
options: [
{ label: "小时", value: "hour"},
{ label: "天", value: "day" },
{ label: "月", value: "month"},
{ label: "班天", value: "day_s" },
{ label: "班月", value: "month_s" },
],
form: {
id: "",
val_correct: "",
},
visible: false,
mpoints: [],
timeRange: []
};
},
mounted() {
this.getMpoints();
},
methods: {
getMpoints() {
let that = this;
this.$API.enm.mpoint.list
.req({ page: 0})
.then((res) => {
that.mpoints = res;
});
},
handle_add() {},
handleQuery() {
console.log(this.query)
if (this.timeRange) {
this.query.start_time = this.timeRange[0]
this.query.end_time = this.timeRange[1]
} else {
this.query.start_time = null
this.query.end_time = null
}
this.$refs.table.queryData(this.query);
},
//
handle_edit(row) {
this.form = { ...row };
this.form.val_correct = row.val;
this.visible = true;
},
//
submit() {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.isSaveing = true;
let obj = {};
obj.val_correct = this.form.val_correct;
this.$API.enm.mpointstat.correct
.req(this.form.id, obj)
.then((res) => {
this.isSaveing = false;
this.visible = false;
this.$refs.table.queryData(this.query);
})
.catch((e) => {
this.isSaveing = false;
});
}
});
},
},
};
</script>
<style scoped>
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-select v-model="query.status" placeholder="执行状态" clearable @change="handleQuery">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-date-picker v-model="timeRange" type="datetimerange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" clearable @change="handleQuery"/>
</div>
</el-header>
<el-main>
<scTable ref="table" :apiObj="apiObj" :params="params" @row-click="itemDetail">
<el-table-column label="执行ID" prop="task_id" width="280" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="名称" prop="periodic_task_name" width="240" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="执行方法" prop="task_name" width="260" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="状态" prop="status" width="80" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="执行返回" prop="result" width="180" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="开始时间" prop="date_created" width="160" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="结束时间" prop="date_done" width="160" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="错误信息" prop="traceback" min-width="80" :show-overflow-tooltip="true"></el-table-column>
</scTable>
</el-main>
<el-dialog v-model="dVisible" title="详情">
<el-descriptions :column="1" border>
<el-descriptions-item label="开始执行" width="80">{{ current_tr.date_created }}</el-descriptions-item>
<el-descriptions-item label="结束执行">{{ current_tr.date_created }}</el-descriptions-item>
<el-descriptions-item label="执行状态">{{ current_tr.status }}</el-descriptions-item>
<el-descriptions-item label="返回结果">{{ current_tr.result }}</el-descriptions-item>
<el-descriptions-item label="错误信息">{{ current_tr.traceback }}</el-descriptions-item>
</el-descriptions>
</el-dialog>
</el-container>
</template>
<script>
export default {
data() {
return {
apiObj: this.$API.system.task.result,
params: {
task_name__in: "apps.enm.tasks.cal_mpointstats"
},
timeRange:[],
query: {},
statusOptions: [
{label: 'SUCCESS', value: 'SUCCESS'},
{label: 'FAILURE', value: 'FAILURE'},
{label: 'REVOKED', value: 'REVOKED'},
{label: 'PENDING', value: 'PENDING'},
{label: 'RETRY', value: 'RETRY'},
],
dVisible: false,
current_tr: {}
}
},
methods: {
itemDetail(row){
this.dVisible = true;
this.current_tr = row;
},
handleQuery(){
if(this.timeRange){
this.query.date_created__gte = this.timeRange[0]
this.query.date_created__lte = this.timeRange[1]
}
else{
this.query.date_created__gte = null
this.query.date_created__lte = null
}
this.$refs.table.queryData(this.query)
}
}
}
</script>

View File

@ -0,0 +1,224 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'xscript.create'"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" hidePagination>
<el-table-column label="#" type="index" width="50">
<template #default="scope">
<el-link type="primary" @click="lastDetail(scope.row)">{{ scope.$index + 1 }}</el-link>
</template>
</el-table-column>
<el-table-column label="名称" prop="name" min-width="240" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="时间策略" prop="myschedule_name" min-width="300" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="是否启用" width="80" :show-overflow-tooltip="true">
<template #default="scope">
<el-icon v-if="scope.row.enabled" color="green"
><CircleCheckFilled
/></el-icon>
</template>
</el-table-column>
<el-table-column label="运行次数" prop="total_run_count" width="80" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="最后运行时间" prop="last_run_at" width="160" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="200">
<template #default="scope">
<el-button plain type="warning" size="small" @click="table_toggle(scope.row, scope.$index)"
v-auth="'xscript.update'">/</el-button>
<el-button plain type="warning" size="small" @click="table_edit(scope.row, scope.$index)"
v-auth="'xscript.update'">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button plain type="danger" size="small" v-auth="'xscript.delete'">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
<el-drawer
title="新增/编辑"
v-model="visible"
:size="1000"
destroy-on-close
>
<el-container>
<el-main style="padding: 0 20px 20px 20px">
<el-form ref="rForm" :model="form">
<el-form-item label="脚本名称" required>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="脚本内容" required>
<Codemirror
v-model:value="form.code"
:options="cmOptions"
border
ref="cmRef"
height="300"
width="100%"
style="line-height: 180%"
>
</Codemirror>
</el-form-item>
<el-form-item label="基础数据">
<JsonEditorVue
style="width: 100%"
v-model="form.base_data"
/>
</el-form-item>
<el-form-item label="变动数据">
<el-button type="warning" @click="openCdg" size="small">变更</el-button><span> ------ {{ form.change_data }}</span>
</el-form-item>
<el-form-item label="时间策略" required>
<el-select
v-model="form.myschedule"
style="width: 100%"
>
<el-option
v-for="item in schOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" @click="submit">提交</el-button>
</el-footer>
</el-container>
</el-drawer>
<el-dialog title="最后执行" v-model="detailVisible">
<el-descriptions :column="1" border v-if="detailForm.last_run_data != null">
<el-descriptions-item label="开始执行">{{ detailForm.last_run_data.date_created }}</el-descriptions-item>
<el-descriptions-item label="结束执行">{{ detailForm.last_run_data.date_created }}</el-descriptions-item>
<el-descriptions-item label="执行状态">{{ detailForm.last_run_data.status }}</el-descriptions-item>
<el-descriptions-item label="返回结果">{{ detailForm.last_run_data.result }}</el-descriptions-item>
<el-descriptions-item label="错误信息">{{ detailForm.last_run_data.traceback }}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<el-dialog title="变更数据" v-model="cDgVisible">
<JsonEditorVue
style="width: 100%"
v-model="xdata"
/>
<el-footer>
<el-button type="primary" @click="submit2">提交</el-button>
</el-footer>
</el-dialog>
</el-container>
</template>
<script>
import JsonEditorVue from "json-editor-vue3";
import "codemirror/mode/python/python.js";
import 'codemirror/lib/codemirror.css'
import Codemirror from "codemirror-editor-vue3";
const dForm = {
base_data: {},
};
export default {
components: { JsonEditorVue, Codemirror },
data() {
return {
apiObj: this.$API.enm.xscript.list,
visible: false,
form: {},
detailForm: {},
detailVisible: false,
schOptions: [],
cmOptions: {
mode: "text/x-python",
theme: "default",
readOnly: false,
lineNumbers: true,
lineWiseCopyCut: true,
// gutters: ["CodeMirror-lint-markers"],
lint: true,
autoRefresh: true
},
cDgVisible: false,
xdata: {}
};
},
mounted() {
this.getSchOptions();
},
methods: {
openCdg(){
this.xdata = Object.assign({}, this.form.change_data)
this.cDgVisible = true;
},
lastDetail(row) {
this.$API.enm.xscript.item.req(row.id).then(res=>{
this.detailForm = res
this.detailVisible = true
})
},
getSchOptions() {
this.$API.system.myschedule.list.req({ page: 0 }).then((res) => {
this.schOptions = res;
});
},
add() {
this.form = Object.assign({}, dForm);
this.visible = true;
this.$nextTick(() => {
this.$refs.cmRef.refresh()
})
},
table_edit(row) {
this.$API.enm.xscript.item.req(row.id).then(res=>{
this.form = res
this.visible = true
})
},
table_del(row) {
this.$API.enm.xscript.delete.req(row.id).then(()=>{
this.$message.success('删除成功')
this.$refs.table.refresh()
})
},
table_toggle(row) {
this.$API.enm.xscript.toggle.req(row.id).then(() => {
this.$message.success("操作成功");
this.$refs.table.refresh();
})
},
submit2() {
this.$API.enm.xscript.change_data.req(this.form.id, {change_data: this.xdata}).then(() => {
this.$message.success("操作成功");
this.form.change_data = this.xdata;
this.cDgVisible = false;
})
},
submit() {
this.$refs.rForm.validate(async (valid)=>{
if(valid){
if(this.form.id){
this.$API.enm.xscript.update.req(this.form.id, this.form).then(()=>{
this.$message.success('更新成功')
this.visible = false
this.$refs.table.refresh()
})
}else{
this.$API.enm.xscript.create.req(this.form).then(()=>{
this.$message.success('添加成功')
this.visible = false
this.$refs.table.refresh()
})
}
}
})
},
},
};
</script>

5
src/views/home/blank.vue Normal file
View File

@ -0,0 +1,5 @@
<template>
<el-container>
</el-container>
</template>

214
src/views/inm/inmScrap.vue Normal file
View File

@ -0,0 +1,214 @@
<template>
<el-container>
<el-header>
<!-- <div class="left-panel">
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
报废</el-button>
</div> -->
<div class="right-panel">
<!-- <el-button type="primary" @click="materialsChoses('wm')"
>选择物料</el-button
> -->
<!-- <el-select
v-model="query.mgroupx"
placeholder="工段"
clearable
@change="handleQuery"
style="width: 250px"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select> -->
<el-input
style="margin-right: 5px;width: 250px"
v-model="query.search"
placeholder="名称"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params"
:query="query"
>
<el-table-column label="状态" prop="state" width="100" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}}
</el-tag>
</template>
</el-table-column>
<el-table-column
label="物料名称"
prop="material_name"
min-width="150"
>
<template #default="scope">
{{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null"
>{{ scope.row.material_origin_name }}</span
>
</template>
</el-table-column>
<el-table-column
label="批次号"
prop="batch"
min-width="120"
></el-table-column>
<el-table-column
label="部门/工段"
prop="belong_dept_name"
>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column
label="数量"
prop="count"
min-width="80"
></el-table-column>
<el-table-column
label="不合格标记"
prop="notok_sign_name"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
width="150"
></el-table-column>
</scTable>
</el-main>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
<scrap-dialog
v-if="dialog.scrap"
ref="scrapDialog"
:type="type"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
@success="handleScrapSuccess"
@closed="dialog.scrap = false"
>
</scrap-dialog>
</el-container>
</template>
<script>
import { wmState } from "@/utils/enum.js";
// import materials from "./../mtm/materials.vue";
// import checkDialog from "./check_form.vue";
// import showDrawer from "./check_drawer.vue";
// import scrapDialog from "./handover_form.vue";
export default {
props: {
mgroupName: {
type: String,
default: "",
},
},
// components: {
// materials,
// checkDialog,
// showDrawer,
// scrapDialog
// },
name: "wmaterial",
data() {
return {
wmState,
apiObj: this.$API.wpm.wmaterial.list,
params: {
state : 50,
state_all: 1
},
query: {
search:''
},
dialog: {
scrap: false,
},
options:[],
tableData: [],
selection: [],
queryWm: {
search: "",
material: "",
},
materialType: "wm",
visibleDrawer: false,
};
},
mounted() {
let that = this;
// that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
// that.options = res;
// if(res.length>0){
// that.params.mgroupx = res[0].id;
// }
// });
},
methods: {
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
this.materialsVisible = false;
},
tomio() {
this.$router.push({ name: "halfgood_mio" });
},
table_Check(row){
this.checkItem = row;
let mode = this.mgroupName;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open(mode);
});
},
//
selectionChange(selection) {
this.selection = selection;
},
//
table_add(type) {
this.dialog.scrap = true;
this.type = type;
this.$nextTick(() => {
this.$refs.scrapDialog.open("add");
});
},
handleScrapSuccess(){
this.dialog.scrap = false;
this.$refs.table.refresh();
},
//
handleQuery() {
this.$refs.table.queryData(this.query);
},
},
};
</script>
<style scoped></style>

View File

@ -1019,15 +1019,10 @@ export default {
that.weight_kgs.forEach((item) => {
arr.push(item.value);
});
let obj = {};
obj.test_date = that.form.test_date;
obj.test_user = that.form.test_user;
obj.count_bag = that.form.count_bag;
obj.weight_kgs = arr;
obj.is_testok = that.form.is_testok;
console.log(obj);
that.form.weight_kgs = arr;
console.log('that.form',that.form);
that.$API.inm.mioitem.testpurin
.req(that.mioitemId, obj)
.req(that.mioitemId, that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");

105
src/views/inm/workshop.vue Normal file
View File

@ -0,0 +1,105 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select
v-model="query.mgroup"
clearable
placeholder="所在工段"
@change="handleQuery"
style="margin-left: 10px; width: 150px"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="物料名/批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="物料名" prop="material">
<template #default="scope">{{scope.row.material_.name}}</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">{{scope.row.material_.specification}}</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">{{scope.row.material_.model}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{scope.row.material_.process_name}}</template>
</el-table-column>
<el-table-column label="所在工段" prop="belong_dept_name">
</el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "halfgood",
data() {
return {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type: 10 },
selection: [],
query: {},
mgroupOptions: [],
apiObjWm: this.$API.wpm.wmaterial.list,
paramsWm: { count__gte: 1, material__type: 10 },
queryWm: {},
};
},
mounted() {
this.getMgroup();
},
methods: {
getMgroup() {
let that = this;
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
this.mgroupOptions = res;
});
},
getProcessOptions() {
this.$API.mtm.process.list.req({ page: 0 }).then((res) => {
this.processOptions = res;
});
},
handleQueryWm() {
this.$refs.table_wm.queryData(this.queryWm);
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -0,0 +1,254 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="add('do_out')"
v-auth="'mio.do'"
>生产领料</el-button
>
<el-button
type="primary"
@click="add('do_in')"
v-auth="'mio.do'"
>生产入库</el-button
>
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.state"
clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:params="params"
:query="query"
row-key="id"
stripe
>
<el-table-column type="index" width="50" />
<el-table-column
label="记录编号"
prop="number"
></el-table-column>
<el-table-column label="出/入库类型">
<template #default="scope">
{{ typeDict[scope.row.type] }}
</template>
</el-table-column>
<el-table-column label="记录状态">
<template #default="scope">
{{ stateDict[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="出/入库日期" prop="inout_date">
</el-table-column>
<el-table-column label="执行部门" prop="belong_dept_name">
<template #default="scope">
{{ scope.row.belong_dept_name }} - {{ scope.row.mgroup_name }}
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="150px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>
查看
</el-button>
<el-button
link
type="primary"
@click="table_submit(scope.row)"
v-auth="'mio.submit'"
v-if="scope.row.state == 10"
>
提交
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'mio.delete'"
v-if="scope.row.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template>
<script>
import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default {
name: "mio",
components: {
saveDialog,
recordDialog,
},
data() {
return {
stateDict: {
10: "创建中",
20: "已提交",
},
stateOptions: [
{ id: 10, name: "创建中" },
{ id: 20, name: "已提交" },
],
typeDict: {
do_out: "生产领料",
do_in: "生产入库",
},
cateOptions: [
{ id: "do_out", name: "生产领料" },
{ id: "do_in", name: "生产入库" },
],
dialog: {
save: false,
record: false,
},
query: {},
params: {
type__in: "sale_out,do_in",
materials__type: 10,
},
form: {},
apiObj: this.$API.inm.mio.list,
selection: [],
type: "",
cate: "good",
mioId: "",
visibleDrawer: false,
};
},
methods: {
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit", type).setData(row);
});
},
//
table_detail(row) {
this.type = row.type;
this.mioId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.$refs.table.refresh();
});
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
handleSaveSuccess() {
this.$refs.table.refresh();
},
},
};
</script>

View File

@ -66,8 +66,15 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="计量单位">
<el-input
v-model="form.unit"
placeholder="计量单位"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type==10||form.type==20">
<el-form-item label="已到工序" prop="process">
<el-select
v-model="form.process"

View File

@ -225,6 +225,7 @@ export default {
console.log("materialType", this.materialType);
this.apiObj = this.$API.mtm.material.list;
this.$refs.table.queryData(this.query);
this.materialTemplate = this.materialTemplate+"?t=" + new Date().getTime();
},
methods: {
rowClick(row) {

View File

@ -66,10 +66,10 @@
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="主要输入" prop="material_in">
<el-form-item label="输入物料" prop="material_in">
<el-select
v-model="form.material_in"
placeholder="物料"
placeholder="输入物料"
clearable
filterable
:value-on-clear="null"
@ -99,10 +99,10 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="主要输出" prop="material_out">
<el-form-item label="输出物料" prop="material_out">
<el-select
v-model="form.material_out"
placeholder="物料"
placeholder="输出物料"
clearable
filterable
:value-on-clear="null"
@ -131,10 +131,10 @@
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="工时" prop="hour_work">
<el-form-item label="计划时长" prop="hour_work">
<el-input-number
v-model="form.hour_work"
:min="1"
:min="0"
style="width: 100%"
/>
</el-form-item>
@ -171,9 +171,12 @@ const defaultForm = {
process: null,
sort: 1,
out_rate: 100,
material_in:'',
material_out:'',
hour_work:0,
batch_bind: true,
is_autotask: true,
is_count_utask: false,
// is_count_utask: false,
};
export default {
props: {
@ -185,7 +188,7 @@ export default {
loading: false,
mode: "add",
//
form: defaultForm,
form: Object.assign({}, defaultForm),
//
rules: {
process: [

View File

@ -79,67 +79,73 @@
<!--工序!-->
<el-main class="nopadding" v-if="active === 1">
<div class="left-panel" style="margin: 10px">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
></el-button>
</div>
<scTable
ref="tables"
:apiObj="apiObj"
:query="query"
:params="query"
row-key="id"
hidePagination
hideDo
stripe
style="height: 500px"
>
<el-table-column label="排序" prop="sort" width="50">
</el-table-column>
<el-table-column label="工序" prop="process_name">
</el-table-column>
<el-table-column label="输入" prop="material_in_name">
</el-table-column>
<el-table-column label="输出" prop="material_out_name">
</el-table-column>
<el-table-column label="出材率" prop="out_rate">
</el-table-column>
<el-table-column label="工时" prop="hour_work">
</el-table-column>
<el-table-column label="批次校验" prop="batch_bind">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope">
<el-container>
<el-header>
<div class="left-panel" style="margin: 10px">
<el-button
text
type="primary"
size="small"
@click="table_edit(scope.row)"
>编辑</el-button
icon="el-icon-plus"
@click="table_add"
></el-button>
</div>
</el-header>
<el-main>
<scTable
ref="tables"
:apiObj="apiObj"
:query="query"
:params="query"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column label="排序" prop="sort" width="50">
</el-table-column>
<el-table-column label="工序" prop="process_name">
</el-table-column>
<el-table-column label="输入" prop="material_in_name">
</el-table-column>
<el-table-column label="输出" prop="material_out_name">
</el-table-column>
<el-table-column label="出材率" prop="out_rate">
</el-table-column>
<el-table-column label="工时" prop="hour_work">
</el-table-column>
<el-table-column label="批次校验" prop="batch_bind">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<el-popconfirm
title="确定删除该工序吗?"
@confirm="delWorker(scope.row)"
>
<template #reference>
<el-button text type="danger" size="small"
>删除</el-button
<template #default="scope">
<el-button
text
type="primary"
size="small"
@click="table_edit(scope.row)"
>编辑</el-button
>
<el-popconfirm
title="确定删除该工序吗?"
@confirm="delWorker(scope.row)"
>
<template #reference>
<el-button text type="danger" size="small"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
<div style="margin-top: 20px; text-align: center">
<el-button @click="handleLastStep" style="margin-right: 4px"
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
<el-footer v-if="active === 1" style="text-align: center">
<el-button @click="handleLastStep" style="margin-right: 4px"
>上一步</el-button
>
<el-button
@ -155,8 +161,7 @@
<el-button @click="$emit('closed')" type="warning"
>退出</el-button
>
</div>
</el-main>
</el-footer>
</el-container>
<save-dialog
v-if="dialog.save"

View File

@ -53,9 +53,9 @@
<el-form :model="addForm" :rules="rules" ref="addForm" label-width="100px" label-position="right">
<el-form-item label="类型" prop="type">
<el-radio-group v-model="addForm.type">
<el-radio :label="10">模块</el-radio>
<el-radio :label="20">页面</el-radio>
<el-radio :label="30">接口</el-radio>
<el-radio :value="10">模块</el-radio>
<el-radio :value="20">页面</el-radio>
<el-radio :value="30">接口</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="名称" prop="name">
@ -86,6 +86,11 @@
<script>
import { genTree } from "@/utils/verificate";
const dForm = {
codes: [],
type: 10,
sort: 1,
};
export default {
name: "dept",
data() {
@ -109,14 +114,7 @@ export default {
},
//
addForm: {
id: "",
name: "",
codes: [],
type: 10,
sort: 1,
parent: null,
},
addForm: this.dForm,
//
rules: {
name: [{ required: true, message: "请输入名称" }],
@ -154,7 +152,7 @@ export default {
this.type = "add";
this.limitedVisible = true;
this.$nextTick(() => {
this.$refs.addForm.resetFields();
this.addForm = Object.assign({}, dForm);
});
},
//
@ -182,7 +180,6 @@ export default {
// debugger;
if (valid) {
this.isSaveing = true;
var res;
if (this.type === "add") {
this.$API.system.permission.create
.req(that.addForm)

View File

@ -43,11 +43,9 @@
</el-table-column>
<el-table-column label="联系方式" prop="contact_phone">
</el-table-column>
<el-table-column
label="地址"
prop="address"
show-overflow-tooltip
>
<el-table-column label="地址" prop="address" show-overflow-tooltip>
</el-table-column>
<el-table-column label="单位编号" prop="number" show-overflow-tooltip>
</el-table-column>
<el-table-column label="是否外协" prop="can_outsource">
<template #default="scope">

View File

@ -49,6 +49,14 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="单位编号">
<el-input
v-model="form.number"
placeholder="单位编号"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="是否外协">
<el-switch v-model="form.can_outsource">

View File

@ -31,7 +31,7 @@
<el-descriptions-item label="抽检数">{{
workObj.count_sampling
}}</el-descriptions-item>
<el-descriptions-item label="配管批次号" v-if=" workObj.mb_&&workObj.mb_.assemb">
<el-descriptions-item label="配管批次号" v-if=" workObj.mb_&&workObj.mb_.assemb">
<span v-for="item in workObj.mb_.assemb" :key="item.id">{{item.batch}}</span>
</el-descriptions-item>
</el-descriptions>

View File

@ -291,6 +291,18 @@
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_zq"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
@ -352,7 +364,7 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="圈">
<el-form-item label="圈">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_lq"
@ -417,6 +429,7 @@ export default {
count_n_swen: 0,
count_n_bb: 0,
count_n_zb: 0,
count_n_zq: 0,
count_n_hs: 0,
count_n_md: 0,
count_n_hqbx: 0,
@ -485,6 +498,7 @@ export default {
this.count_notok_json.count_n_qp=
this.count_notok_json.count_n_swen=
this.count_notok_json.count_n_zb=
this.count_notok_json.count_n_zq=
this.count_notok_json.count_n_hs=
this.count_notok_json.count_n_md=
this.count_notok_json.count_n_hqbx=
@ -507,6 +521,7 @@ export default {
this.count_notok_json.count_n_z+
this.count_notok_json.count_n_swen+
this.count_notok_json.count_n_zb+
this.count_notok_json.count_n_zq+
this.count_notok_json.count_n_hs+
this.count_notok_json.count_n_md+
this.count_notok_json.count_n_hqbx+

View File

@ -0,0 +1,127 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.start_date"
type="date"
placeholder="查询日期"
value-format="YYYY-MM-DD"
style="width: 160px"
>
</el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
<el-button @click="handleExport" type="primary">导出</el-button>
</el-header>
<el-main style="background: #ffffff">
<scTable :data="tableData" id="exportDiv">
<el-table-column type="index" width="50" />
<el-table-column label="物料名称" prop="物料名"></el-table-column>
<el-table-column label="规格" prop="规格"> </el-table-column>
<el-table-column label="型号" prop="型号"> </el-table-column>
<el-table-column label="工序" prop="工序"> </el-table-column>
<el-table-column label="检验时间">
<template #default="scope">
{{ scope.row. }}-{{ scope.row. }}-{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="检验数" prop="检验数"></el-table-column>
<el-table-column label="合格数" prop="合格数量"></el-table-column>
<el-table-column label="不合格数" align="center">
<el-table-column label="黑圈内径" prop="黑圈内径"></el-table-column>
<el-table-column label="黑圈内径圆度" prop="黑圈内径圆度"></el-table-column>
<el-table-column label="黑圈外径" prop="黑圈外径"></el-table-column>
<el-table-column label="黑圈外径圆度" prop="黑圈外径圆度"></el-table-column>
<el-table-column label="产品外径" prop="产品外径"></el-table-column>
<el-table-column label="产品圆度" prop="产品圆度"></el-table-column>
<el-table-column label="产品同心度" prop="产品同心度"></el-table-column>
<el-table-column label="厚度" prop="厚度"></el-table-column>
<el-table-column label="准合格" prop="准合格"></el-table-column>
<el-table-column label="圆准" prop="圆准"></el-table-column>
<el-table-column label="脏" prop="脏"></el-table-column>
<el-table-column label="气泡" prop="气泡"></el-table-column>
<el-table-column label="水纹" prop="水纹"></el-table-column>
<el-table-column label="崩边" prop="崩边"></el-table-column>
<el-table-column label="棕边" prop="棕边"></el-table-column>
<el-table-column label="棕圈" prop="棕圈"></el-table-column>
<el-table-column label="划伤" prop="划伤"></el-table-column>
<el-table-column label="麻点" prop="麻点"></el-table-column>
<el-table-column label="黑圈变形" prop="黑圈变形"></el-table-column>
<el-table-column label="倒角" prop="倒角"></el-table-column>
<el-table-column label="破损" prop="破损"></el-table-column>
<el-table-column label="蓝圈" prop="蓝圈"></el-table-column>
<el-table-column label="合计" prop="不合格数"></el-table-column>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "chart",
data() {
return {
query:{
start_date:'',
end_date:'',
fw_type:'prod'
},
currentDate: "",
tableData: [],
};
},
mounted() {
let that = this;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
let queryDate = year + "-" + month + "-" + day;
that.query.start_date = that.query.end_date = that.currentDate = queryDate;
this.getData();
},
methods: {
getData() {
let that = this;
let obj = {};
obj.query = that.query;
that.$API.bi.dataset.exec.req('ftestDay', obj).then((res) => {
that.tableData = res.data2.ds0;
console.log(that.tableData);
});
},
handleQuery() {
if(this.query.start_date){
this.query.end_date = this.query.start_date;
}else{
this.query.start_date = this.query.end_date = this.currentDate;
}
this.getData();
},
handleExport() {
this.exportLoading = true;
this.$XLSX("#exportDiv", "成品检验统计");
this.exportLoading = false;
},
},
};
</script>
<style scoped>
.tables {
position: absolute;
top: 4px;
right: 6px;
z-index: 10;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.start_date"
type="date"
placeholder="查询日期"
value-format="YYYY-MM-DD"
style="width: 160px"
>
</el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
<el-button @click="handleExport" type="primary">导出</el-button>
</el-header>
<el-main style="background: #ffffff">
<scTable :data="tableData" id="exportDiv">
<el-table-column type="index" width="50" />
<el-table-column label="物料名称" prop="物料名"></el-table-column>
<el-table-column label="规格" prop="规格"> </el-table-column>
<el-table-column label="型号" prop="型号"> </el-table-column>
<el-table-column label="工序" prop="工序"> </el-table-column>
<el-table-column label="检验时间">
<template #default="scope">
{{ scope.row. }}-{{ scope.row. }}-{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="检验数" prop="检验数"></el-table-column>
<el-table-column label="合格数" prop="合格数"></el-table-column>
<el-table-column label="不合格数" align="center">
<el-table-column label="黑圈内径" prop="黑圈内径"></el-table-column>
<el-table-column label="黑圈内径圆度" prop="黑圈内径圆度"></el-table-column>
<el-table-column label="黑圈外径" prop="黑圈外径"></el-table-column>
<el-table-column label="黑圈外径圆度" prop="黑圈外径圆度"></el-table-column>
<el-table-column label="产品外径" prop="产品外径"></el-table-column>
<el-table-column label="产品圆度" prop="产品圆度"></el-table-column>
<el-table-column label="产品同心度" prop="产品同心度"></el-table-column>
<el-table-column label="厚度" prop="厚度"></el-table-column>
<el-table-column label="准合格" prop="准合格"></el-table-column>
<el-table-column label="圆准" prop="圆准"></el-table-column>
<el-table-column label="脏" prop="脏"></el-table-column>
<el-table-column label="气泡" prop="气泡"></el-table-column>
<el-table-column label="水纹" prop="水纹"></el-table-column>
<el-table-column label="崩边" prop="崩边"></el-table-column>
<el-table-column label="棕边" prop="棕边"></el-table-column>
<el-table-column label="棕圈" prop="棕圈"></el-table-column>
<el-table-column label="划伤" prop="划伤"></el-table-column>
<el-table-column label="麻点" prop="麻点"></el-table-column>
<el-table-column label="黑圈变形" prop="黑圈变形"></el-table-column>
<el-table-column label="倒角" prop="倒角"></el-table-column>
<el-table-column label="破损" prop="破损"></el-table-column>
<el-table-column label="蓝圈" prop="蓝圈"></el-table-column>
<el-table-column label="合计" prop="不合格数"></el-table-column>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "chart",
data() {
return {
query:{
start_date:'',
end_date:'',
fw_type:'process'
},
currentDate: "",
tableData: [],
};
},
mounted() {
let that = this;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
let queryDate = year + "-" + month + "-" + day;
that.query.start_date = that.query.end_date = that.currentDate = queryDate;
this.getData();
},
methods: {
getData() {
let that = this;
let obj = {};
obj.query = that.query;
that.$API.bi.dataset.exec.req('ftestDay', obj).then((res) => {
that.tableData = res.data2.ds0;
console.log(that.tableData);
});
},
handleQuery() {
if(this.query.start_date){
this.query.end_date = this.query.start_date;
}else{
this.query.start_date = this.query.end_date = this.currentDate;
}
this.getData();
},
handleExport() {
this.exportLoading = true;
this.$XLSX("#exportDiv", "过程检验统计");
this.exportLoading = false;
},
},
};
</script>
<style scoped>
.tables {
position: absolute;
top: 4px;
right: 6px;
z-index: 10;
}
</style>

View File

@ -0,0 +1,252 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-select v-model="material__name">
<el-option
v-for="item in options"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main id="elMain">
<el-row :gutter="10" id="elCol">
<el-col :lg="12">
<el-card shadow="never">
<div id="bachart1"></div>
<!-- <scEcharts height="500px" :option="option"></scEcharts> -->
</el-card>
</el-col>
<el-col :lg="12">
<el-card shadow="never" style="position: relative">
<el-button
@click="handleExport"
class="tables"
type="primary"
>导出</el-button
>
<el-table
:data="tableData1"
id="exportDiv7"
:height="tableHeight"
>
<el-table-column type="index" width="50" />
<el-table-column
label="任务编号"
prop="number"
min-width="100px"
>
</el-table-column>
<el-table-column label="计划数" prop="count">
</el-table-column>
<el-table-column label="完成数" prop="count_ok">
</el-table-column>
<el-table-column label="完成率" prop="rate">
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
import * as echarts from "echarts";
import T from "@/components/scEcharts/echarts-theme-T.js";
echarts.registerTheme("T", T);
import scEcharts from "@/components/scEcharts";
function deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
}
export default {
name: "chart",
components: {
scEcharts,
},
data() {
return {
currentYear:'',
currentMonth:'',
start_date:'',
end_date:'',
queryDate:'',
option:{},
seriesData1:[],
seriesData2:[],
seriesData3:[],
material__name:'',
options:['白片','DDG片','一次抛','外协海富'],
basicOption: {
backgroundColor: "transparent",
title: {
text: "库存统计",
},
grid: {
top: "80px",
},
tooltip: {
trigger: "axis",
},
xAxis: {
type: "category",
data: ['库房','扫边车间','黑化车间','减薄车间','精雕车间','倒角车间','磨抛车间'],
},
yAxis: {
type: "value",
},
legend: {
top: "3",
right: "3%",
},
series: [
{
data: [0,0,0,0,0,0,0],
type: "bar",
name:'未处理',
barWidth: "15px",
},
{
data: [0,0,0,0,0,0,0],
type: "bar",
name:'处理中',
barWidth: "15px",
},
{
data: [0,0,0,0,0,0,0],
type: "bar",
name:'已处理',
barWidth: "15px",
},
],
},
};
},
mounted() {
let that = this;
that.getInmMaterial();
},
methods: {
getInmMaterial(){
let that = this;
let obj = {
name__contains:that.material__name,
page:0
};
this.$API.mtm.material.list.req(obj).then(res=>{
console.log('InmMaterial',res);
that.getWmaterial();
if(res.length>0){
res.forEach(item => {
that.seriesData3[0]+=item.count;
});
}
})
},
getWmaterial(){
let that = this;
let obj = {
material__name__contains:that.material__name,
page:0
};
this.$API.wpm.wmaterial.list.req(obj).then(res=>{
console.log('Wmaterial',res);
if(res.length>0){
res.forEach(item => {
if(item.belong_dept_name=="扫边车间"){
if(item.count_xtest==null){
seriesData3[1]+=item.count;
}else{
seriesData1[1]+=item.count;
}
}else if(item.belong_dept_name=="黑化车间"){
if(item.count_xtest==null){
seriesData3[2]+=item.count;
}else{
seriesData1[2]+=item.count;
}
}else if(item.belong_dept_name=="减薄车间"){
if(item.count_xtest==null){
seriesData3[3]+=item.count;
}else{
seriesData1[3]+=item.count;
}
}else if(item.belong_dept_name=="精雕车间"){
if(item.count_xtest==null){
seriesData3[4]+=item.count;
}else{
seriesData1[4]+=item.count;
}
}else if(item.belong_dept_name=="倒角车间"){
if(item.count_xtest==null){
seriesData3[5]+=item.count;
}else{
seriesData1[5]+=item.count;
}
}else if(item.belong_dept_name=="磨抛车间"){
if(item.count_xtest==null){
seriesData3[6]+=item.count;
}else{
seriesData1[6]+=item.count;
}
}
});
}
let option = deepCopy(that.basicOption);
that.setChart("bachart1", option);
})
},
handleQuery(){
this.getInmMaterial();
},
setChart(name, option = null) {
// name , optionoption
var myChart = echarts.getInstanceByDom(
document.getElementById(name)
);
if (myChart == undefined) {
myChart = echarts.init(document.getElementById(name), "T");
}
if (option == null) {
option = Object.assign({}, this.basicOption);
}
setTimeout(() => {
try {
myChart.setOption(option);
} catch (error) {}
}, 500);
},
},
};
</script>
<style scoped>
#bachart1{
width: 100%;
height: 500px;
}
.tables{
width:
}
.tableHead {
background:rgb(0,176,240);
height:40px;
}
.tableTh{
width:120px;
height:36px;
}
.tableTd{
width:120px;
height:36px;
}
</style>

View File

@ -0,0 +1,421 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-select v-model="queryType" @change="queryTypeChange">
<el-option
v-for="item in typeOptions"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
<el-date-picker
v-if="queryType == '月'"
v-model="queryDate"
type="month"
placeholder="查询月期"
value-format="YYYY-MM"
>
</el-date-picker>
<el-date-picker
v-if="queryType == '年'"
v-model="queryDate"
type="year"
placeholder="查询年份"
value-format="YYYY"
>
</el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main id="elMain">
<el-row :gutter="15">
<table class="tables" border="1" cellspacing="0">
<tr>
<th class="tableTh tableHead" colspan="15">库存统计</th>
</tr>
<tr>
<th class="tableTh">生产</th>
<th class="tableTh" colspan="2">库房</th>
<th class="tableTh" colspan="2">道边车间</th>
<th class="tableTh" colspan="2">黑化车间</th>
<th class="tableTh" colspan="2">减薄车间</th>
<th class="tableTh" colspan="2">精雕车间</th>
<th class="tableTh" colspan="2">倒角车间</th>
<th class="tableTh" colspan="2">磨抛车间</th>
</tr>
<tr >
<td class="tableTd">原料片库存</td>
<td class="tableTd">大白片</td>
<td class="tableTd"></td>
<td class="tableTd">未处理大白片</td>
<td class="tableTd">3</td>
<td class="tableTd">2.5D白片待进炉</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd">原料片库存</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">2.5D炉内黑化数</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd">原料片库存</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">已处理白片</td>
<td class="tableTd"></td>
<td class="tableTd">2.5D炉内退火+待投</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd" rowspan="2">DDG片</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">水纹片待进炉</td>
<td class="tableTd"></td>
<td class="tableTd">已加工</td>
<td class="tableTd"></td>
<td class="tableTd">已加工</td>
<td class="tableTd"></td>
<td class="tableTd">已加工</td>
<td class="tableTd"></td>
<td class="tableTd">精雕片已抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">未加工</td>
<td class="tableTd"></td>
<td class="tableTd">未加工</td>
<td class="tableTd"></td>
<td class="tableTd">未加工</td>
<td class="tableTd"></td>
<td class="tableTd">精雕片未抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd" rowspan="2">外协百盛一次抛黑料</td>
<td class="tableTd">外协抛光</td>
<td class="tableTd">0</td>
<td class="tableTd">外协待扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外协已抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外协已扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外协未抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd" rowspan="2">外协海富</td>
<td class="tableTd">外协扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外扫已抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外扫未抛光</td>
<td class="tableTd"></td>
</tr>
</table>
</el-row>
<el-row :gutter="15">
<table class="tables" border="1" cellspacing="0">
<tr>
<th class="tableTh tableHead" colspan="15">扫边车间数据汇总</th>
</tr>
<tr>
<th class="tableTh">扫边车间</th>
<th class="tableTh"></th>
<th class="tableTh"></th>
<th class="tableTh" colspan="4">8.20白班</th>
<th class="tableTh"></th>
<th class="tableTh" colspan="4">8.20夜班</th>
<th class="tableTh"></th>
<th class="tableTh"></th>
<th class="tableTh"></th>
</tr>
<tr >
<td class="tableTd">预处理片扫边A的产品</td>
<td class="tableTd">机器号</td>
<td class="tableTd">内置数</td>
<td class="tableTd">加工数</td>
<td class="tableTd">合格数</td>
<td class="tableTd">破损数</td>
<td class="tableTd">破损比</td>
<td class="tableTd">操作人</td>
<td class="tableTd">加工数</td>
<td class="tableTd">合格数</td>
<td class="tableTd">破损数</td>
<td class="tableTd">破损比</td>
<td class="tableTd">操作人</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
</tr>
<tr >
<td class="tableTd">原料片库存</td>
<td class="tableTd">2</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
<td class="tableTd">3</td>
</tr>
<tr >
<td class="tableTd" rowspan="2">DDG片</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
<td class="tableTd">已加工</td>
<td class="tableTd">3</td>
</tr>
<tr >
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
<td class="tableTd">未加工</td>
<td class="tableTd">3</td>
</tr>
<tr >
<td class="tableTd" rowspan="2">外协百盛一次抛黑料</td>
<td class="tableTd">外协抛光</td>
<td class="tableTd">0</td>
<td class="tableTd">外协待扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外协已抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd">外协抛光</td>
<td class="tableTd">0</td>
<td class="tableTd">外协待扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外协未抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd" rowspan="2">外协海富</td>
<td class="tableTd">外协扫边</td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外扫已抛光</td>
<td class="tableTd"></td>
</tr>
<tr >
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd"></td>
<td class="tableTd">外扫未抛光</td>
<td class="tableTd"></td>
</tr>
</table>
</el-row>
</el-main>
</el-container>
</template>
<script>
function deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
}
export default {
name: "chart",
data() {
return {
currentYear:'',
currentMonth:'',
start_date:'',
end_date:'',
queryDate:'',
};
},
mounted() {
let that = this;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let days = new Date(year, month, 0).getDate();
that.currentYear = year;
that.currentMonth = month;
that.start_date = year + "-" + month + "-01";
that.end_date =
year + "-" + month + "-" + new Date(year, month, 0).getDate();
let month1 = month;
if (month1 < 10) {
month1 = "0" + month1;
}
that.queryDate = year + "-" + month1;
},
methods: {
},
};
</script>
<style scoped>
.tables{
width:
}
.tableHead {
background:rgb(0,176,240);
height:40px;
}
.tableTh{
width:120px;
height:36px;
}
.tableTd{
width:120px;
height:36px;
}
</style>

View File

@ -0,0 +1,217 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-select v-model="mgroupId"
placeholder="请选择工段"
@change="mgroupChange">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-date-picker
v-model="searchDate"
type="month"
placeholder="查询日期"
value-format="YYYY-MM"
style="width: 160px"
>
</el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main id="elMain">
<el-row :gutter="10" id="elCol">
<el-col :lg="10">
<el-card shadow="never">
<scEcharts height="500px" :option="option"></scEcharts>
</el-card>
</el-col>
<el-col :lg="14">
<el-card shadow="never" style="position: relative">
<el-button
@click="handleExport('7')"
class="tables"
type="primary"
>导出</el-button
>
<el-table
:data="tableData1"
id="exportDiv7"
height="500px"
>
<el-table-column type="index" width="50" />
<el-table-column
label="任务编号"
prop="number"
min-width="100px"
>
</el-table-column>
<el-table-column label="计划数" prop="count">
</el-table-column>
<el-table-column label="完成数" prop="count_ok">
</el-table-column>
<el-table-column label="完成率" prop="rate">
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
import scEcharts from "@/components/scEcharts";
export default {
name: "chart",
components: {
scEcharts,
},
data() {
return {
query: {
querys:[
[{field:'start_date',compare:'gte',value:''},{field:'mgroup',compare:'',value:''}],
[{field:'end_date',compare:'lte',value:''},{field:'mgroup',compare:'',value:''}]
],
page:0
},
mgroupId:'',
start_date:'',
end_date:'',
currentDate: "",
searchDate:'',
options:[],
tableData1: [],
option: {
title: {
text: "",
},
tooltip: {
trigger: "item",
},
legend: {
top: "3",
right: "3%",
},
color: ["rgb(64,158,255)", "orange"],
series: {
name: "7车间完成率",
type: "pie",
radius: ["40%", "70%"],
center: ["50%", "60%"],
label: {
show: true,
position: "outside",
formatter: "{b} : {c} ({d}%)",
},
data: [
{ value: 0, name: "已完成" },
{ value: 0, name: "未完成" },
],
},
},
};
},
mounted() {
let that = this;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
month = month < 10 ? "0" + month : month;
that.currentDate = that.searchDate = year + "-" + month;
let days = new Date(year, month, 0).getDate();
let start_date = year + "-" + month + "-01";
let end_date = year + "-" + month + "-"+days;
that.start_date = that.query.querys[0][0].value = start_date;
that.end_date = that.query.querys[1][0].value = end_date;
let height = document.getElementById("elCol").clientHeight;
let chartheight = height+'px';
that.tableHeight = height-20;
that.getMgroup();
},
methods: {
getMgroup(){
let that = this;
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
that.options = res;
});
},
getData() {
let that = this;
that.tableData1 = [];
that.option.series.data[0].value = 0;
that.option.series.data[1].value = 0;
that.$API.pm.mtask.cquery.req(that.query).then((res) => {
let data = [];
let count_ok1 = 0;
let count_notok1 = 0;
if (res.length > 0) {
res.forEach((item) => {
let obj = item;
obj.rate = Math.round((item.count_ok / item.count) * 100).toFixed(2) + "%";
if (item.count_ok >= item.count) {
count_ok1++;
} else {
count_notok1++;
}
data.push(obj);
});
that.tableData1 = data;
}
that.option.series.data[0].value = count_ok1;
that.option.series.data[1].value = count_notok1;
});
},
mgroupChange(){
let that = this;
that.query.querys[0][1].value = that.mgroupId;
that.query.querys[1][1].value = that.mgroupId;
},
handleQuery(){
let that = this;
if(this.searchDate!==''&&this.searchDate!==null){
let dates = this.searchDate.split('-');
let year = dates[0];
let month = dates[1];
let days = new Date(year, month, 0).getDate();
let start_date = year + "-" + month + "-01";
let end_date = year + "-" + month + "-"+days;
that.query.querys[0][0].value = start_date;
that.query.querys[1][0].value = end_date;
}else{
that.query.querys[0][0].value = that.start_date;
that.query.querys[1][0].value = that.end_date;
}
that.getData();
},
handleExport(val) {
this.exportLoading = true;
let id = "#exportDiv" + val;
let name = val + "车间完成率";
this.$XLSX(id, name);
this.exportLoading = false;
},
},
};
</script>
<style scoped>
#elCol{
height:100%;
}
.tables {
position: absolute;
top: 6px;
left: 4px;
z-index: 10;
}
</style>

View File

@ -1,11 +1,16 @@
<template>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
></el-button>
<el-divider></el-divider>
<scTable
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
@ -13,7 +18,6 @@
:params="params"
hidePagination
hideDo
style="height: 400px"
@row-click="rowClick"
>
<el-table-column label="类型" prop="name" width="80">
@ -26,7 +30,7 @@
prop="name"
min-width="100"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="80">
<el-table-column label="操作" align="center" width="80">
<template #default="scope">
<el-popconfirm
title="确定删除吗?"
@ -46,7 +50,8 @@
</template>
</el-table-column>
</scTable>
<el-dialog title="创建/编辑" v-model="dialogVisible" width="80%">
</el-main>
<el-dialog title="创建/编辑" v-model="dialogVisible" width="80%">
<el-form :model="saveForm" label-width="100px" ref="saveForm">
<el-form-item label="策略类型" required>
<el-select v-model="saveForm.type">
@ -126,6 +131,7 @@
>
</template>
</el-dialog>
</el-container>
</template>
<script>
import { scheduleTypeEnum, schedulePeriodEnum } from "@/utils/enum.js";

View File

@ -158,7 +158,7 @@ export default {
} else if (cateType.indexOf("opl_") != -1) {
projectId = row.ticket_data.opl;
cateType = "opl";
} else if (cateType == "routepack") {
} else if (cateType == "routepack"||cateType == "backfire") {
projectId = row.ticket_data.t_id;
}
this.$router.push({

View File

@ -168,6 +168,7 @@
</el-card>
<el-card
style="margin-top: 4px; position: relative"
v-if="cateType === 'routepack'"
header="工艺流程"
>
<el-table
@ -599,6 +600,8 @@ export default {
this.getRpj();
} else if (this.cateType === "routepack") {
this.getRoutePack();
} else if (this.cateType === "backfire") {
// 退
} else {
this.getOpl();
}

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -1,16 +1,21 @@
<template>
<el-main>
<el-card>
<div id="main" style="width: 1200px; height: 500px"></div>
<div
id="mains"
style="
width: 1200px;
height: 500px;
position: absolute;
top: 155px;
"
></div>
<div>
<div id="title"
style="width: 850px;padding-left:10px; height: 50px;background-color: rgb(204,51,0);color:white;font-size: 30px;line-height: 50px">
Decarbonization Roadmap of Cement Industry in China
</div>
<div id="title"
style="width: 850px;padding-left:10px; height: 50px;background-color: rgb(204,51,0);color:white;font-size: 30px;line-height: 50px">
when low carbon cement technology breakthroughs
</div>
<!-- 柱状图 -->
<div id="main" style="width: 1200px; height: 600px;border: 4px solid rgb(204,51,0)"></div>
<!-- 折线图 155 / 205-->
<div id="mains" style="width: 1200px;height: 600px;position: absolute;top: 205px;"></div>
</div>
</el-card>
</el-main>
</template>
@ -19,15 +24,22 @@
import * as echarts from "echarts";
const updateFrequency = 2000;
const dimension = 0;
// const countryColors = {
// : "rgb(244,192,0)",
// : "rgb(242,119,36)",
// : "rgb(103,169,59)",
// : "rgb(77,148,211)",
// : "rgb(159,159,159)",
// : "rgb(84,112,198)",
// };
const countryColors = {
水泥碳排放: "rgb(244,192,0)",
石膏板排放: "rgb(242,119,36)",
建筑卫生陶瓷排放: "rgb(103,169,59)",
玻璃排放: "rgb(77,148,211)",
玻纤排放: "rgb(159,159,159)",
墙体材料: "rgb(84,112,198)",
'Low carbon cement': "rgb(244,192,0)",
'Alternative Fuel': "rgb(242,119,36)",
'Clean Energy Electricity': "rgb(103,169,59)",
'Energy Efficiencylmprovement Technology': "rgb(77,148,211)",
'CCUS': "rgb(159,159,159)",
};
const years = [2022, 2025, 2030, 2040, 2050, 2060];
const years = [2021, 2025, 2030, 2040, 2050, 2060];
export default {
name: "chart",
data() {
@ -39,61 +51,94 @@ export default {
var myChart = echarts.init(chartDom);
var option;
let startIndex = 0;
let data1 = [
["Income", "Life Expectancy", "Population", "Country", "Year"],
[0, 34.05, 0, "Low carbon cement", 2021],
[0, 39, 0, "Alternative Fuel", 2021],
[0, 32, 0, "Clean Energy Electricity", 2021],
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
[0, 36.57, 0, "CCUS", 2021],
[6, 34.05, 6, "Low carbon cement", 2025],
[14, 39, 14, "Alternative Fuel", 2025],
[6, 32, 6, "Clean Energy Electricity", 2025],
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
[4, 36.5, 4, "CCUS", 2025],
[33, 34.05, 33, "Low carbon cement", 2030],
[26, 39, 26, "Alternative Fuel", 2030],
[10, 32, 10, "Clean Energy Electricity", 2030],
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
[9, 36.57, 9, "CCUS", 2030],
[78, 34.05, 78, "Low carbon cement", 2040],
[68, 39, 68, "Alternative Fuel", 2040],
[17, 32, 17, "Clean Energy Electricity", 2040],
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
[19, 36.57, 19, "CCUS", 2040],
[118, 34.05, 118, "Low carbon cement", 2050],
[111, 39, 111, "Alternative Fuel", 2050],
[23, 32, 23, "Clean Energy Electricity", 2050],
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
[57, 36.57, 57, "CCUS", 2050],
[118, 34.05, 118, "Low carbon cement", 2060],
[177, 39, 117, "Alternative Fuel", 2060],
[26, 32, 26, "Clean Energy Electricity", 2060],
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
[254, 36.57, 254, "CCUS", 2060],
];
let data = [
["Income", "Life Expectancy", "Population", "Country", "Year"],
[12.09, 34.05, 0, "水泥碳排放", 2022],
[1.31, 39, 0, "石膏板排放", 2022],
[1.45, 32, 0, "建筑卫生陶瓷排放", 2022],
[0.36, 32.2, 0, "玻璃排放", 2022],
[0.12, 36.57, 0, "玻纤排放", 2022],
[0.25, 36.57, 0, "墙体材料", 2022],
[0, 34.05, 0, "Low carbon cement", 2021],
[0, 39, 0, "Alternative Fuel", 2021],
[0, 32, 0, "Clean Energy Electricity", 2021],
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
[0, 36.57, 0, "CCUS", 2021],
[11.61, 34.05, 6, "水泥碳排放", 2025],
[1.06, 39, 14, "石膏板排放", 2025],
[1.16, 32, 6, "建筑卫生陶瓷排放", 2025],
[0.31, 32.2, 8, "玻璃排放", 2025],
[0.1, 36.5, 4, "玻纤排放", 2025],
[0.23, 36.57, 0, "墙体材料", 2025],
[6, 34.05, 6, "Low carbon cement", 2025],
[14, 39, 14, "Alternative Fuel", 2025],
[6, 32, 6, "Clean Energy Electricity", 2025],
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
[3, 36.5, 4, "CCUS", 2025],
[9.32, 34.05, 33, "水泥碳排放", 2030],
[0.88, 39, 26, "石膏板排放", 2030],
[0.95, 32, 10, "建筑卫生陶瓷排放", 2030],
[0.27, 32.2, 18, "玻璃排放", 2030],
[0.08, 36.57, 9, "玻纤排放", 2030],
[0.19, 36.57, 9, "墙体材料", 2030],
[33, 34.05, 33, "Low carbon cement", 2030],
[26, 39, 26, "Alternative Fuel", 2030],
[10, 32, 10, "Clean Energy Electricity", 2030],
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
[7, 36.57, 9, "CCUS", 2030],
[4.61, 34.05, 78, "水泥碳排放", 2040],
[0.63, 39, 68, "石膏板排放", 2040],
[0.68, 32, 17, "建筑卫生陶瓷排放", 2040],
[0.22, 32.2, 18, "玻璃排放", 2040],
[0.06, 36.57, 19, "玻纤排放", 2040],
[0.10, 36.57, 19, "墙体材料", 2040],
[118, 34.05, 78, "Low carbon cement", 2040],
[68, 39, 68, "Alternative Fuel", 2040],
[17, 32, 17, "Clean Energy Electricity", 2040],
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
[14, 36.57, 19, "CCUS", 2040],
[2.65, 34.05, 118, "水泥碳排放", 2050],
[0.26, 39, 111, "石膏板排放", 2050],
[0.27, 32, 23, "建筑卫生陶瓷排放", 2050],
[0.14, 32.2, 16, "玻璃排放", 2050],
[0.035, 36.57, 57, "玻纤排放", 2050],
[0.055, 36.57, 57, "墙体材料", 2050],
[157, 34.05, 118, "Low carbon cement", 2050],
[111, 39, 111, "Alternative Fuel", 2050],
[23, 32, 23, "Clean Energy Electricity", 2050],
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
[41, 36.57, 57, "CCUS", 2050],
[1.94, 34.05, 118, "水泥碳排放", 2060],
[0.04, 39, 117, "石膏板排放", 2060],
[0.0008, 32, 26, "建筑卫生陶瓷排放", 2060],
[0.09, 32.2, 16, "玻璃排放", 2060],
[0.022, 36.57, 254, "玻纤排放", 2060],
[0.034, 36.57, 254, "墙体材料", 2060],
[196, 34.05, 118, "Low carbon cement", 2060],
[177, 39, 117, "Alternative Fuel", 2060],
[26, 32, 26, "Clean Energy Electricity", 2060],
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
[184, 36.57, 254, "CCUS", 2060],
];
let startYear = years[startIndex];
option = {
grid: {
top: 50,
bottom: 30,
left: 150,
left: 300,
right: 80,
},
xAxis: {
max: "13",
min: "0.0008",
max: "dataMax",
// max: "13",
// min: "0.0008",
position: "top",
axisLabel: {
// show: false,
@ -186,38 +231,47 @@ export default {
myChart.setOption(option);
}
//线
let countries = ["建材行业碳排放总量"];
let countries = ["CementCO:Emissions"];
let datasetWithFilters = [];
let seriesList = [];
let _rawData1 = [
["Income", "Country", "Year"],
[575, "CementCO:Emissions", 2021],
[558, "CementCO:Emissions", 2025],
[520, "CementCO:Emissions", 2030],
[420, "CementCO:Emissions", 2040],
[296, "CementCO:Emissions", 2050],
[31, "CementCO:Emissions", 2060],
];
let _rawData = [
["Income", "Country", "Year"],
[15.6, "建材行业碳排放总量", 2022],
[14.2, "建材行业碳排放总量", 2025],
[11.1, "建材行业碳排放总量", 2030],
[5.7, "建材行业碳排放总量", 2040],
[2.4, "建材行业碳排放总量", 2050],
[0.1, "建材行业碳排放总量", 2060],
[575, "CementCO:Emissions", 2021],
[559, "CementCO:Emissions", 2025],
[523, "CementCO:Emissions", 2030],
[386, "CementCO:Emissions", 2040],
[272, "CementCO:Emissions", 2050],
[23, "CementCO:Emissions", 2060],
];
var chartDoms = document.getElementById("mains");
var myCharts = echarts.init(chartDoms);
datasetWithFilters.push({
id: "dataset_建材行业碳排放总量",
id: "dataset_CementCO:Emissions",
fromDatasetId: "dataset_raw",
transform: {
type: "filter",
config: {
and: [
{ dimension: "Year", gte: 1950 },
{ dimension: "Country", "=": "建材行业碳排放总量" },
{ dimension: "Country", "=": "CementCO:Emissions" },
],
},
},
});
seriesList.push({
type: "line",
datasetId: "dataset_建材行业碳排放总量",
datasetId: "dataset_CementCO:Emissions",
showSymbol: false,
name: "建材行业碳排放总量",
name: "CementCO:Emissions",
endLabel: {
show: true,
formatter: function (params) {
@ -276,7 +330,8 @@ export default {
name: "",
},
grid: {
left: 140,
top:70,
left: 300,
},
series: seriesList,
};

View File

@ -0,0 +1,107 @@
<template>
<el-drawer
v-model="visible"
title="检验记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-main>
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<!-- <el-table-column type="index" width="50" /> -->
<el-table-column label="检验类型">
<template #default="scope">
<el-tag v-if="scope.row.type2 == 10">
{{ type2_[scope.row.type2] }}
</el-tag>
<el-tag v-else type="success">
{{ type2_[scope.row.type2] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="总数" prop="count">
</el-table-column>
<el-table-column label="检验数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling }}</span>
<span v-else>{{ scope.row.count }}</span>
</template>
</el-table-column>
<el-table-column label="合格数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok }}</span>
<span v-else>{{ scope.row.count_ok }}</span>
</template>
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="合格率">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*100 }}%</span>
<span v-else>{{ scope.row.count_ok/scope.row.count*100 }}%</span>
</template>
</el-table-column>
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-button
link
type="primary"
v-auth="'ftestwork.update'"
@click="table_del(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
wm: { type: String, default: "" },
},
data() {
return {
visible: false,
apiObj: null,
paramsObj: {},
form: {},
type2_: {
10: "抽检",
20: "全检",
},
isSaveing: false,
};
},
mounted() {},
methods: {
open() {
this.visible = true;
this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list;
return this;
},
table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch();
});
},
},
};
</script>

View File

@ -16,26 +16,26 @@
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="batch">
<el-form-item label="检验类型">
<el-select
v-model="form.batch"
placeholder="物料批次"
clearable
v-model="form.type2"
placeholder="检验类型"
style="width: 100%"
@change="handleChange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.batch"
:value="item.id"
>
<span>{{item.batch}}</span>
<span style="float:right">({{item.count}})</span>
</el-option>
<el-option
v-for="item in typeOption"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="batch">
<el-input v-model="form.batch" disabled></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="总数">
<el-input
@ -44,34 +44,44 @@
></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-col :md="12" :sm="24" v-if="form.type2==20">
<el-form-item label="检验数量">
<el-input-number
:max="batchCount"
controls-position="right"
v-model="form.count"
style="width: 100%"
precision="0"
@change="handleCheckChange"
@change="handleCountNotokChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-col :md="12" :sm="24" v-if="form.type2==20">
<el-form-item label="合格数量">
<el-input v-model="form.count_ok" disabled></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type2==10">
<el-form-item label="抽检数量">
<el-input-number
:max="batchCount"
controls-position="right"
v-model="form.count_sampling"
style="width: 100%"
precision="0"
@change="handleCheckChange"
@change="handleCountNotokChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格数量">
<el-input
v-model="form.count_ok"
<el-col :md="12" :sm="24" v-if="form.type2==10">
<el-form-item label="抽检合格数">
<el-input-number
controls-position="right"
v-model="form.count_sampling_ok"
style="width: 100%"
disabled
></el-input>
precision="0"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
@ -85,6 +95,16 @@
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格率">
<el-input-number
controls-position="right"
v-model="count_ok_rate"
style="width: 100%"
precision="0"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
@ -123,7 +143,6 @@
v-model="count_notok_json.count_n_hd"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -135,7 +154,6 @@
v-model="count_notok_json.count_n_wj"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -147,7 +165,6 @@
v-model="count_notok_json.count_n_yd"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -159,7 +176,6 @@
v-model="count_notok_json.count_n_txd"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -171,7 +187,6 @@
v-model="count_notok_json.count_n_qp"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -183,7 +198,6 @@
v-model="count_notok_json.count_n_swen"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -195,12 +209,21 @@
v-model="count_notok_json.count_n_bb"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_xbb"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
@ -208,7 +231,6 @@
v-model="count_notok_json.count_n_hs"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -220,7 +242,6 @@
v-model="count_notok_json.count_n_md"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -233,7 +254,17 @@
v-model="count_notok_json.count_n_ps"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
controls-position="right"
v-model="count_notok_json.count_n_qt"
style="width: 100%"
precision="0"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -243,7 +274,7 @@
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button>
>提交</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
@ -273,10 +304,12 @@ export default {
test_date: "",
batch: "",
count: null,
count_ok: null,
count_ok: 0,
count_sampling_ok:'',
count_notok: 0,
count_notok_json:{}
},
count_ok_rate:100,
count_notok_json:{
//
count_n_wj: 0,
@ -289,32 +322,27 @@ export default {
count_n_hs: 0,
count_n_md: 0,
count_n_bb:0,
count_n_xbb:0,
count_n_ps: 0,
count_n_qt:0,
},
rules: {
test_date: [
{
required: true,
message: "请选择检验日期",
trigger: "blur",
},
],
batch: [
{
required: true,
message: "请选择物料批次",
trigger: "blur",
},
],
test_date: [{required: true,message: "请选择检验日期",trigger: "blur"}],
batch: [{required: true,message: "请选择物料批次",trigger: "blur"}],
test_user: [{required: true,message: "请选择物料批次",trigger: "blur"}],
},
options: [],
userList : [],
typeOption:[
{name:'全检',value:20},
{name:'抽检',value:10},
],
selectionFilters: [],
batchCount:null,
formCount:null,
visible: false,
supplier:null,
isSaveing: false,
options: [],
userList : [],
selectionFilters: [],
setFiltersVisible: false,
};
},
@ -323,6 +351,7 @@ export default {
this.form.batch = this.itemObj.batch;
this.form.wm = this.itemObj.id;
this.form.count = this.itemObj.count;
this.form.supplier = this.itemObj.supplier;
this.deptID = this.$TOOL.data.get('gx_deptID');
this.getUsers();
},
@ -351,9 +380,6 @@ export default {
});
});
},
handleCheckChange(){
this.form.count_ok = this.form.count-this.form.count_notok;
},
handleCountChange(type){
this.form.count_notok =
this.count_notok_json.count_n_wj+
@ -364,12 +390,20 @@ export default {
this.count_notok_json.count_n_swen+
this.count_notok_json.count_n_hs+
this.count_notok_json.count_n_bb+
this.count_notok_json.count_n_xbb+
this.count_notok_json.count_n_md+
this.count_notok_json.count_n_ps;
this.form.count_ok = this.form.count - this.form.count_notok;
this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_qt;
this.handleCountNotokChange();
},
handleCountNotokChange(){
this.form.count_ok = this.form.count - this.form.count_notok;
if(this.form.type2==10){//
this.form.count_sampling_ok = this.form.count_sampling - this.form.count_notok;
this.count_ok_rate = ((this.form.count_sampling_ok/this.form.count_sampling)*100).toFixed(2);
}else if(this.form.type2==20){//
this.form.count_ok = this.form.count - this.form.count_notok;
this.count_ok_rate = ((this.form.count_ok/this.form.count)*100).toFixed(2);
}
},
//
getMaterialBatch() {
@ -398,17 +432,28 @@ export default {
this.count_notok_json.count_n_swen+
this.count_notok_json.count_n_hs+
this.count_notok_json.count_n_bb+
this.count_notok_json.count_n_xbb+
this.count_notok_json.count_n_md+
this.count_notok_json.count_n_ps;
if(count_notok>this.form.count_notok){
this.$notify.error("不合格数量有问题");
this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_qt;
if(count_notok>that.form.count_notok){
that.$notify.error("不合格数量有问题");
that.isSaveing = false;
}else{
if(count_notok<this.form.count_notok){
that.count_notok_json.count_n_qt = this.form.count_notok-count_notok;
if(count_notok<that.form.count_notok){
that.count_notok_json.count_n_qt = that.form.count_notok-count_notok;
}
if(that.supplier!== null&&that.form.type2==10){
that.form.need_update_wm = false;
}
// that.form.count_ok = that.form.count-that.form.count_notok;
if(that.form.type2==10){//
that.form.count_sampling_ok = that.form.count_sampling - that.form.count_notok;
}else{//
that.form.count_ok = that.form.count - that.form.count_notok;
}
that.form.count_ok = this.form.count-this.form.count_notok;
that.form.count_notok_json = that.count_notok_json;
console.log('that.form',that.form)
that.$API.qm.ftestwork.create.req(that.form)
.then((res) => {
that.$API.qm.ftestwork.submit.req(res.id)

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -0,0 +1,547 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-position="right"
label-width="100px"
style="padding: 0 10px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
class="width100"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="个人任务">
<el-select
v-model="form.mtaskb"
placeholder="个人任务"
clearable
filterable
class="width100"
>
<el-option
v-for="item in mtaskbOtions"
:key="item.id"
:label="item.handle_user_name"
:value="item.id"
>
<span style="float:left">{{item.handle_user_name}}</span>
<span style="float:right">{{item.count}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="开始时间" prop="work_start_time">
<el-date-picker
v-model="form.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
class="width100"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
class="width100"
:disabledDate="disabledDateFn"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
filterable
class="width100"
>
<el-option
v-for="item in shiftOtions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号" prop="wm_in">
<el-select
v-model="form.wm_in"
placeholder="交接物料"
clearable
class="width100"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
<div
style="
display: flex;
justify-content: space-between;
"
>
<span style="flex:1;margin-right:15px!important;">{{ item.batch }}</span>
<span style="flex:1;">{{ item.count }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="领用数量">
<el-input-number
v-model="form.count_use"
:min="1"
controls-position="right"
class="width100"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
<el-input-number
v-model="form.count_pn_jgqbl"
:min="0"
class="width100"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="实际生产数">
<el-input-number
v-model="form.count_real"
:min="0"
class="width100"
controls-position="right"
@change="countChanges"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格数量">
<el-input-number
v-model="form.count_ok"
:min="0"
class="width100"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="不合格数量">
<el-input-number
v-model="form.count_notok"
:min="0"
class="width100"
@change="countChanges"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input
v-model="form.note"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
v-model="form.count_n_hs"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
v-model="form.count_n_qp"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="水纹">
<el-input-number
v-model="form.count_n_swen"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="崩边">
<el-input-number
v-model="form.count_n_bb"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="雾面">
<el-input-number
v-model="form.count_n_wm"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
v-model="form.count_n_xbb"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
v-model="form.count_n_md"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="线痕">
<el-input-number
v-model="form.count_n_xh"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="破损">
<el-input-number
v-model="form.count_n_ps"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
v-model="form.count_n_zq"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
v-model="form.count_n_qt"
:min="0"
class="width100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
const defaultForm = {
batch: null,
equipment: null,
mtaskb: null,
shift: null,
wm_in: null,
fmlog:null,
work_start_time:'',
work_end_time:'',
material_out:'',
count_pn_jgqbl:0,
count_use:0,
count_real: 0,
count_ok: 0,
count_notok: 0,
count_n_hs: 0,
count_n_qp: 0,
count_n_swen: 0,
count_n_bb: 0,
count_n_xbb:0,
count_n_md: 0,
count_n_xh: 0,
count_n_ps: 0,
count_n_qt: 0,
count_n_wm: 0,
count_n_zq:0,
note:''
};
export default {
props: {
fmlog: {
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
},
mtask: {
type: String,
default: "",
},
},
computed: {
title() {
return this.titleMap[this.mode];
},
},
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增日志",
edit: "编辑日志",
show: "查看日志",
},
//
form: Object.assign({}, defaultForm),
//
rules: {
work_start_time: [{required: true,message: "请选择生产开始时间",trigger: "blur",},],
work_end_time:[{required: true,message: "请选择生产开始时间",trigger: "blur",},],
route: [{required: true,message: "请选择工艺路线",trigger: "blur",},]
},
material_in:'',
material_out:'',
shiftOtions:[],
mtaskbOtions:[],
visible: false,
isSaveing: false,
options: [],
routeOptions: [],
supplierOptions: [],
materialOptions:[],
setFiltersVisible: false,
};
},
mounted() {
this.getShift();
this.getMgroup();
this.getMtask();
this.getMtaskb();
console.log('this.fmlog',this.fmlog)
this.form.fmlog = this.fmlog;
console.log('this.form.fmlog',this.form.fmlog)
},
methods: {
disabledDateFn(time) {
return time.getTime() > new Date().getTime();
},
getShift(){
let that = this;
that.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
that.shiftOtions = res;
});
},
getMgroup(){
let that = this;
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.deptId = res.belong_dept;
that.process = res.process;
that.getEquipment();
});
},
getEquipment() {
let that = this;
that.options = [];
that.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup }).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
getMtask() {
let that = this;
that.$API.pm.mtask.item.req(that.mtask).then(res=>{
that.material_in = res.material_in;
that.material_out = that.form.material_out = res.material_out;
that.getMaterial();
});
},
getMtaskb() {
let that = this;
that.$API.pm.mtaskb.list.req({ page: 0, mtask:that.mtask }).then((res) => {
that.mtaskbOtions = res;
});
},
//
getMaterial() {
let that = this;
that.$API.wpm.wmaterial.list.req({mgroupx: that.mgroup,material: that.material_in,page: 0,}).then((res) => {
that.materialOptions = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
console.log("data", data);
Object.assign(this.form, data);
},
countChange() {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_xbb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_ps +
this.form.count_n_zq +
this.form.count_n_qt +
this.form.count_n_wm;
this.form.count_ok = this.form.count_real - this.form.count_notok;
},
countChanges(){
this.form.count_ok = this.form.count_real - this.form.count_notok;
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.form.mgroup = that.mgroup;
if (that.mode === "add") {
that.$API.wpm.mlog.create.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
} else {
let obj = {};
obj.work_end_time = that.form.work_end_time;
obj.handle_user = that.form.handle_user;
obj.note = that.form.note;
that.$API.wpm.mlog.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
}
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
.form_unit {
position: absolute;
right: -25px;
}
.width100{
width: 100%;
}
</style>

View File

@ -0,0 +1,312 @@
<template>
<el-drawer
title="日志详情"
v-model="visible"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-header style="height:100px;padding:0">
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
fmlogItem.routepack_name
}}</el-descriptions-item>
<el-descriptions-item label="任务编号">{{
fmlogItem.mtask_number
}}</el-descriptions-item>
<el-descriptions-item label="部门/车间">{{
fmlogItem.belong_dept_name
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<!-- mlog -->
<el-main style="padding-top: 40px;position: relative;">
<el-button
type="primary"
style="position: absolute;top: 5px;"
v-if="fmlogItem.submit_time == null"
icon="el-icon-plus"
@click="table_add"
>新增</el-button
>
<scTable
stripe
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params"
:query="params"
@row-click="table_detail"
>
<el-table-column type="index" width="50"></el-table-column>
<el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<el-descriptions :column="2">
<template v-for="item in props.row.mlogb_full" :key="item.id">
<el-descriptions-item :label="item.material_out!==null?'输出物料':'输入物料'">
<span v-if="item.material_out!==null">{{item.batch}}</span>
<span v-else>{{item.batch}}</span>
</el-descriptions-item>
</template>
</el-descriptions>
<el-divider></el-divider>
<el-descriptions :column="4">
<el-descriptions-item label="划伤" v-if="props.row.count_n_hs>0">
{{props.row.count_n_hs}}
</el-descriptions-item>
<el-descriptions-item label="气泡" v-if="props.row.count_n_qp>0">
{{props.row.count_n_qp}}
</el-descriptions-item>
<el-descriptions-item label="水纹" v-if="props.row.count_n_swen>0">
{{props.row.count_n_swen}}
</el-descriptions-item>
<el-descriptions-item label="崩边" v-if="props.row.count_n_bb>0">
{{props.row.count_n_bb}}
</el-descriptions-item>
<el-descriptions-item label="小崩边" v-if="props.row.count_n_xbb>0">
{{props.row.count_n_xbb}}
</el-descriptions-item>
<el-descriptions-item label="雾面" v-if="props.row.count_n_wm>0">
{{props.row.count_n_wm}}
</el-descriptions-item>
<el-descriptions-item label="麻点" v-if="props.row.count_n_md>0">
{{props.row.count_n_md}}
</el-descriptions-item>
<el-descriptions-item label="线痕" v-if="props.row.count_n_xh>0">
{{props.row.count_n_xh}}
</el-descriptions-item>
<el-descriptions-item label="破损" v-if="props.row.count_n_ps>0">
{{props.row.count_n_ps}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
</el-table-column>
<el-table-column label="操作员" prop="handle_user_name" min-width="80"></el-table-column>
<el-table-column label="设备" prop="equipment_name" min-width="150"></el-table-column>
<el-table-column label="领料数" prop="count_use"></el-table-column>
<el-table-column label="加工数" prop="count_real"></el-table-column>
<el-table-column label="加工前不良" prop="count_pn_jgqbl"></el-table-column>
<el-table-column label="合格数" prop="count_ok"></el-table-column>
<el-table-column label="不合格数" prop="count_notok"></el-table-column>
<el-table-column label="开始时间" prop="work_start_time"></el-table-column>
<el-table-column label="结束时间" prop="work_end_time"></el-table-column>
<el-table-column label="班次" prop="shift_name"></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100"
>
<template #default="scope">
<el-button link size="small" v-auth="'mlog.update'"
v-if="scope.row.submit_time == null" type="primary"
@click.stop="table_edit(scope.row)"
>编辑
</el-button>
<el-button link size="small" v-auth="'mlog.submit'"
v-if="scope.row.submit_time == null" type="primary"
@click.stop="mlogSubmit(scope.row)"
>提交
</el-button>
<el-button link size="small" v-auth="'mlog.delete'" type="danger"
v-if="scope.row.submit_time == null"
@click.stop="table_del(scope.row)"
>删除
</el-button>
<el-button link v-else size="small" type="danger"
@click.stop="mlogRevert(scope.row)"
>撤回
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:fmlog="params.fmlog"
:mgroup="mgroup"
:mtask="mtask"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<check-dialog
v-if="dialog.check"
ref="checkDialog"
@success="handleCheckSuccess"
@closed="dialog.check = false"
>
</check-dialog>
</el-container>
</el-drawer>
</template>
<script>
import saveDialog from "./f_mlogs_form.vue";
import checkDialog from "./mlogb_check.vue";
export default {
props: {
fmlogId: {
type: String,
default: "",
},
},
components: {
saveDialog,
checkDialog,
},
emits: ["success", "closed"],
data() {
return {
loading: false,
//
form: {},
dialog: {
save: false,
edit: false,
check: false,
},
apiObj: null,
params: {
page: 0,
fmlog: "",
},
mgroup: "",
fmlogItem: {},
saveInForm: {
count_use: 0,
count_pn_jgqbl: 0,
},
oinfo_json:{
退火炉号:'',
退火时间:'',
退火温度:'',
抽检结果:'',
抽检数:'',
强度落球:'',
},
fileList:[],
test_file:'',
deptId: "",
visible: false,
isSaveing: false,
options: [],
saveInDialog: false,
ticketDialog:false,
setFiltersVisible: false,
rules: {
count_use: [
{
required: true,
message: "请输入领取数量",
trigger: "blur",
},
],
},
};
},
mounted() {
this.getfmlogItem();
this.params.fmlog = this.fmlogId;
console.log('this.params.fmlog',this.params.fmlog);
this.apiObj = this.$API.wpm.mlog.list;
},
methods: {
open() {
this.visible = true;
},
getfmlogItem() {
let that = this;
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
that.fmlogItem = res;
that.mgroup = res.mgroup;
that.mtask = res.mtask;
});
},
//
setData(data) {
Object.assign(this.form, data);
this.getRoute(data.id);
},
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('add');
});
},
table_edit(row){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row);
});
},
//
mlogSubmit(row) {
let that = this;
that.isSaveing = true;
that.$API.wpm.mlog.submit.req(row.id).then((res) => {
that.isSaveing = false;
this.$refs.table.refresh();
that.$message.success("操作成功");
});
},
//
mlogRevert(row) {
this.$confirm(`确定撤回该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.revert.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("撤回成功");
}
});
});
},
//
table_del(row) {
let that = this;
this.$confirm(`确定删除该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功");
}
});
});
},
handleSaveSuccess() {
this.$refs.table.refresh();
},
handleCheckSuccess() {
this.$refs.table.refresh();
},
fileUPSuccess(res) {
console.log('res',res);
this.test_file = res.id;
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

View File

@ -0,0 +1,232 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-position="right"
label-width="80px"
style="padding: 0 10px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="工艺路线" prop="route">
<el-select
v-model="form.route"
placeholder="工艺路线"
clearable
filterable
style="width: 100%"
:disabled="mode == 'edit'"
>
<el-option
v-for="item in routeOptions"
:key="item.id"
:label="item.routepack_name"
:value="item.id"
>
<span
>{{ item.routepack_name }}-{{
item.process_name
}}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="关联任务">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
<!-- <span>{{ item.material_out_name }}</span>/ -->
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input
v-model="form.note"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
const defaultForm = {
route: "",
mtask:"",
mgroup:"",
note:'',
};
export default {
props: {
process: {
type: String,
default: "",
},
mgroupName:{
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
},
dept: {
type: String,
default: "",
},
},
computed: {
title() {
return this.titleMap[this.mode];
},
},
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增日志",
edit: "编辑日志",
show: "查看日志",
},
//
form: Object.assign({}, defaultForm),
//
rules: {
route: [
{
required: true,
message: "请选择工艺路线",
trigger: "blur",
},
],
},
visible: false,
isSaveing: false,
options: [],
routeOptions: [],
setFiltersVisible: false,
};
},
mounted() {
this.$nextTick(() => {
this.getRoute();
this.getMtask();
})
},
methods: {
disabledDateFn(time) {
return time.getTime() > new Date().getTime();
},
getMtask() {
let that = this;
this.$API.pm.mtask.list
.req({ page: 0, mgroup: that.mgroup, state: 20 })
.then((res) => {
that.options = res;
});
},
getRoute(id) {
let that = this;
that.$API.mtm.route.list
.req({ process: that.process, page: 0, routepack__state: 30 })
.then((res) => {
that.routeOptions = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
console.log("data", data);
Object.assign(this.form, data);
this.getRoute(data.id);
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
if (that.mode === "add") {
that.form.mgroup = that.mgroup;
that.$API.wpm.fmlog.create.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
} else {
that.$API.wpm.fmlog.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
}
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
.form_unit {
position: absolute;
right: -25px;
}
</style>

215
src/views/wpm_gx/fmlogs.vue Normal file
View File

@ -0,0 +1,215 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'mlog.create'"
>新增</el-button
>
</div>
<div class="right-panel">
<el-input
style="margin-right: 5px"
v-model="query.search"
placeholder="名称"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
:params="params"
:query="params"
@row-click="table_detail"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="工艺路线" prop="routepack_name">
</el-table-column>
<el-table-column label="任务编号" prop="mtask_number">
</el-table-column>
<el-table-column label="部门/工段" prop="belong_dept_name">
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="备注" prop="note"></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="150"
>
<template #default="scope">
<el-button
link
size="small"
v-auth="'mlog.update'"
v-if="scope.row.submit_time == null"
type="primary"
@click.stop="table_edit(scope.row)"
>编辑</el-button
>
<el-button
link
size="small"
@click="table_detail(scope.row)"
type="primary"
>详情</el-button
>
<el-button
link
size="small"
v-auth="'mlog.delete'"
type="danger"
v-if="scope.row.submit_time == null"
@click.stop="table_del(scope.row, scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</scTable>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:process="processId"
:mgroup="mgroupId"
:dept="deptId"
:mgroupName = "mgroupName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<detail-drawer
v-if="dialog.detail"
ref="detailDialog"
:fmlogId="fmlogId"
@closed="detailClose"
>
</detail-drawer>
</el-container>
</template>
<script>
import saveDialog from "./fmlog_form.vue";
import detailDrawer from "./fmlog_detail.vue";
export default {
props: {
mgroupName: {
type: String,
default: "",
},
},
name: "mlog",
components: {
saveDialog,
detailDrawer,
},
data() {
return {
apiObj: null,
params: { mgroup: "" },
query: {},
dialog: {
save: false,
detail: false,
},
tableData: [],
selection: [],
mtask: "",
mlogId: "",
deptId: null,
processId: "",
processCate: "",
};
},
mounted() {
let that = this;
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
if (res.length < 1) {
that.$message.error("获取工段错误");
return;
}
that.mgroupId = res[0].id;
that.deptId = res[0].belong_dept;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id;
that.apiObj = that.$API.wpm.fmlog.list;
});
},
methods: {
detailClose() {
this.dialog.detail = false;
this.$refs.table.refresh();
},
//
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_detail(row) {
this.fmlogId = row.id;
this.dialog.detail = true;
this.$nextTick(() => {
this.$refs.detailDialog.open();
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.fmlog.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功");
}
});
});
},
//
selectionChange(selection) {
this.selection = selection;
},
//
handleQuery() {
this.$refs.table.queryData(this.query);
},
//
//
handleSaveSuccess(data, mode) {
this.dialog.save = true;
this.$refs.table.refresh();
},
},
};
</script>
<style scoped></style>

View File

@ -16,6 +16,11 @@
v-auth="'handover.create'"
>返工</el-button
>
<el-button
type="primary"
@click="printSetting"
>打印机</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@ -67,12 +72,36 @@
type="index"
width="50"
></el-table-column>
<el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<el-descriptions :column="2">
<template v-for="item in props.row.handoverb" :key="item.id">
<el-descriptions :column="3">
<el-descriptions-item label="批次">
{{props.row.batch}}
</el-descriptions-item>
<el-descriptions-item label="数量">
{{props.row.count}}
</el-descriptions-item>
<el-descriptions-item label="不合格标记" v-if="props.row.notok_sign_name!==null">
{{props.row.notok_sign_name}}
</el-descriptions-item>
</el-descriptions>
</template>
</el-descriptions>
</div>
</template>
</el-table-column>
<el-table-column
label="物料"
prop="material_name"
min-width="140"
></el-table-column>
<el-table-column label="批次" prop="batch" min-width="140">
<template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template>
</el-table-column>
<el-table-column label="数量" prop="count" width="80"></el-table-column>
<el-table-column label="交接类型" prop="type" width="100">
@ -144,6 +173,14 @@
"
>接收</el-button
>
<el-button
link
size="small"
@click="table_show(scope.row)"
type="success"
v-if="scope.row.recive_mgroup == mgroupId &&scope.row.submit_time == null"
>查看</el-button
>
<el-button
link
size="small"
@ -273,6 +310,9 @@ export default {
}
},
methods: {
printSetting(){
this.setNameVisible = true;
},
handoverPrint() {
let that = this;
let str = [
@ -324,6 +364,13 @@ export default {
this.$refs.saveDialog.open("edit").setData(row);
});
},
table_show(row){
this.type=row.type;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
async table_del(row) {
var id = row.id;

View File

@ -14,35 +14,6 @@
label-width="80px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="交接物料" prop="wm">
<el-select
v-model="form.wm"
placeholder="交接物料"
filterable
clearable
style="width: 100%"
@change="materialChange"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
<span>{{ item.batch }}</span>
<div style="float: right">
<span>{{ item.count }}</span>
<span
v-if="item.notok_sign_name !== null"
style="color: #aaaaaa"
>({{ item.notok_sign_name }})</span
>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送日期" prop="send_date">
<el-date-picker
@ -55,7 +26,7 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<!-- <el-col :md="12" :sm="24">
<el-form-item label="交接数量" width="100">
<el-input-number
v-model="form.count"
@ -68,7 +39,7 @@
>
</el-input-number>
</el-form-item>
</el-col>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select
@ -141,9 +112,60 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="交接物料">
<el-button type="primary" icon="el-icon-plus" @click="addMaterial"></el-button>
</el-form-item>
</el-row>
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
<el-col :span="11">
<el-form-item label="交接物料">
<el-select
v-model="listItem.wm"
placeholder="交接物料"
filterable
clearable
style="width: 100%"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span>{{ item.batch }}</span>
<div style="float: right">
<span>{{ item.count }}</span>
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
({{ item.notok_sign_name }})
</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="交接数量">
<el-input-number
v-model="listItem.count"
controls-position="right"
:min="0"
step="1"
:step-strictly="true"
style="width: 100%"
placeholder="交接数量"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-footer v-if="mode!=='show'">
<el-button type="primary" v-loading="isSaveing" @click="submit"
>确定</el-button
>
@ -178,16 +200,15 @@ export default {
edit: "编辑交接记录",
show: "查看交接记录",
},
lists:[],//
handle_user: [],
form: {
batch: "",
count: 0, //
wm: "",
send_date: "",
send_user: "",
send_mgroup: "",
recive_user: "",
recive_mgroup: "",
send_date: null,
send_user: null,
send_mgroup: null,
recive_user: null,
recive_mgroup: null,
handoverb:[{wm:'',count:''}],
},
rules: {
batch: [
@ -271,7 +292,11 @@ export default {
that.deptID = that.$TOOL.data.get('gx_deptID');
that.getUserList();
}
that.getMaterial();
if(that.type==40){
that.getMaterialNotok();
}else{
that.getMaterial();
}
that.getDeptOptions();
that.getMgroupOptions();
},
@ -306,30 +331,44 @@ export default {
}else if(that.mgroupName=="facade"){
req.material__process__name="二次超洗";
}
// else{
// if (this.type == 10) {
// req.notok_sign__isnull = 1;
// } else if (this.type == 20) {
// req.notok_sign__isnull = 0;
// }else if (this.type == 30) {
// req.notok_sign__isnull = 1;
// }
// }
this.$API.wpm.wmaterial.list
.req(req)
.then((res) => {
that.materialOptions = res;
});
this.$API.wpm.wmaterial.list.req(req).then((res) => {
// that.materialOptions = res;
let arr = [];
res.forEach(item=>{
let obj = {};
Object.assign(obj,item);
obj.label = item.batch;
arr.push(obj);
})
that.materialOptions = arr;
});
},
//
getMaterialNotok() {
let that = this;
var req = {
mgroupx: that.mgroupId,
page: 0,
notok_sign__isnull : 0,
count_xtest__isnull:1
};
this.$API.wpm.wmaterial.list.req(req).then((res) => {
let arr = [];
res.forEach(item=>{
let obj = {};
Object.assign(obj,item);
obj.label = item.batch+'('+item.notok_sign_name+')';
arr.push(obj);
})
that.materialOptions = arr;
});
},
//
getUserList() {
let that = this;
this.$API.system.user.list
.req({ depts: that.deptID, page: 0 })
.then((res) => {
that.userList = res;
});
this.$API.system.user.list.req({ depts: that.deptID, page: 0 }).then((res) => {
that.userList = res;
});
},
//
getUserList2() {
@ -338,9 +377,7 @@ export default {
this.mgroupOptions.forEach(item => {
if(item.id==that.form.recive_mgroup){
deptID = item.belong_dept;
this.$API.system.user.list
.req({ depts: deptID, page: 0 })
.then((res) => {
this.$API.system.user.list.req({ depts: deptID, page: 0 }).then((res) => {
that.userList2 = res;
});
}
@ -355,6 +392,12 @@ export default {
that.userList2 = res;
});
},
addMaterial(){
this.form.handoverb.push({wm:'',count:''});
},
delMaterial(index){
this.form.handoverb.splice(index,1);
},
//
open(mode = "add") {
this.mode = mode;
@ -369,36 +412,42 @@ export default {
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
if (this.mode == "add") {
this.$API.wpm.handover.create
.req(this.form)
.then((res) => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
.catch((err) => {
//
this.isSaveing = false;
return err;
});
} else if (this.mode == "edit") {
this.$API.wpm.handover.update
.req(this.form.id, this.form)
.then((res) => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
.catch((err) => {
//
this.isSaveing = false;
return err;
});
if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => {
if(that.type==40){
//
that.$API.wpm.handover.submit.req(res.id).then((res1) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
}else{
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}
}).catch((err) => {
//
that.isSaveing = false;
return err;
});
} else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
//
that.isSaveing = false;
return err;
});
}
}
});

View File

@ -9,6 +9,8 @@
<el-button type="primary" @click="tomio" v-auth="'mio.do'"
>入库</el-button
>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
报废</el-button>
</div>
<div class="right-panel">
<!-- <el-button type="primary" @click="materialsChoses('wm')"
@ -36,18 +38,13 @@
:params="params"
:query="query"
>
<el-table-column
label="状态"
prop="state"
width="100"
><template #default="scope"
><el-tag
:type="wmState[scope.row.state]?.type"
>{{
wmState[scope.row.state]?.text
}}</el-tag
>
</template></el-table-column>
<el-table-column label="状态" prop="state" width="100" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}}
</el-tag>
</template>
</el-table-column>
<el-table-column
label="物料名称"
prop="material_name"
@ -100,18 +97,24 @@
label="操作"
fixed="right"
align="center"
width="80"
width="120"
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
>
<template #default="scope">
<el-button
link
size="small"
link size="small"
@click="table_Check(scope.row)"
v-auth="'mgroup.update'"
v-auth="'ftestwork.create'"
type="primary"
v-if="scope.row.notok_sign_name == null"
>抽检
>检验
</el-button>
<el-button
link size="small"
type="warning"
@click="tableCheckList(scope.row)"
v-if="scope.row.notok_sign_name == null"
>检验记录
</el-button>
</template>
</el-table-column>
@ -134,12 +137,31 @@
@closed="dialog.save = false"
>
</check-dialog>
<scrap-dialog
v-if="dialog.scrap"
ref="scrapDialog"
:type="type"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
@success="handleScrapSuccess"
@closed="dialog.scrap = false"
>
</scrap-dialog>
<showDrawer
ref="showDrawer"
v-if="visibleDrawer"
:wm="wm"
@closed="visibleDrawer = false"
>
</showDrawer>
</el-container>
</template>
<script>
import { wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue";
import checkDialog from "./check_form.vue";
import showDrawer from "./check_drawer.vue";
import scrapDialog from "./handover_form.vue";
export default {
props: {
mgroupName: {
@ -149,7 +171,9 @@ export default {
},
components: {
materials,
checkDialog
checkDialog,
showDrawer,
scrapDialog
},
name: "wmaterial",
data() {
@ -162,6 +186,7 @@ export default {
query: {},
dialog: {
save: false,
scrap: false,
permission: false,
},
tableData: [],
@ -218,10 +243,30 @@ export default {
this.$refs.saveDialog.open(mode);
});
},
//
tableCheckList(row){
this.wm = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
selectionChange(selection) {
this.selection = selection;
},
//
table_add(type) {
this.dialog.scrap = true;
this.type = type;
this.$nextTick(() => {
this.$refs.scrapDialog.open("add");
});
},
handleScrapSuccess(){
this.dialog.scrap = false;
this.$refs.table.refresh();
},
//
handleQuery() {
this.$refs.table.queryData(this.query);

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -10,6 +10,12 @@
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
mlogItem.routepack_name
}}</el-descriptions-item>
<el-descriptions-item label="输入物料">{{
mlogItem.material_in_name
}}</el-descriptions-item>
<el-descriptions-item label="输出物料">{{
mlogItem.material_out_name
}}</el-descriptions-item>
<el-descriptions-item label="工段名称">{{
@ -33,31 +39,40 @@
<el-descriptions-item label="创建时间">{{
mlogItem.create_time
}}</el-descriptions-item>
<el-descriptions-item label="工单状态" v-if="mlogItem.mgroup_name=='退火'">
<el-tag v-if="mlogItem.ticket_">{{act_states[mlogItem.ticket_.act_state]}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="检验表单" v-if="mlogItem.mgroup_name=='退火'||mlogItem.mgroup_name=='黑化'">
<el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link>
</el-descriptions-item>
</el-descriptions>
<div
style="
padding: 5px 10px;
display: flex;
justify-content: end;
"
>
<div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button
type="primary"
v-if="mlogItem.submit_time == null"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
@click="mlogUpdate"
style="margin-right: 10px;"
v-auth="'mlog.update'"
>
编辑
</el-button>
<el-button
type="primary"
v-if="mlogItem.submit_time == null"
v-if="mlogItem.mgroup_name!='退火'&&mlogItem.submit_time == null"
:loading="isSaveing"
@click="mlogSubmit"
>提交</el-button
>
<!-- 退火-->
<el-button
type="primary"
v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
:loading="isSaveing"
@click="createTicket"
>放行审批</el-button>
</div>
</el-card>
<!-- 物料消耗 -->
<el-card
style="width: 100%; margin: 1vh 0"
header="物料消耗"
@ -66,7 +81,7 @@
<div>
<el-button
type="primary"
v-if="mlogItem.submit_time == null"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
icon="el-icon-plus"
@click="table_add"
>新增</el-button
@ -91,7 +106,7 @@
</el-table-column>
<el-table-column label="领用数量" prop="count_use">
</el-table-column>
<el-table-column label="破碎数量" prop="count_break">
<el-table-column label="加工前不良" prop="count_pn_jgqbl">
</el-table-column>
<el-table-column
label="创建时间"
@ -110,13 +125,13 @@
link
type="primary"
@click="table_in_edit(scope.row)"
:disabled="mlogItem.submit_time !== null"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
>
编辑
</el-button>
<el-button
link
:disabled="mlogItem.submit_time !== null"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
type="danger"
@click="table_in_del(scope.row)"
>
@ -126,6 +141,47 @@
</el-table-column>
</scTable>
</el-card>
<!-- 物料消耗编辑 -->
<el-dialog v-model="saveInDialog" title="编辑">
<el-form
:model="saveInForm"
:rules="rules"
label-width="100px"
ref="saveInForm"
>
<el-row>
<el-col :span="23">
<el-form-item label="领取数量" prop="count_use">
<el-input-number
v-model="saveInForm.count_use"
:min="1"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
<el-input-number
v-model="saveInForm.count_pn_jgqbl"
:min="0"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button
type="primary"
:loading="isSaveing"
@click="saveInSubmit()"
> </el-button
>
</template>
</el-dialog>
<!-- 产出物料 -->
<el-card style="width: 100%" header="产出物料" shadow="never">
<scTable
ref="tableOut"
@ -138,7 +194,20 @@
<el-table-column type="index" width="50" />
<el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<div style="padding-left: 50px" v-if="props.row.count_notok_json.length>0">
<el-descriptions :column="4" v-for="item in props.row.count_notok_json" :key="item">
<el-descriptions-item label="层数">
{{item.floor}}
</el-descriptions-item>
<el-descriptions-item label="抽检数">
{{item.count_sampling}}
</el-descriptions-item>
<el-descriptions-item label="总数">
{{item.count}}
</el-descriptions-item>
</el-descriptions>
</div>
<div style="padding-left: 50px" v-else>
<el-descriptions :column="4">
<el-descriptions-item label="划伤">{{
props.row.count_n_hs
@ -152,6 +221,9 @@
<el-descriptions-item label="崩边">{{
props.row.count_n_bb
}}</el-descriptions-item>
<el-descriptions-item label="小崩边">{{
props.row.count_n_xbb
}}</el-descriptions-item>
<el-descriptions-item label="雾面">{{
props.row.count_n_wm
}}</el-descriptions-item>
@ -194,7 +266,7 @@
<el-button
link
type="primary"
:disabled="mlogItem.submit_time !== null"
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1)"
@click="table_out_check(scope.row)"
>
检验
@ -220,7 +292,17 @@
@closed="dialog.check = false"
>
</check-dialog>
<el-dialog v-model="saveInDialog" title="新增/编辑">
<edit-dialog
v-if="dialog.edit"
ref="editDialog"
:dept="deptId"
:mgroupName= "mlogItem.mgroup_name"
@success="handleEditSuccess"
@closed="dialog.edit = false"
>
</edit-dialog>
<!-- 退火放行通知单 -->
<el-dialog v-model="ticketDialog" title="退火放行通知单">
<el-form
:model="saveInForm"
:rules="rules"
@ -228,45 +310,81 @@
ref="saveInForm"
>
<el-row>
<el-col :span="23">
<el-form-item label="领取数量" prop="count_use">
<el-col :md="12" :sm="24">
<el-form-item label="退火炉号">
<el-input v-model="oinfo_json.退火炉号"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火时间">
<el-input-number
v-model="saveInForm.count_use"
v-model="oinfo_json.退火时间"
:min="1"
controls-position="right"
/>min
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火温度">
<el-input-number
v-model="oinfo_json.退火温度"
:min="1"
style="width: 100%"
controls-position="right"
/>
<span style="position: absolute;right: -17px;">°C</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检结果">
<el-input v-model="oinfo_json.抽检结果"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检数">
<el-input-number
v-model="oinfo_json.抽检数"
:precision="0"
:min="1"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="破碎数量" prop="count_break">
<el-input-number
v-model="saveInForm.count_break"
:min="0"
style="width: 100%"
controls-position="right"
/>
<el-col :md="12" :sm="24">
<el-form-item label="强度落球">
<el-input v-model="oinfo_json.强度落球"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="放行标准">退火后直径23.5±0.2黑圈内径5.9±0.1外径7.6-7.77</el-form-item>
</el-row>
<el-form-item label="检验附件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.xlsx', '.xls']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-form>
<template #footer>
<el-button
v-for="item in initForm.transitions"
:key="item.id"
type="primary"
:loading="isSaveing"
@click="saveInSubmit()"
> </el-button
:disabled="isSaveing"
@click="submitTicketCreate(item.id)"
style="margin-right: 4px"
>{{ item.name }}</el-button
>
</template>
</el-dialog>
<edit-dialog
v-if="dialog.edit"
ref="editDialog"
:dept="deptId"
@success="handleEditSuccess"
@closed="dialog.edit = false"
>
</edit-dialog>
</div>
</el-drawer>
</template>
@ -312,13 +430,32 @@ export default {
mlogItem: {},
saveInForm: {
count_use: 0,
count_break: 0,
count_pn_jgqbl: 0,
},
oinfo_json:{
退火炉号:'',
退火时间:'',
退火温度:'',
抽检结果:'',
抽检数:'',
强度落球:'',
},
act_states: {
0: "草稿中",
1: "进行中",
2: "被退回",
3: "被撤回",
4: "已完成",
5: "已关闭",
},
fileList:[],
test_file:'',
deptId: "",
visible: false,
isSaveing: false,
options: [],
saveInDialog: false,
ticketDialog:false,
setFiltersVisible: false,
rules: {
count_use: [
@ -328,13 +465,6 @@ export default {
trigger: "blur",
},
],
count_break: [
{
required: true,
message: "请输入破碎数量",
trigger: "blur",
},
],
},
};
},
@ -343,15 +473,21 @@ export default {
this.paramsIn.mlog = this.mlogId;
this.paramsOut.mlog = this.mlogId;
this.apiObj = this.$API.wpm.mlogb.list;
this.getInit();
},
methods: {
open() {
this.visible = true;
},
getMlogItem() {
let that = this;
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
that.mlogItem = res;
if(res.test_file!==null){
that.fileList = [{name:res.test_file,url:res.test_file}];
that.form.test_file = res.test_file;
}
that.mgroup = res.mgroup;
that.materialIn = res.material_in;
that.deptId = res.belong_dept;
@ -391,7 +527,7 @@ export default {
that.isSaveing = true;
let obj = {};
obj.count_use = that.saveInForm.count_use;
obj.count_break = that.saveInForm.count_break;
obj.count_pn_jgqbl = that.saveInForm.count_pn_jgqbl;
that.$API.wpm.mlogb.updateIn
.req(that.saveInForm.id, obj)
.then((res) => {
@ -420,8 +556,11 @@ export default {
},
table_out_check(row) {
this.dialog.check = true;
let obj = {};
Object.assign(obj, row);
obj.mgroup_name = this.mlogItem.mgroup_name;
this.$nextTick(() => {
this.$refs.checkDialog.open(row);
this.$refs.checkDialog.open(obj);
});
},
@ -434,6 +573,49 @@ export default {
that.$message.success("操作成功");
});
},
//
getInit() {
let that = this;
that.$API.wf.workflow.initkey.req(" backfire").then((res) => {
that.initForm = res;
});
},
//退
createTicket(){
if(this.mlogItem.work_end_time==null){
this.$message.error("请先编辑日志并选择结束时间");
}else{
let sum = 0;
this.mlogItem.reminder_interval_list.forEach(item => {
sum+=item;
});
this.oinfo_json.退火时间 = sum;
this.oinfo_json.退火炉号 =this.mlogItem.equipment_name!==null?this.mlogItem.equipment_name.split("|")[0]:'';
this.ticketDialog = true;
}
},
//退,
submitTicketCreate(id) {
let that = this;
let obj = {};
obj.oinfo_json = that.oinfo_json;
obj.test_file = that.test_file;
that.$API.wpm.mlog.change.req(that.mlogItem.id, obj).then((res) => {
let ticket = {};
that.isSaveing = true;
ticket.title = '退火放行审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: that.mlogItem.id};
ticket.transition = id;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.ticketDialog = false;
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
});
},
handleSaveSuccess() {
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
@ -441,6 +623,11 @@ export default {
handleCheckSuccess() {
this.$refs.tableOut.refresh();
},
fileUPSuccess(res) {
let that = this;
console.log('res',res);
this.test_file = res.path;
},
handleEditSuccess() {},
//
setFilters(filters) {

View File

@ -13,7 +13,7 @@
:model="form"
:rules="rules"
label-position="right"
label-width="100px"
label-width="80px"
style="padding: 0 10px"
>
<el-row>
@ -72,7 +72,7 @@
<el-option
v-for="item in routeOptions"
:key="item.id"
:label="item.process_name"
:label="item.routepack_name"
:value="item.id"
>
<span
@ -97,7 +97,7 @@
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
@ -132,6 +132,26 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-form-item label="保温时间" required>
<el-input-number
v-model="form.reminder_interval_list[0]"
:min="0"
:disabled="mode == 'edit'"
controls-position="right"
/>(min)
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-form-item label="冷却时间" required>
<el-input-number
v-model="form.reminder_interval_list[1]"
:min="0"
:disabled="mode == 'edit'"
controls-position="right"
/>(min)
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="操作人">
<ehsSelect
@ -140,21 +160,23 @@
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
></ehsSelect>
<!-- <el-select
v-model="form.handle_user"
placeholder="操作人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> -->
</el-form-item>
</el-col>
<!-- 黑化 -->
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'">
<el-form-item label="检验文件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.xlsx', '.xls']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input
@ -163,39 +185,6 @@
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="间隔提醒">
<el-input-number
v-model="form.reminder_interval_list[0]"
:min="1"
:disabled="mode == 'edit'"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[1]"
:min="1"
:disabled="mode == 'edit'"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[2]"
:min="1"
:disabled="mode == 'edit'"
style="width: 25%"
controls-position="right"
/>
<el-input-number
v-model="form.reminder_interval_list[3]"
:min="1"
:disabled="mode == 'edit'"
style="width: 25%"
controls-position="right"
/>
<div class="form_unit">(h)</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
@ -211,12 +200,15 @@
<script>
const defaultForm = {
note: "",
mtype: "",
supplier:'',
route: "",
equipment: "",
handle_user: null,
work_start_time: "",
reminder_interval_list: [],
work_end_time:null,
note:'',
reminder_interval_list: [0,0],
};
export default {
@ -225,6 +217,10 @@ export default {
type: String,
default: "",
},
mgroupName:{
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
@ -250,8 +246,10 @@ export default {
edit: "编辑日志",
show: "查看日志",
},
test_file:'',
fileList:[],
//
form: defaultForm,
form: Object.assign({}, defaultForm),
//
rules: {
supplier: [
@ -301,6 +299,7 @@ export default {
this.getUser();
this.getSupplier();
this.getEquipment();
},
methods: {
disabledDateFn(time) {
@ -313,11 +312,15 @@ export default {
});
},
getEquipment() {
this.$API.em.equipment.list
.req({ page: 0, type: 10,belong_dept:this.dept })
.then((res) => {
this.options = res;
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
getSupplier() {
let that = this;
@ -346,12 +349,17 @@ export default {
setData(data) {
console.log("data", data);
Object.assign(this.form, data);
if(data.test_file!==null){
this.form.test_file = data.test_file;
this.fileList = [{name:data.test_file,url:data.test_file}];
}
this.getRoute(data.id);
},
setMgroup(id) {
this.form.mgroup = id;
fileUPSuccess(res) {
let that = this;
console.log('res',res);
this.test_file = res.path;
},
//
submit() {
let that = this;
@ -365,20 +373,25 @@ export default {
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
} else {
let obj = {};
obj.work_end_time = that.form.work_end_time;
obj.handle_user = that.form.handle_user;
obj.note = that.form.note;
that.$API.wpm.mlog.change
.req(that.form.id, that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
if(that.mgroupName=='黑化'){
that.form.test_file = that.test_file;
}
that.$API.wpm.mlog.change.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
});
}
}
});

View File

@ -32,6 +32,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChanges"
/>
</el-form-item>
</el-col>
@ -51,11 +52,66 @@
v-model="form.count_notok"
:min="0"
class="width-100"
@change="countChanges"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-divider></el-divider>
</el-row>
<el-divider></el-divider>
<el-row v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-col :span="24">
<el-form-item label="不合格统计">
<el-button
type="primary"
icon="el-icon-plus"
@click="notok_add"
></el-button>
</el-form-item>
</el-col>
</el-row>
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-row style="margin-bottom:10px" v-for="(item, $index) in count_notok_json" :key="item">
<el-col :span="7">
<el-input-number
style="width:90%"
v-model="item.floor"
:min="0"
class="width-100"
placeholder="层数"
controls-position="right"
/>
</el-col>
<el-col :span="7">
<el-input-number
style="width:90%"
v-model="item.count_sampling"
:min="0"
class="width-100"
placeholder="抽检数"
controls-position="right"
/>
</el-col>
<el-col :span="7">
<el-input-number
style="width:90%"
v-model="item.count"
:min="0"
class="width-100"
placeholder="总数"
controls-position="right"
/>
</el-col>
<el-col :span="2">
<el-button
type="danger"
icon="el-icon-delete"
@click="notok_del( $index)"
></el-button>
</el-col>
</el-row>
</template>
<el-row v-else>
<el-col :md="12" :sm="24">
<el-form-item label="划伤">
<el-input-number
@ -111,6 +167,17 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="小崩边">
<el-input-number
v-model="form.count_n_xbb"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="麻点">
<el-input-number
@ -144,6 +211,17 @@
/>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="棕圈">
<el-input-number
v-model="form.count_n_zq"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
@ -156,12 +234,54 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="24">
<el-form-item label="前道不良">
<el-button
type="primary"
icon="el-icon-plus"
@click="notok_add"
></el-button>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-bottom:10px" v-for="(item, $index) in notokList" :key="item">
<el-col :span="10">
<el-select v-model="item.file"
style="width:90%"
placeholder="请选择不合格项">
<el-option
v-for="notok in notokOptions"
:key="notok.value"
:label="notok.name"
:value="notok.value"
>
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input-number
style="width:90%"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-col>
<el-col :span="2">
<el-button
type="danger"
icon="el-icon-delete"
@click="notok_del( $index)"
></el-button>
</el-col>
</el-row> -->
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
@ -184,12 +304,27 @@ export default {
count_n_qp: 0,
count_n_swen: 0,
count_n_bb: 0,
count_n_xbb:0,
count_n_md: 0,
count_n_xh: 0,
count_n_ps: 0,
count_n_qt: 0,
count_n_wm: 0,
count_n_zq:0
},
notokOptions:[
{name:"划伤",value:'count_n_hs'},
{name:"气泡",value:'count_n_qp'},
{name:"水纹",value:'count_n_swen'},
{name:"崩边",value:'count_n_bb'},
{name:"小崩边",value:'count_n_xbb'},
{name:"麻点",value:'count_n_md'},
{name:"划伤",value:'count_n_xh'},
{name:"破损",value:'count_n_ps'},
{name:"其他",value:'count_n_qt'},
{name:"雾面",value:'count_n_wm'},
{name:"棕圈",value:'count_n_zq'},
],
//
rules: {
batch: [
@ -208,6 +343,7 @@ export default {
],
},
options: [],
count_notok_json:[],
materialOptions: [],
visible: false,
isSaveing: false,
@ -223,19 +359,31 @@ export default {
open(data) {
this.visible = true;
Object.assign(this.form, data);
this.mgroupName = data.mgroup_name;
console.log(this.form);
},
notok_add(){
this.count_notok_json.push({notok:'qt',count:null,floor:null,count_sampling:null});
},
notok_del(index){
this.count_notok_json.splice(index, 1)
},
countChange() {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_xbb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_ps +
this.form.count_n_zq +
this.form.count_n_qt +
this.form.count_n_wm;
this.form.count_ok = this.form.count_real - this.form.count_notok;
},
countChanges(){
this.form.count_ok = this.form.count_real - this.form.count_notok;
},
//
@ -245,17 +393,29 @@ export default {
if (valid) {
that.isSaveing = true;
that.form.mlog = that.mlog;
this.form.count_notok =
let sum = 0;
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
let total = 0;
that.count_notok_json.forEach(item => {
total+=item.count;
});
this.form.count_notok = total;
this.form.count_notok_json = this.count_notok_json;
}else{
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_xbb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_ps +
this.form.count_n_zq +
this.form.count_n_qt +
this.form.count_n_wm;
let sum = this.form.count_ok + this.form.count_notok;
}
sum = this.form.count_ok + this.form.count_notok;
if (sum - this.form.count_real == 0) {
that.$API.wpm.mlogb.updateOut
.req(that.form.id, that.form)
@ -269,9 +429,7 @@ export default {
that.isSaveing = false;
});
} else {
this.$message.error(
"使用数量与合格数不合格数数量不对等"
);
this.$message.error("使用数量与合格数不合格数数量不对等");
}
}
});

View File

@ -65,6 +65,9 @@
controls-position="right"
/>
</el-form-item>
<el-form-item label="所在层数">
<el-input v-model="form.note"/>
</el-form-item>
</el-form>
</el-main>
<el-footer>

View File

@ -54,13 +54,18 @@
prop="equipment_name"
min-width="150"
></el-table-column>
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<template #default="scope">
<el-progress id="progressbwlq" :percentage="customMethod(scope.row,1)" :stroke-width="20" :color="customMethod(scope.row,2)" :text-inside="true"><span>{{customMethod(scope.row,3)}}</span></el-progress>
</template>
</el-table-column>
<el-table-column
label="部门/工段"
prop="belong_dept_name"
>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column
label="处理人"
@ -75,10 +80,17 @@
label="结束时间"
prop="work_end_time"
></el-table-column>
<!-- <el-table-column
label="创建时间"
prop="create_time"
></el-table-column> -->
<el-table-column label="是否提交">
<template #default="scope">
<el-icon v-if="scope.row.submit_time != null" color="green">
<CircleCheckFilled />
</el-icon>
</template>
</el-table-column>
<el-table-column
label="提交时间"
prop="submit_time"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
@ -86,7 +98,7 @@
width="150"
>
<template #default="scope">
<el-button
<!-- <el-button
link
size="small"
v-auth="'mlog.update'"
@ -94,7 +106,7 @@
type="primary"
@click.stop="table_edit(scope.row)"
>编辑</el-button
>
> -->
<el-button
link
size="small"
@ -129,6 +141,7 @@
:process="processId"
:mgroup="mgroupId"
:dept="deptId"
:mgroupName = "mgroupName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
@ -253,7 +266,57 @@ export default {
});
});
},
customMethod(row,index){
let color = '',context = '';
let percent = 0;
if(row.reminder_interval_list.length>0){
let data = new Date();
//
let currentTime = data.getTime();
//
let startTime = new Date(row.work_start_time).getTime();
//
let endTime = new Date(row.work_end_time).getTime();
//
let times = (currentTime-startTime)/1000/60;
//
let sum = row.reminder_interval_list[0]+row.reminder_interval_list[1];
if(endTime!==0&&(currentTime>endTime)){
percent = 100;
color = row.mstate_json[1].color;
context = '已完成';
}else{
if(times>0){
percent = Math.round((times/sum)*100);
}else{
percent = 0;
}
if(times>0){
if(times>row.reminder_interval_list[0]){//
color = row.mstate_json[1].color;
context = row.mstate_json[1].name;
}else if(times>row.reminder_interval_list[1]){//
color = row.mstate_json[1].color;
context = '已完成';
}else{//
color = row.mstate_json[0].color;
context = row.mstate_json[0].name;
}
}else{
color = "#ffffff";
}
}
if(index==1){
return percent
}else if(index==2){
return color
}else{
return context
}
}
},
//
selectionChange(selection) {
this.selection = selection;
@ -271,4 +334,6 @@ export default {
},
};
</script>
<style scoped></style>
<style scoped>
</style>

View File

@ -8,23 +8,10 @@
row-key="id"
:params="params"
>
<el-table-column
label="任务列表"
type="index"
width="80"
></el-table-column>
<el-table-column
label="产品名"
prop="material_out_name"
show-overflow-tooltip
>
<el-table-column label="任务列表" type="index" width="80"></el-table-column>
<el-table-column label="产品名" prop="material_out_name" show-overflow-tooltip>
</el-table-column>
<el-table-column
label="任务编号"
prop="number"
width="140"
show-overflow-tooltip
>
<el-table-column label="任务编号" prop="number" width="140" show-overflow-tooltip>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="开始时间" prop="start_date">
@ -33,31 +20,50 @@
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column>
<el-table-column label="状态" prop="state">
<el-table-column label="分配人数" prop="mtaskb">
<template #default="scope">
<el-tag :type="elTagType(scope.row.state)">
{{ state_[scope.row.state] }}
</el-tag>
<span v-if="scope.row.mtaskb.length>0">
{{scope.row.mtaskb.length}}
</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<el-table-column label="操作" fixed="right" width="90">
<template #default="scope">
<el-link
type="primary"
@click="mtask_submit(scope.row)"
<el-button
link
size="small"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 && scope.row.state != 34
"
type="primary"
v-if="scope.row.state == 20 "
@click="mtask_submit(scope.row)"
>提交
</el-link>
</el-button>
<el-button
link
size="small"
v-auth="'mtask.submit'"
type="primary"
v-if="scope.row.state == 20 "
@click="mtask_deliver(scope.row)"
>分配
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
<deliver-drawer
v-if="deliverShow"
ref="detailDialog"
:mgroup="mgroupId"
:dept="deptId"
@success = "refreshMtask"
@closed="detailClose"
>
</deliver-drawer>
</el-container>
</template>
<script>
import deliverDrawer from "./mtask_deliver.vue";
export default {
props: {
mgroupName: {
@ -65,11 +71,14 @@ export default {
default: "",
},
},
components: {
deliverDrawer,
},
name: "mtask",
data() {
return {
apiObj: null,
params: { mgroup: "" },
params: { mgroup: "",state:20 },
query: {},
tableData: [],
@ -85,13 +94,15 @@ export default {
34: "danger",
40: "success",
},
state_: {
10: "创建中",
20: "已下达",
30: "生产中",
34: "已终止",
40: "已提交",
},
// state_: {
// 10: "",
// 20: "",
// 30: "",
// 34: "",
// 40: "",
// },
deptId: null,
deliverShow:false,
};
},
mounted() {
@ -104,17 +115,38 @@ export default {
return;
}
that.mgroupId = res[0].id;
that.deptId = res[0].belong_dept;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id;
that.apiObj = this.$API.pm.mtask.list;
console.log("mgroupId", res[0].id);
});
},
methods: {
elTagType(state) {
return this.type_[state];
},
mtask_submit(row){
this.$confirm('确定提交该任务吗?提交后不可更改相关信息', "提示", {
type: "warning",
}).then(() => {
this.$API.pm.mtask.submit.req(row.id).then((res) => {
this.$message.success("操作成功");
this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
})
.catch((err) => {});
});
},
mtask_deliver(row){
this.deliverShow = true;
this.$nextTick(() => {
this.$refs.detailDialog.open(row);
});
},
refreshMtask(){
this.$refs.table.refresh();
},
//
selectionChange(selection) {
this.selection = selection;

View File

@ -0,0 +1,202 @@
<template>
<el-drawer
title="任务分配"
v-model="visible"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div>
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions>
<el-descriptions-item label="名称">{{
mtaskObj.material_out_name
}}</el-descriptions-item>
<el-descriptions-item label="任务编号">{{
mtaskObj.number
}}</el-descriptions-item>
<el-descriptions-item label="任务量">{{
mtaskObj.count
}}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{
mtaskObj.start_date
}}</el-descriptions-item>
<el-descriptions-item label="结束时间">{{
mtaskObj.end_date
}}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 选择人员 -->
<el-form
:model="form"
:rules="rules"
label-width="100px"
ref="form"
style="margin-top: 10px;margin-bottom:50px"
>
<el-row>
<el-col :span="24">
<el-form-item label="操作人员">
<el-checkbox-group
v-model="choose_user"
@change="userChange"
>
<el-checkbox class="checkboxItem" v-for="item in userList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<el-divider style="margin-top:0"></el-divider>
<el-row>
<el-col :md="6" :sm="8" v-for="item in cUserList" :key="item.id">
<el-form-item :label="item.handle_user_name">
<el-input-number
v-model="item.count"
:precision="0"
:min="1"
style="width: 90%"
controls-position="right"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="footer">
<el-button type="primary" @click="mtaskb_submit">提交</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
export default {
props: {
mgroup: {
type: String,
default: "",
},
dept: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
form: {},
apiObj: null,
loading: false,
visible: false,
isSaveing: false,
mtaskObj:{},
userList:[],
cUserList:[],//
choose_user:[],//id
rules: {
count_use: [
{
required: true,
message: "请输入领取数量",
trigger: "blur",
},
],
},
};
},
mounted() {
this.$nextTick(() => {
this.getUsers();
})
},
methods: {
open(data) {
let that = this;
this.visible = true;
this.mtaskObj = data;
that.cUserList = data.mtaskb;
that.choose_user = [];
if(that.cUserList.length>0){
that.cUserList.forEach(item=>{
that.choose_user.push(item.handle_user);
})
}
},
getUsers() {
let that = this;
that.$API.system.user.list.req({ belong_dept: that.dept, page: 0 }).then(res => {
// that.$API.system.user.list.req({ page:1,page_size:60}).then(res => {
that.userList = res;
})
},
userChange(){
let that = this;
let average = Math.floor( that.mtaskObj.count/that.choose_user.length);
let remainder = that.mtaskObj.count%that.choose_user.length;//
that.cUserList = [];
console.log('that.choose_user',that.choose_user);
that.userList.forEach(item=>{
if(that.choose_user.indexOf(item.id)>-1){
let obj = {};
obj.handle_user_name = item.name;
obj.handle_user = item.id;
obj.count = average;
that.cUserList.push(obj);
}
})
console.log('that.cUserList',that.cUserList);
for(let i=0;i<remainder;i++){
that.cUserList[i].count += 1;
}
},
mtaskb_submit() {
let that = this;
console.log(that.cUserList);
let sum = 0;
that.cUserList.forEach(item => {
sum+=item.count;
});
console.log(sum-that.mtaskObj.count)
if(sum-that.mtaskObj.count==0){
that.isSaveing = true;
that.$API.pm.mtaskbAdd.req(that.mtaskObj.id,that.cUserList).then((res) => {
that.isSaveing = false;
that.visible = false;
this.$emit("success");
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
}else{
that.$message.error("分配数量与任务总数不匹配,请确认后再提交");
}
},
handleEditSuccess() {},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style scoped>
.checkboxItem{
width:80px;
}
.footer{
position: absolute;
bottom: 0px;
width: 100%;
z-index: 10;
text-align: center;
background: #ffffff;
height: 40px;
}
</style>

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {

View File

@ -32,7 +32,7 @@
<script>
import inm from "./inm.vue";
import mlogs from "./mlogs.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
export default {