Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2022-03-14 11:11:53 +08:00
commit cf83b9e8f9
45 changed files with 6405 additions and 6389 deletions

View File

@ -73,7 +73,7 @@
}
font-size: 18px;
width: 300px;
line-height: 50px;
line-height: 40px;
text-align: center;
transform: skewX(-45deg);
@ -81,8 +81,8 @@
position: absolute;
right: -25px;
top: 0;
height: 50px;
width: 50px;
height: 40px;
width: 40px;
background-color: #0f1325;
transform: skewX(45deg);
}
@ -100,8 +100,8 @@
}
font-size: 18px;
width: 300px;
height: 50px;
line-height: 50px;
height: 40px;
line-height: 40px;
text-align: center;
transform: skewX(45deg);
background-color: #0f1325;
@ -123,13 +123,14 @@
}
.body-box {
margin-top: 16px;
margin-top: 5px;
display: flex;
flex-direction: column;
//下方区域的布局
.content-box {
display: grid;
margin-bottom: 15px;
grid-template-columns: 35% 15% 15% 15% 20%;
div{
box-sizing: border-box!important;

View File

@ -231,6 +231,15 @@
left: item.left + 'px',
width: item.widthMe + 'px'
}"
@mouseleave="lineMouseleave"
@mouseenter="
lineMouseenter(
`line${item.id}`,
$event,
item.id,
item.parentId,
index
)"
>
<div class="progress" :style="{ width: item.per + '%' }"></div>
</div>
@ -254,13 +263,15 @@
<span class="title">工作周期</span>
<span>{{ currentProjectMsg.allTime }}</span>
</div>
<div class="lineMsg" v-if="currentProjectMsg.per1">
<span class="title">订单计划</span>
<span>{{ currentProjectMsg.per }}</span>
<div class="lineMsg">
<span class="title">计划数量</span>
<span v-if="currentProjectMsg.per">{{ currentProjectMsg.per }}</span>
<span v-else>0</span>
</div>
<div class="lineMsg" v-if="currentProjectMsg.per1">
<div class="lineMsg">
<span class="title">当前进度</span>
<span>{{ currentProjectMsg.per1 }}</span>
<span v-if="currentProjectMsg.per1">{{ currentProjectMsg.per1 }}</span>
<span v-else>0</span>
</div>
<div class="lineMsg">
<span class="title">开始时间</span>

View File

@ -231,6 +231,15 @@
left: item.left + 'px',
width: item.widthMe + 'px'
}"
@mouseleave="lineMouseleave"
@mouseenter="
lineMouseenter(
`line${item.id}`,
$event,
item.id,
item.parentId,
index
)"
>
<div class="progress" :style="{ width: item.per + '%' }"></div>
</div>
@ -254,13 +263,15 @@
<span class="title">工作周期</span>
<span>{{ currentProjectMsg.allTime }}</span>
</div>
<div class="lineMsg" v-if="currentProjectMsg.per1">
<span class="title">当前进度</span>
<span>{{ currentProjectMsg.per }}</span>
<div class="lineMsg">
<span class="title">计划数量</span>
<span v-if="currentProjectMsg.per">{{ currentProjectMsg.per }}</span>
<span v-else>0</span>
</div>
<div class="lineMsg" v-if="currentProjectMsg.per1">
<span class="title">合格数量</span>
<span>{{ currentProjectMsg.per1 }}</span>
<div class="lineMsg">
<span class="title">当前进度</span>
<span v-if="currentProjectMsg.per1">{{ currentProjectMsg.per1 }}</span>
<span v-else>0</span>
</div>
<div class="lineMsg">
<span class="title">开始时间</span>

View File

@ -330,7 +330,7 @@ export const asyncRoutes = [
path: 'sales',
name: 'sales',
component: () => import('@/views/sam/sales'),
meta: { title: '销售信息', icon: 'saleInfo', perms: ['sam_sales'] }
meta: { title: '销售发货', icon: 'saleInfo', perms: ['sam_sales'] }
}
,
{

View File

@ -6,7 +6,7 @@
<el-icon class="el-icon-s-data"></el-icon>
</span>
<div class="d-flex">
<span class="fs-xl text mx-2">数据统计图</span>
<span class="fs-xl text mx-2">任务完成进度</span>
</div>
</div>
<div>
@ -32,41 +32,30 @@
options: {},
cdata: {
category: [
"市区",
"万州",
"江北",
"南岸",
"北碚",
"綦南",
"长寿",
"永川",
"璧山",
"江津",
"城口",
"大足",
"垫江",
"丰都",
"奉节",
"合川",
"江津区",
"开州",
"南川",
"彭水",
"黔江",
"石柱",
"铜梁",
"潼南",
"巫山",
"巫溪",
"武隆",
"秀山",
"酉阳",
"云阳",
"忠县",
"川东",
"检修"
"JH5jhx463-1",
"JH5jhx463-2",
"JH5jhx463-3",
"JH5jhx463-4",
"JH5jhx463-5",
"JH5jhx463-6",
"JH5jhx463-7",
"JH5jhx463-8",
"JH5jhx463-9",
"JH5jhx463-10",
"JH5jhx463-11",
"JH5jhx463-12",
"JH5jhx463-13",
"JH5jhx463-14",
"JH5jhx463-15"
],
lineData: [
planData: [
18092,
20728,
24045,
28348,
32808,
36097,
39867,
18092,
20728,
24045,
@ -75,40 +64,15 @@
36097,
39867,
44715,
48444,
50415,
56061,
62677,
59521,
67560,
18092,
20728,
24045,
28348,
32808,
36097,
39867,
44715,
48444,
50415,
36097,
39867,
44715,
48444,
50415,
50061,
32677,
49521,
32808
],
barData: [
4600,
5000,
5500,
6500,
7500,
8500,
9900,
9600,
19000,
19500,
20500,
19500,
28500,
31900,
12500,
14000,
21500,
@ -116,25 +80,7 @@
24450,
25250,
33300,
4600,
5000,
5500,
6500,
7500,
8500,
9900,
22500,
14000,
21500,
8500,
9900,
12500,
14000,
21500,
23200,
24450,
25250,
7500
40715
],
rateData: []
}
@ -147,10 +93,7 @@
cdata: {
handler(newData) {
this.options = {
title: {
text: "",
},
tooltip: {
/*tooltip: {
trigger: "axis",
backgroundColor: "rgba(255,255,255,0.1)",
axisPointer: {
@ -160,9 +103,47 @@
backgroundColor: "#7B7DDC"
}
}
},*/
tooltip: {
trigger: 'axis', //触发类型轴触发axis则鼠标hover到一条柱状图显示全部数据item则鼠标hover到折线点显示相应数据
axisPointer: { //坐标轴指示器坐标轴触发有效
type: 'cross', //默认为lineline直线cross十字准星shadow阴影
crossStyle: {
color: '#fff'
}
}
},
/*tooltip: {
trigger: 'item',
formatter: function (params) {
debugger;
console.log(params);
let color = params.color;//图例颜色
let htmlStr = '<div>';
htmlStr += params.name + '<br/>';
htmlStr += '<span style="height:10px;width:10px;font-size:12px;border-radius:5px;margin-right:5px;font-family:Consolas;display:inline-block;background:' + color + ';"></span>';
htmlStr += params.seriesName + '' + params.value + '%';
htmlStr += '</div>';
return htmlStr;
}
},
tooltip: {
//shared: true,
crosshairs: true,
valueSuffix: yAxisSuffix,
useHTML: true,
formatter: function() {
return "<div style='width:300px;word-wrap:break-word;white-space:normal;'>"
+"<b>录入时间: "+tipsbean[0][this.series.data.indexOf(this.point)].medDate+"</b><br/>"
+tipsbean[1][this.series.data.indexOf(this.point)].itemName+":"+tipsbean[1][this.series.data.indexOf(this.point)].medResult+"<br/>"
+tipsbean[2][this.series.data.indexOf(this.point)].itemName+":"+tipsbean[2][this.series.data.indexOf(this.point)].medResult+"<br/>"
+tipsbean[3][this.series.data.indexOf(this.point)].itemName+":"+tipsbean[3][this.series.data.indexOf(this.point)].medResult+"<br/>"
+tipsbean[0][this.series.data.indexOf(this.point)].itemName+":"+tipsbean[0][this.series.data.indexOf(this.point)].medResult+"<br/>"
+"</div>";
}
},*/
legend: {
data: ["已贯通", "计划贯通", "贯通率"],
data: ["完成", "计划完成"],
textStyle: {
color: "#B4B4B4"
},
@ -184,49 +165,22 @@
show: false
}
},
yAxis: [
{
splitLine: {show: false},
axisLine: {
lineStyle: {
color: "#B4B4B4"
}
},
axisLabel: {
formatter: "{value} "
yAxis:{
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: "#B4B4B4"
}
},
{
splitLine: {show: false},
axisLine: {
lineStyle: {
color: "#B4B4B4"
}
},
axisLabel: {
formatter: "{value} "
}
axisLabel: {
formatter: "{value} "
}
],
},
series: [
{
name: "贯通率",
type: "line",
smooth: true,
showAllSymbol: true,
symbol: "emptyCircle",
symbolSize: 8,
yAxisIndex: 1,
itemStyle: {
normal: {
color: "#F02FC2"
}
},
data: newData.rateData
},
{
name: "已贯通",
name: "已完成",
type: "bar",
barWidth: 10,
itemStyle: {
@ -241,7 +195,7 @@
data: newData.barData
},
{
name: "计划贯通",
name: "计划完成",
type: "bar",
barGap: "-100%",
barWidth: 10,
@ -256,7 +210,7 @@
}
},
z: -12,
data: newData.lineData
data: newData.planData
}
]
}
@ -269,7 +223,7 @@
// 根据自己的业务情况修改
setData() {
for (let i = 0; i < this.cdata.barData.length - 1; i++) {
let rate = this.cdata.barData[i] / this.cdata.lineData[i];
let rate = this.cdata.barData[i] / this.cdata.planData[i];
this.cdata.rateData.push(rate.toFixed(2));
}
},

View File

@ -6,367 +6,81 @@
<el-icon class="el-icon-s-marketing"></el-icon>
</span>
<div class="d-flex">
<span class="fs-xl text mx-2">工单修复以及满意度统计图</span>
<span class="fs-xl text mx-2">企业咨询</span>
<div class="decoration2">
<dv-decoration-2 :reverse="true" style="width:5px;height:6rem;" />
</div>
</div>
</div>
<div>
<Echart
:options="options"
id="centreLeft1Chart"
height="480px"
width="100%"
></Echart>
<div class="d-flex jc-center body-box">
<dv-scroll-board class="dv-scr-board" :config="config" />
</div>
</div>
</div>
</div>
</template>
<script>
import Echart from '@/components/echart'
export default {
data () {
return {
drawTiming: null,
cdata: {
year: null,
weekCategory: [],
radarData: [],
radarDataAvg: [],
maxData: 12000,
weekMaxData: [],
weekLineData: []
},
options: {},
// 定义颜色
colorList: {
linearYtoG: {
type: "linear",
x: 0,
y: 0,
x2: 1,
y2: 1,
colorStops: [
{
offset: 0,
color: "#f5b44d"
},
{
offset: 1,
color: "#28f8de"
}
]
},
linearGtoB: {
type: "linear",
x: 0,
y: 0,
x2: 1,
y2: 0,
colorStops: [
{
offset: 0,
color: "#43dfa2"
},
{
offset: 1,
color: "#28f8de"
}
]
},
linearBtoG: {
type: "linear",
x: 0,
y: 0,
x2: 1,
y2: 0,
colorStops: [
{
offset: 0,
color: "#1c98e8"
},
{
offset: 1,
color: "#28f8de"
}
]
},
areaBtoG: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(35,184,210,.2)"
},
{
offset: 1,
color: "rgba(35,184,210,0)"
}
]
}
cdata:{},
config: {
header: ['消息', '发布时间'],
data: [
['张思', '2022-03-05'],
['李森', '2022-03-05'],
['王师', '2022-03-05'],
['赵迪', '2022-03-05'],
['孟津', '2022-03-05'],
['张思', '2022-03-05'],
['李森', '2022-03-05'],
['王师', '2022-03-05'],
['赵迪', '2022-03-05'],
['孟津', '2022-03-05'],
['孙东课', '2022-03-05'],
['周神秘', '2022-03-05'],
['吴老弟', '2022-03-05'],
['郑成功', '2022-03-05'],
['冯宝宝', '2022-03-05']
],
rowNum: 15, //表格行数
headerHeight: 40,
headerBGC: '#0f1325', //表头
oddRowBGC: '#0f1325', //奇数行
evenRowBGC: '#171c33', //偶数行
index: false,
// columnWidth: [50],
align: ['center']
}
}
},
components: {
Echart
},
watch: {
cdata: {
handler (newData) {
this.options = {
title: {
text: "",
textStyle: {
color: "#D3D6DD",
fontSize: 24,
fontWeight: "normal"
},
subtext: newData.year + "/" + newData.weekCategory[6],
subtextStyle: {
color: "#fff",
fontSize: 16
},
top: 50,
left: 80
},
legend: {
top: 120,
left: 80,
orient: "vertical",
itemGap: 15,
itemWidth: 12,
itemHeight: 12,
data: ["平均指标", "我的指标"],
textStyle: {
color: "#fff",
fontSize: 14
}
},
tooltip: {
trigger: "item"
},
radar: {
center: ["68%", "27%"],
radius: "40%",
name: {
color: "#fff"
},
splitNumber: 8,
axisLine: {
lineStyle: {
color: this.colorList.linearYtoG,
opacity: 0.6
}
},
splitLine: {
lineStyle: {
color: this.colorList.linearYtoG,
opacity: 0.6
}
},
splitArea: {
areaStyle: {
color: "#fff",
opacity: 0.1,
shadowBlur: 25,
shadowColor: "#000",
shadowOffsetX: 0,
shadowOffsetY: 5
}
},
indicator: [
{
name: "服务态度",
max: newData.maxData
},
{
name: "产品质量",
max: 10
},
{
name: "任务效率",
max: 12
},
{
name: "售后保障",
max: 3.5
}
]
},
grid: {
left: 90,
right: 80,
bottom: 40,
top: "60%"
},
xAxis: {
type: "category",
position: "bottom",
axisLine: true,
axisLabel: {
color: "rgba(255,255,255,.8)",
fontSize: 12
},
data: newData.weekCategory
},
// 下方Y轴
yAxis: {
name: "工单",
nameLocation: "end",
nameGap: 24,
nameTextStyle: {
color: "rgba(255,255,255,.5)",
fontSize: 14
},
max: newData.maxData,
splitNumber: 4,
axisLine: {
lineStyle: {
opacity: 0
}
},
splitLine: {
show: true,
lineStyle: {
color: "#fff",
opacity: 0.1
}
},
axisLabel: {
color: "rgba(255,255,255,.8)",
fontSize: 12
}
},
series: [
{
name: "",
type: "radar",
symbolSize: 0,
data: [
{
value: newData.radarDataAvg[6],
name: "平均指标",
itemStyle: {
normal: {
color: "#f8d351"
}
},
lineStyle: {
normal: {
opacity: 0
}
},
areaStyle: {
normal: {
color: "#f8d351",
shadowBlur: 25,
shadowColor: "rgba(248,211,81,.3)",
shadowOffsetX: 0,
shadowOffsetY: -10,
opacity: 1
}
}
},
{
value: newData.radarData[6],
name: "我的指标",
itemStyle: {
normal: {
color: "#43dfa2"
}
},
lineStyle: {
normal: {
opacity: 0
}
},
areaStyle: {
normal: {
color: this.colorList.linearGtoB,
shadowBlur: 15,
shadowColor: "rgba(0,0,0,.2)",
shadowOffsetX: 0,
shadowOffsetY: 5,
opacity: 0.8
}
}
}
]
},
{
name: "",
type: "line",
smooth: true,
symbol: "emptyCircle",
symbolSize: 8,
itemStyle: {
normal: {
color: "#fff"
}
},
lineStyle: {
normal: {
color: this.colorList.linearBtoG,
width: 3
}
},
areaStyle: {
normal: {
color: this.colorList.areaBtoG
}
},
data: newData.weekLineData,
lineSmooth: true,
markLine: {
silent: true,
data: [
{
type: "average",
name: "平均值"
}
],
precision: 0,
label: {
normal: {
formatter: "平均值: \n {c}"
}
},
lineStyle: {
normal: {
color: "rgba(248,211,81,.7)"
}
}
},
tooltip: {
position: "top",
formatter: "{c} m",
backgroundColor: "rgba(28,152,232,.2)",
padding: 6
}
},
{
name: "占位背景",
type: "bar",
itemStyle: {
normal: {
show: true,
color: "#000",
opacity: 0
}
},
silent: true,
barWidth: "50%",
data: newData.weekMaxData,
animation: false
}
]
handler () {
this.config = {
header: ['消息', '发布时间'],
data: [
['张思', '2022-03-05'],
['李森', '2022-03-05'],
['王师', '2022-03-05'],
['赵迪', '2022-03-05'],
['孟津', '2022-03-05'],
['孙东课', '2022-03-05'],
['周神秘', '2022-03-05'],
['吴老弟', '2022-03-05'],
['郑成功', '2022-03-05'],
['冯宝宝', '2022-03-05']
],
rowNum: 15, //表格行数
headerHeight: 40,
headerBGC: '#0f1325', //表头
oddRowBGC: '#0f1325', //奇数行
evenRowBGC: '#171c33', //偶数行
index: false,
// columnWidth: [50],
align: ['center']
}
},
immediate: true,
@ -384,51 +98,42 @@ export default {
this.setData();
this.drawTiming = setInterval(() => {
this.setData();
}, 6000);
}, 3600000);
},
setData () {
// 清空轮询数据
this.cdata.weekCategory = [];
this.cdata.weekMaxData = [];
this.cdata.weekLineData = [];
this.cdata.radarData = [];
this.cdata.radarDataAvg = [];
let dateBase = new Date();
this.cdata.year = dateBase.getFullYear();
// 周数据
for (let i = 0; i < 7; i++) {
// 日期
let date = new Date();
this.cdata.weekCategory.unshift([date.getMonth() + 1, date.getDate()-i].join("/"));
// 折线图数据
this.cdata.weekMaxData.push(this.cdata.maxData);
let distance = Math.round(Math.random() * 11000 + 500);
this.cdata.weekLineData.push(distance);
// 雷达图数据
// 我的指标
let averageSpeed = +(Math.random() * 5 + 3).toFixed(3);
let maxSpeed = averageSpeed + +(Math.random() * 3).toFixed(2);
let hour = +(distance / 1000 / averageSpeed).toFixed(1);
let radarDayData = [distance, averageSpeed, maxSpeed, hour];
this.cdata.radarData.unshift(radarDayData);
// 平均指标
let distanceAvg = Math.round(Math.random() * 8000 + 4000);
let averageSpeedAvg = +(Math.random() * 4 + 4).toFixed(3);
let maxSpeedAvg = averageSpeedAvg + +(Math.random() * 2).toFixed(2);
let hourAvg = +(distance / 1000 / averageSpeed).toFixed(1);
let radarDayDataAvg = [
distanceAvg,
averageSpeedAvg,
maxSpeedAvg,
hourAvg
];
this.cdata.radarDataAvg.unshift(radarDayDataAvg);
this.config = {
header: ['消息', '发布时间'],
data: [
['张思', '2022-03-05'],
['李森', '2022-03-05'],
['王师', '2022-03-05'],
['赵迪', '2022-03-05'],
['孟津', '2022-03-05'],
['张思', '2022-03-05'],
['李森', '2022-03-05'],
['王师', '2022-03-05'],
['赵迪', '2022-03-05'],
['孟津', '2022-03-05'],
['孙东课', '2022-03-05'],
['周神秘', '2022-03-05'],
['吴老弟', '2022-03-05'],
['郑成功', '2022-03-05'],
['冯宝宝', '2022-03-05'],
['孙东课', '2022-03-05'],
['周神秘', '2022-03-05'],
['吴老弟', '2022-03-05'],
['郑成功', '2022-03-05'],
['冯宝宝', '2022-03-05']
],
rowNum: 15, //表格行数
headerHeight: 35,
headerBGC: '#0f1325', //表头
oddRowBGC: '#0f1325', //奇数行
evenRowBGC: '#171c33', //偶数行
index: false,
// columnWidth: [50],
align: ['center']
}
}
}
};
@ -438,17 +143,29 @@ export default {
$box-height: 520px;
$box-width: 100%;
#bottomRight {
padding: 14px 16px;
padding: 25px;
height: $box-height;
width: $box-width;
border-radius: 5px;
.bg-color-black {
height: $box-height - 30px;
height: $box-height - 50px;
border-radius: 10px;
}
.text {
color: #c3cbde;
}
.body-box {
border-radius: 10px;
overflow: hidden;
.dv-scr-board {
width: 100%;
height: 440px;
}
}
//下滑线动态
.decoration2 {
position: absolute;
@ -456,8 +173,12 @@ $box-width: 100%;
}
.chart-box {
margin-top: 16px;
width: 170px;
height: 170px;
/*width: 170px;*/
/*height: 170px;*/
.dv-scr-board {
width: 100%;
height: 340px;
}
.active-ring-name {
padding-top: 10px;
}

View File

@ -20,12 +20,12 @@
<span>
<el-icon class="el-icon-pie-chart"></el-icon>
</span>
<span class="fs-xl text mx-2 mb-1 pl-3">年度负责人组件达标榜</span>
<span class="fs-xl text mx-2 mb-1 pl-3">任务完成进度</span>
<dv-scroll-ranking-board class="dv-scr-rank-board mt-1" :config="ranking" />
</div>
<div class="percent">
<div class="item bg-color-black">
<span>今日任务通过</span>
<span>本月产品合格</span>
<CenterChart
:id="rate[0].id"
:tips="rate[0].tips"
@ -33,7 +33,7 @@
/>
</div>
<div class="item bg-color-black">
<span>今日任务达标</span>
<span>本月任务完成</span>
<CenterChart
:id="rate[1].id"
:tips="rate[1].tips"
@ -56,7 +56,7 @@ export default {
return {
titleItem: [
{
title: '今年累计合同数',
title: '本月合同数',
number: {
number: [12],//数字数值
toFixed: 0,//小数位数
@ -68,7 +68,7 @@ export default {
}
},
{
title: '本月累计订单数',
title: '本月生产订单数',
number: {
number: [12],
toFixed: 0,
@ -80,7 +80,7 @@ export default {
}
},
{
title: '今日在制任务数',
title: '本月在制任务数',
number: {
number: [2],
toFixed: 0,
@ -92,10 +92,10 @@ export default {
}
},
{
title: '本月累计交付产品数',
title: '本月交付产品数',
number: {
number: [8],
toFixed: 1,
toFixed: 0,
textAlign: 'left',
content: '{nt}',
style: {
@ -104,9 +104,21 @@ export default {
}
},
{
title: '今年成品合格率',
title: '本月不合格产品数',
number: {
number: [96],
number: [2],
toFixed: 0,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 26
}
}
},
{
title: '本月军检合格率',
number: {
number: [99],
toFixed: 1,
textAlign: 'left',
content: '{nt}%',
@ -115,18 +127,6 @@ export default {
}
}
},
{
title: '今年累计不合格产品数',
number: {
number: [2],
toFixed: 0,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 26
}
}
}
],
ranking: {
data: [
@ -172,7 +172,7 @@ export default {
rate: [
{
id: 'centerRate1',
tips: 60,
tips: 98,
colorData: {
textStyle: '#3fc0fb',
series: {
@ -186,7 +186,7 @@ export default {
},
{
id: 'centerRate2',
tips: 40,
tips: 99,
colorData: {
textStyle: '#67e0e3',
series: {

View File

@ -6,7 +6,7 @@
<el-icon class="el-icon-s-help"></el-icon>
</span>
<div class="d-flex">
<span class="fs-xl text mx-2">任务通过率</span>
<span class="fs-xl text mx-2">一车间</span>
<dv-decoration-3 class="dv-dec-3"/>
</div>
</div>
@ -56,7 +56,7 @@
fontSize: 24
}
},
text: '今日构建总'
text: '今日'
},
{
number: {
@ -68,7 +68,7 @@
fontSize: 24
}
},
text: '总共完成数'
text: '年累计完成'
},
{
number: {
@ -80,11 +80,11 @@
fontSize: 24
}
},
text: '正在编译数量'
text: '在制品数量'
},
{
number: {
number: [157],
number: [361],
toFixed: 1,
textAlign: 'left',
content: '{nt}',
@ -92,18 +92,16 @@
fontSize: 24
}
},
text: '未通过数量'
}
text: '不合格数量'
},
],
cdata: {
xData: ["data1", "data2", "data3", "data4", "data5", "data6"],
xData: ["冷加工", "热弯", "化学钢化"],
seriesData: [
{value: 10, name: "data1"},
{value: 5, name: "data2"},
{value: 15, name: "data3"},
{value: 25, name: "data4"},
{value: 20, name: "data5"},
{value: 35, name: "data6"}
{value: 25, name: "冷加工"},
{value: 20, name: "热弯"},
{value: 35, name: "化学钢化"}
]
}
}
@ -119,12 +117,11 @@
handler(newData) {
this.options = {
color: [
"#37a2da",
"#32c5e9",
"#9fe6b8",
"#ffdb5c",
"#ff9f7f",
"#fb7293",
"#ffdb5c",
"#9fe6b8",
"#ff9f7f",
"#32c5e9",
"#e7bcf3",
"#8378ea"
],

View File

@ -0,0 +1,237 @@
<template>
<div id="centerLeft1">
<div class="bg-color-black">
<div class="d-flex pt-2 pl-2">
<span>
<el-icon class="el-icon-s-help"></el-icon>
</span>
<div class="d-flex">
<span class="fs-xl text mx-2">二车间</span>
<dv-decoration-3 class="dv-dec-3"/>
</div>
</div>
<div class="d-flex jc-center">
<Echart
:options="options"
id="centreLeft1Chart"
height="220px"
width="260px"
></Echart>
</div>
<!-- 4个主要的数据 -->
<div class="bottom-data">
<div
class="item-box mt-2"
v-for="(item, index) in numberData"
:key="index"
>
<div class="d-flex">
<!--<span class="coin"></span>-->
<dv-digital-flop class="dv-digital-flop" :config="item.number"/>
</div>
<p class="text" style="text-align: center;">
{{ item.text }}
<span class="colorYellow">()</span>
</p>
</div>
</div>
</div>
</div>
</template>
<script>
import Echart from '@/components/echart'
export default {
data() {
return {
options: {},
numberData: [
{
number: {
number: [15],
toFixed: 1,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 24
}
},
text: '今日产量'
},
{
number: {
number: [1144],
toFixed: 1,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 24
}
},
text: '年累计完成量'
},
{
number: {
number: [361],
toFixed: 1,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 24
}
},
text: '在制品数量'
},
{
number: {
number: [361],
toFixed: 1,
textAlign: 'left',
content: '{nt}',
style: {
fontSize: 24
}
},
text: '不合格数量'
},
],
cdata: {
xData: ["镀膜", "夹层", "包边", "装框"],
seriesData: [
{value: 10, name: "镀膜"},
{value: 5, name: "夹层"},
{value: 15, name: "包边"},
{value: 25, name: "装框"}
]
}
}
},
components: {
Echart
},
mounted() {
this.changeTiming()
},
watch: {
cdata: {
handler(newData) {
this.options = {
color: [
"#fb7293",
"#ffdb5c",
"#9fe6b8",
"#ff9f7f",
"#32c5e9",
],
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
toolbox: {
show: true
},
calculable: true,
legend: {
orient: "horizontal",
icon: "circle",
bottom: 0,
x: "center",
data: newData.xData,
textStyle: {
color: "#fff"
}
},
series: [
{
name: "通过率统计",
type: "pie",
radius: [10, 50],
roseType: "area",
center: ["50%", "40%"],
data: newData.seriesData
}
]
}
},
immediate: true,
deep: true
}
},
methods: {
changeTiming() {
setInterval(() => {
this.changeNumber()
}, 3000)
},
changeNumber() {
this.numberData.forEach((item, index) => {
item.number.number[0] += ++index
item.number = {...item.number}
})
}
}
}
</script>
<style lang="scss" scoped>
$box-width: 300px;
$box-height: 410px;
#centerLeft1 {
padding: 16px;
height: $box-height;
width: 100%;
border-radius: 10px;
.bg-color-black {
height: $box-height - 30px;
border-radius: 10px;
}
.text {
color: #c3cbde;
}
.dv-dec-3 {
position: relative;
width: 100px;
height: 20px;
top: -3px;
}
.bottom-data {
.item-box {
& > div {
padding-right: 5px;
}
font-size: 14px;
float: right;
position: relative;
width: 50%;
color: #d3d6dd;
.dv-digital-flop {
width: 120px;
height: 30px;
}
// 金币
.coin {
position: relative;
top: 6px;
font-size: 20px;
color: #ffc107;
}
.colorYellow {
color: yellowgreen;
}
p {
text-align: center;
}
}
}
}
</style>

View File

@ -20,26 +20,26 @@ export default {
data() {
return {
config: {
header: ['姓名', '部门', '到岗'],
header: ['姓名', '部门', '到岗情况'],
data: [
['组件1', 'dev-1', "<span class='colorGrass'>已到岗</span>"],
['组件2', 'dev-2', "<span class='colorRed'>未到岗</span>"],
['组件3', 'dev-3', "<span class='colorGrass'>已到岗</span>"],
['组件4', 'rea-1', "<span class='colorGrass'>已到岗</span>"],
['组件5', 'rea-2', "<span class='colorGrass'>已到岗</span>"],
['组件6', 'fix-2', "<span class='colorGrass'>已到岗</span>"],
['组件7', 'fix-4', "<span class='colorGrass'>已到岗</span>"],
['组件8', 'fix-7', "<span class='colorRed'>未到岗</span>"],
['组件9', 'dev-2', "<span class='colorRed'>未到岗</span>"],
['组件10', 'dev-9', "<span class='colorGrass'>已到岗</span>"]
['张思', '一车间', "<span class='colorGrass'>已到岗</span>"],
['李森', '一车间', "<span class='colorGrass'>已到岗</span>"],
['王师', '一车间', "<span class='colorRed'>未到岗</span>"],
['赵迪', '一车间', "<span class='colorGrass'>已到岗</span>"],
['孟津', '一车间', "<span class='colorGrass'>已到岗</span>"],
['孙东课', '一车间', "<span class='colorGrass'>已到岗</span>"],
['周神秘', '二车间', "<span class='colorGrass'>已到岗</span>"],
['吴老弟', '二车间', "<span class='colorRed'>未到岗</span>"],
['郑成功', '二车间', "<span class='colorGrass'>已到岗</span>"],
['冯宝宝', '二车间', "<span class='colorGrass'>已到岗</span>"]
],
rowNum: 7, //表格行数
headerHeight: 35,
headerBGC: '#0f1325', //表头
oddRowBGC: '#0f1325', //奇数行
evenRowBGC: '#171c33', //偶数行
index: true,
columnWidth: [50],
index: false,
// columnWidth: [50],
align: ['center']
}
}

View File

@ -5,7 +5,7 @@
<span>
<el-icon class="el-icon-menu"></el-icon>
</span>
<span class="fs-xl text mx-2">产品销售渠道分析</span>
<span class="fs-xl text mx-2">工序成品率</span>
</div>
<div class="d-flex ai-center flex-column body-box heightCover">
<dv-capsule-chart class="dv-cap-chart" :config="config" />

View File

@ -30,44 +30,43 @@
<div class="d-flex aside-width">
<div class="react-left ml-4 react-l-s">
<span class="react-before"></span>
<span class="text">数据分析1</span>
<span class="text">数据统计</span>
</div>
<div class="react-right ml-3">
<span class="text">数据分析2</span>
<!--<span class="text">数据分析2</span>-->
</div>
</div>
<div class="d-flex aside-width">
<div class="react-right bg-color-blue mr-3">
<span class="text fw-b">车间详情展示</span>
<span class="text fw-b">车间详情</span>
</div>
<div class="react-right mr-4 react-l-s">
<span class="react-after"></span>
<span class="text"
>{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span
>
<span class="text">{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span>
</div>
</div>
</div>
<div class="body-box">
<!-- 第三行数据 -->
<div id="centerWrap" class="content-box">
<!-- 中间 -->
<!-- 数据统计 -->
<div>
<center />
</div>
<div>
<dv-border-box-1>
<centerLeft1 />
</dv-border-box-1>
</div>
<div>
<dv-border-box-1>
<centerLeft1 />
</dv-border-box-1>
</div>
<div>
<centerRight2 />
</div>
<div>
<dv-border-box-1>
<centerLeft1 />
</dv-border-box-1>
</div>
<div>
<dv-border-box-1>
<centerLeft2 />
</dv-border-box-1>
</div>
<div>
<dv-border-box-13>
<centerRight1 />
@ -93,6 +92,7 @@
import drawMixin from "../../utils/drawMixin";
import { formatTimeBigScreen } from '../../utils/index.js'
import centerLeft1 from './centerLeft1'
import centerLeft2 from './centerLeft2'
import centerRight1 from './centerRight1'
import centerRight2 from './centerRight2'
import center from './center'
@ -115,6 +115,7 @@
},
components: {
centerLeft1,
centerLeft2,
centerRight1,
centerRight2,
center,
@ -122,8 +123,8 @@
bottomRight
},
created(){
window.open('http://49.232.14.174:2222/#/index');
this.$router.go(-1)
// window.open('http://49.232.14.174:2222/#/index');
// this.$router.go(-1)
},
mounted() {
this.timeFn();

View File

@ -2,7 +2,8 @@
<div class="dashboard-container">
<div class="dashboardTopCard">
<div class="CardTitleWrap">
<span class="verticalLine"></span><span class="dashboardCardTitle">数据统计</span>
<span class="verticalLine"></span>
<span class="dashboardCardTitle">数据统计</span>
</div>
<div style="padding: 20px;overflow: hidden;">
<div class="cardsWrap" @click="toDetail('1')">
@ -38,7 +39,6 @@
<div class="cardsWrap" @click="toDetail('3')">
<div class="svgIconWrap">
<el-icon class="el-icon-s-operation svgIcon"></el-icon>
<!--<svg-icon class="svgIcon" icon-class="productionTask" :className="'svgIcon'"/>-->
</div>
<div class="totalCountWrap">
<span class="totalCountText">本月在制任务</span>
@ -51,7 +51,6 @@
<div class="cardsWrap" @click="toDetail('4')">
<div class="svgIconWrap">
<el-icon class="el-icon-s-claim svgIcon"></el-icon>
<!--<svg-icon icon-class="product" class="svgIcon" :className="'svgIcon'"/>-->
</div>
<div class="totalCountWrap">
<span class="totalCountText">本月交付产品</span>
@ -64,7 +63,6 @@
<div class="cardsWrap" @click="toDetail('5')">
<div class="svgIconWrap">
<el-icon class="el-icon-error svgIcon"></el-icon>
<!--<svg-icon icon-class="unqualified" class="svgIcon" :className="'svgIcon'"/>-->
</div>
<div class="totalCountWrap">
<span class="totalCountText">本月不合格产品</span>
@ -91,7 +89,7 @@
></gantt>
</div>
</div>
<div style="width: 34%;position:relative;float: right" >
<div style="width: 34%;position:relative;float: right">
<div class="CardTitleWrap">
<span class="verticalLine"></span><span class="dashboardCardTitle">成品率</span>
</div>
@ -137,10 +135,11 @@
</div>
<div class="dashboardCardPadding">
<el-table
small
v-loading="listLoadingEm"
small
:data="equipmentList"
fit stripe
fit
stripe
size="mini"
:height="cardTabelHeight"
pager-count="3"
@ -179,14 +178,6 @@
</div>
</template>
</el-table-column>
<!-- <el-table-column label="下次校准日期" prop="model">
<template slot-scope="scope">
<el-tag v-if="scope.row.next_check_date" :type="setClass(scope.row.next_check_date)">
{{scope.row.next_check_date}}
</el-tag>
<div v-else></div>
</template>
</el-table-column>-->
</el-table>
</div>
</div>
@ -221,7 +212,8 @@
<el-table
v-loading="listLoadingUser"
:data="userList"
fit stripe
fit
stripe
size="mini"
:height="cardTabelHeight"
style="border-top: 1px solid #f5f5f5;"
@ -284,8 +276,8 @@
</ul>
</el-tab-pane>
<el-tab-pane label="临近交货" name="临近交货">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<li class="listItem" v-for="(item,$index) in warningList" :key="$index">
<div class="itemText">
<span>{{item.name}}({{item.number}})</span><span>{{item.delivery_date}}为交货日期</span>
@ -294,18 +286,18 @@
</ul>
</el-tab-pane>
<el-tab-pane label="过期提醒" name="过期提醒">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<li class="listItem" v-for="(item,$index) in warningList" :key="$index">
<div class="itemText">
<span>{{item.name}}({{item.number}})</span><span>{{item.delivery_date}}到期</span>
<span>{{item.name}}({{item.unit}})</span><span>{{item.expiration_date}}到期</span>
</div>
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="设备检测" name="设备检测">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<li class="listItem" v-for="(item,$index) in warningList" :key="$index"
:class="{nearStatus:item.warningType===1,outStatus:item.warningType===2}">
<div class="itemText">
@ -317,12 +309,12 @@
</ul>
</el-tab-pane>
<el-tab-pane label="任务到期" name="任务到期">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()"
@mouseleave="Up()">
<li class="listItem" v-for="(item,$index) in warningList" :key="$index"
:class="{nearStatus:item.warningType===1,outStatus:item.warningType===2}">
<div class="itemText">
<span>{{item.name}}({{item.number}})</span>
<span>{{item.name}}{{item.number}}</span>
<span v-if="item.warningType===1">接近计划日期</span>
<span v-else>已过计划日期</span>
</div>
@ -339,16 +331,15 @@
<script>
import echarts from 'echarts'
import {mapGetters} from 'vuex';
// import {getUserList} from "@/api/user";
import {getEmployee} from "@/api/hrm";
import {getMaterialList} from "@/api/mtm";
import {getProductionplanList} from "@/api/pm";
import {getmaterialbatchList} from "@/api/inm";
import gantt from "@/components/Gantt/dashGantt";
import {getpEquipmentList} from "@/api/equipment";
import {getProcessYield ,getPlanGantt} from "@/api/srm";
import {getContractList , getOrderList} from "@/api/sam";
import { getToken } from '@/utils/auth' // get token from cookie
import {getProcessYield, getPlanGantt} from "@/api/srm";
import {getContractList, getOrderList} from "@/api/sam";
import {getToken} from '@/utils/auth' // get token from cookie
export default {
components: {gantt},
name: 'Dashboard',
@ -360,6 +351,7 @@
animateUser: false,
chartColumn: null,
week: null,
nowHour: null,//当前时间的小时数
currentTime: null,
currentYear: null,
currentMonth: null,
@ -434,7 +426,7 @@
},
watch: {
'$route.path': function (newVal) {
if(newVal==='/dashboard') {
if (newVal === '/dashboard') {
this.getUserList();//用户列表
this.getEquipmentList();//设备列表
this.getGanttData();//甘特图数据
@ -444,28 +436,30 @@
}
},
methods: {
setClass:function(check_date) {
setClass: function (check_date) {
let obj = {};
if(check_date!=null){
if (check_date != null) {
let dat = new Date();
let time = dat.getTime();
let check = new Date(check_date).getTime();
let timeDiffer = (check-time)/1000/60/60/24;
if (4>timeDiffer&&timeDiffer>0) {
let timeDiffer = (check - time) / 1000 / 60 / 60 / 24;
if (4 > timeDiffer && timeDiffer > 0) {
obj = 'warning';
}else if (timeDiffer<0) {
} else if (timeDiffer < 0) {
obj = "danger";
}
}
return obj;
},
getNoticeData() {
this.ScrollUp();
},
ScrollUp() {
let that = this;
that.intNum = setInterval(() => {
if(that.warningList.length>3){
if (that.warningList.length > 3) {
that.animate = true;
setTimeout(() => {
that.warningList.push(that.warningList[0]);
@ -475,13 +469,16 @@
}
}, 3000);
},
//鼠标移上去停止
Stop() {
clearInterval(this.intNum);
},
Up() {
this.ScrollUp();
},
getStatisticsData() {
let that = this;
let dat = new Date();
@ -551,13 +548,14 @@
}
});
//获取库存警告
getMaterialList({page: 1, page_size:that.warningPageSize,tag: 'low_inm'}).then((response) => {
getMaterialList({page: 1, page_size: that.warningPageSize, tag: 'low_inm'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
}
});
},
//设备列表
getEquipmentList() {
let that = this;
@ -571,6 +569,7 @@
that.listLoadingEm = false;
});
},
//设备分页跳转
handleEquipmentCurrentChange(val) {
let that = this;
@ -584,11 +583,12 @@
that.listLoadingEm = false;
});
},
//用户列表
getUserList() {
let that = this;
that.listLoadingUser = true;
that.userPage =1;
that.userPage = 1;
getEmployee({page: that.userPage, page_size: that.userPageSize}).then((response) => {
if (response.data) {
that.userList = response.data.results;
@ -598,12 +598,17 @@
that.listLoadingUser = false;
});
},
//用户分页跳转
handleUserCurrentChange(val) {
let that = this;
that.listLoadingUser = true;
that.userPage = val;
getEmployee({page: val, page_size: that.userPageSize, fields: 'id,name,dept_name,is_atwork'}).then((response) => {
getEmployee({
page: val,
page_size: that.userPageSize,
fields: 'id,name,dept_name,is_atwork'
}).then((response) => {
if (response.data) {
that.userList = response.data.results;
that.userTotal = response.data.count;
@ -612,6 +617,7 @@
that.listLoadingUser = false;
});
},
userScroll() {
let that = this;
that.intNumUser = setInterval(() => {
@ -623,13 +629,16 @@
}, 3000)
}, 3000);
},
//鼠标移上去停止
stopScroll() {
clearInterval(this.intNumUser);
},
toScroll() {
this.userScroll();
},
//去往工作流页面
gotoTicketPage() {
let path = this.$route.path;
@ -639,6 +648,7 @@
this.$router.push({name: 'ticket', params: {}})
}
},
//图标渲染
drawChart() {
let that = this;
@ -720,34 +730,6 @@
offset: 1,
color: '#409EFF'
}]),
/*color: function(params) {
let colorList = [
['#5fcdc2','#ffffff'],
['#FFA783','#ffffff'],
['#D099FF','#ffffff'],
['#83FFC0','#ffffff'],
['#FF83D8','#ffffff'],
['#FFE899','#ffffff'],
['#83FFE9','#ffffff'],
];
let colorItem = colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(0,1,0,0,[
{
color: colorItem[0]
},
{
color: colorItem[1]
}
]);
},*/
/*color: function(params) {
let colorList = [
'#5fcdc2','#a378e4','#fea94c','#f27197',
'#409eff','#5fcdc2','#a378e4','#fea94c'
];
return colorList[params.dataIndex]
},*/
}
},
}]
@ -762,11 +744,12 @@
} else if (index === '3') {
this.$router.push({name: 'management', params: {page: 1, page_size: 20}})
} else if (index === '4') {
this.$router.push({name: 'product'})
this.$router.push({name: 'sales'})
} else if (index === '5') {
this.$router.push({name: 'unproduct'})
}
},
//选择月份
searchTimeChange(index) {
let that = this;
@ -796,51 +779,62 @@
});
}
},
//提示
activeNameClick() {
let that = this;
that.warningPage = 1;
that.warningList = [];
if (that.activeName === '库存警告') {
getMaterialList({page: 1, page_size:that.warningPageSize, tag: 'low_inm'}).then((response) => {
getMaterialList({page: 1, page_size: that.warningPageSize, tag: 'low_inm'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
}
});
} else if (that.activeName === '临近交货') {
getOrderList({page: 1, page_size:that.warningPageSize,tag:'near_delivery'}).then((response) => {
getOrderList({page: 1, page_size: that.warningPageSize, tag: 'near_delivery'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
}
});
} else if (that.activeName === '过期提醒') {
getmaterialbatchList({page: 1, page_size:that.warningPageSize, tag: 'expired'}).then((response) => {
getmaterialbatchList({page: 1, page_size: that.warningPageSize, tag: 'expired'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
let warningList = response.data.results;
let arr = [];
warningList.forEach(item => {
let obj = new Object();
obj.name = item.material_.name;
obj.unit = item.material_.unit;
obj.id = item.id;
obj.expiration_date = item.expiration_date;
arr.push(obj)
});
that.warningList = arr;
that.warningTotal = response.data.count;
}
});
}else if (that.activeName === '设备检测') {
} else if (that.activeName === '设备检测') {
that.warningPageSize = 100;
let warningList = [];
getpEquipmentList({page: 0,tag:'near_done'}).then((response) => {
getpEquipmentList({page: 0, tag: 'near_done'}).then((response) => {
if (response.data) {
let results = response.data;
if(results.length>0){
results.forEach(item=>{
if (results.length > 0) {
results.forEach(item => {
let obj = new Object();
obj = item;
obj.warningType = 1;
warningList.push(obj);
});
}
getpEquipmentList({page: 0,tag:'out_done'}).then((res) => {
getpEquipmentList({page: 0, tag: 'out_done'}).then((res) => {
if (response.data) {
let resData = res.data;
if(resData.length>0){
resData.forEach(item=>{
if (resData.length > 0) {
resData.forEach(item => {
let obj1 = new Object();
obj1 = item;
obj1.warningType = 2;
@ -853,24 +847,24 @@
});
}
});
}else if (that.activeName === '任务到期') {
} else if (that.activeName === '任务到期') {
that.warningPageSize = 100;
let warningList = [];
getProductionplanList({page: 0,tag:'near_done'}).then((response) => {
getProductionplanList({page: 0, tag: 'near_done'}).then((response) => {
if (response.data) {
let results = response.data;
if(results.length>0){
results.forEach(item=>{
if (results.length > 0) {
results.forEach(item => {
let obj = new Object();
obj = item;
obj.warningType = 1;
warningList.push(obj);
});
}
getProductionplanList({page: 0,tag:'out_done'}).then((res) => {
getProductionplanList({page: 0, tag: 'out_done'}).then((res) => {
if (response.data) {
let resData = res.data;
if(resData.length>0) {
if (resData.length > 0) {
resData.forEach(item => {
let obj1 = new Object();
obj1 = item;
@ -886,29 +880,31 @@
});
}
},
handleWarningSizeChange(val) {
this.warningPageSize = val;
this.warningPage = 1;
},
handleWarningCurrentChange(val) {
let that = this;
that.warningPage = val;
if (that.activeName === '库存警告') {
getMaterialList({page: val, page_size:that.warningPageSize, tag: 'low_inm'}).then((response) => {
getMaterialList({page: val, page_size: that.warningPageSize, tag: 'low_inm'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
}
});
} else if (that.activeName === '临近交货') {
getOrderList({page: val, page_size:that.warningPageSize,tag:'near_delivery'}).then((response) => {
getOrderList({page: val, page_size: that.warningPageSize, tag: 'near_delivery'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
}
});
} else if (that.activeName === '过期提醒') {
getmaterialbatchList({page: val, page_size:that.warningPageSize, tag: 'expired'}).then((response) => {
getmaterialbatchList({page: val, page_size: that.warningPageSize, tag: 'expired'}).then((response) => {
if (response.data) {
that.warningList = response.data.results;
that.warningTotal = response.data.count;
@ -916,6 +912,7 @@
});
}
},
getGanttData() {
let that = this;
getPlanGantt({}).then(res => {
@ -934,6 +931,7 @@
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.per1 = item.count_ok;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
@ -957,7 +955,7 @@
objChild.endTime = end;
objChild.planTime = [start, end];
objChild.per = child.count;
objChild.per1 = child.count_real;
objChild.per1 = child.count_ok;
objChild.type = 1;
objChild.productName = child.product_.name;
objChild.productNum = child.product_.specification;
@ -973,7 +971,7 @@
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.per1 = item.count_real;
obj.per1 = item.count_ok;
obj.type = 3;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
@ -988,65 +986,75 @@
}
})
},
refreshBottomTabel(index){
if(index==='1') {//生产设备
refreshBottomTabel(index) {
if (index === '1') {//生产设备
this.getEquipmentList();//设备列表
}else if(index==='2'){//人员到岗
} else if (index === '2') {//人员到岗
this.getUserList();//用户列表
}else{//提醒
} else {//提醒
this.activeNameClick();
}
},
},
refreshDataFrequently(){
refreshDataFrequently() {
let that = this;
let hasToken = getToken();
this.timer = window.setInterval(() => {
setTimeout(() => {
if (hasToken) {
that.getUserList();//用户列表
that.getEquipmentList();//设备列表
that.getGanttData();//甘特图数据
that.getStatisticsData();//统计数据
that.getNoticeData();//提醒列表
}
},0)
},120000)//2分钟
if (hasToken) {
this.timer = window.setInterval(() => {
setTimeout(() => {
if (that.nowHour > 7 && that.nowHour < 10) {
that.getUserList();//用户列表
that.getEquipmentList();//设备列表
that.getGanttData();//甘特图数据
that.getStatisticsData();//统计数据
that.getNoticeData();//提醒列表
} else {
that.refreshDataSlowly();
}
}, 0)
}, 120000)//2分钟
}
},
refreshDataSlowly(){
refreshDataSlowly() {
let that = this;
let hasToken = getToken();
this.timer = window.setInterval(() => {
setTimeout(() => {
if (hasToken) {
that.getUserList();//用户列表
that.getEquipmentList();//设备列表
that.getGanttData();//甘特图数据
that.getStatisticsData();//统计数据
that.getNoticeData();//提醒列表
}
},0)
},3600000)//1小时1000*10*60
if (hasToken) {
this.timer = window.setInterval(() => {
setTimeout(() => {
if (that.nowHour > 7 && that.nowHour < 10) {
that.refreshDataFrequently();
} else {
that.getUserList();//用户列表
that.getEquipmentList();//设备列表
that.getGanttData();//甘特图数据
that.getStatisticsData();//统计数据
that.getNoticeData();//提醒列表
}
}, 0)
}, 3600000)//1小时1000*10*60
}
},
},
mounted() {
let hei = document.getElementsByClassName('app-main')[0].clientHeight;
let heig = document.getElementsByClassName('dashboardTopCard')[0].clientHeight;
let domHeight = ((hei - heig - 140) / 2);
this.cardTabelHeight = domHeight-37;
this.ganttHeight = domHeight+35;
this.cardTabelHeight = domHeight - 37;
this.ganttHeight = domHeight + 35;
document.getElementById('chartColumn').style.height = domHeight + 'px';
this.getUserList();//用户列表
this.getEquipmentList();//设备列表
this.getGanttData();//甘特图数据
this.getStatisticsData();//统计数据
this.getNoticeData();//提醒列表
// this.refreshCountData();
let nowDate = new Date();
let nowHour = nowDate.getHours();
if(nowHour>7&&nowHour<10){
this.nowHour = nowHour;
if (nowHour > 7 && nowHour < 10) {
this.refreshDataFrequently();
}else{
} else {
this.refreshDataSlowly();
}
},
@ -1060,9 +1068,11 @@
.el-card.is-always-shadow {
height: auto !important;
}
.dashboard-container {
margin: 5px 6px;
}
.dashboardTopCard, .dashboardMiddle, .dashboardBottomRow {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
@ -1072,13 +1082,16 @@
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
}
.dashboardBottomRow {
margin-bottom: 0;
}
.dashboardCardPadding {
overflow: hidden;
padding: 5px 20px 20px 20px;
}
/**/
.cardsWrap {
display: flex;
@ -1087,70 +1100,86 @@
float: left;
font-size: 14px;
}
.svgIconWrap {
margin-right: 20px;
width: 50px;
height: 50px;
border-radius: 15px;
text-align: center;
.svgIcon {
font-size: 24px;
margin-top: 13px
}
}
.cardsWrap:nth-child(1) {
.svgIconWrap {
background: #e9f3ff;
.svgIcon {
color: #409EFF;
fill: #409EFF;
}
}
}
.cardsWrap:nth-child(2) {
.svgIconWrap {
background: #fff1de;
.svgIcon {
color: #ffb23f;
}
}
}
.cardsWrap:nth-child(3) {
.svgIconWrap {
background: #d9f6d8;
.svgIcon {
color: #54cb48;
}
}
}
.cardsWrap:nth-child(4) {
.svgIconWrap {
background: #f0e8fd;
.svgIcon {
color: #a378e4;
}
}
}
.cardsWrap:nth-child(5) {
.svgIconWrap {
background: #f7e5ea;
.svgIcon {
color: #f27197;
}
}
}
.totalCountText {
height: 20px;
line-height: 20px
}
.totalCountNum {
height: 30px;
}
.totalCount {
font-size: 25px;
font-weight: bold;
color: #626262;
}
/**/
.CardTitleWrap {
display: flex;
@ -1167,6 +1196,7 @@
margin-right: 7px;
margin-top: 8px;
}
.dashboardCardTitle {
height: 34px;
line-height: 34px;
@ -1176,6 +1206,7 @@
vertical-align: middle;
margin-right: 7px;
}
.stockMore {
font-size: 12px;
font-weight: normal;
@ -1183,14 +1214,17 @@
cursor: pointer;
}
}
/*成品率筛选条件*/
.dashboardCardHand {
display: flex;
padding-left: 1%;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
.dashboardCardFilter {
display: flex;
.convenientWrap {
display: flex;
border: 1px solid #DCDFE6;
@ -1199,19 +1233,23 @@
line-height: 30px;
margin-left: 10px;
font-size: 12px;
.convenientBtn {
cursor: pointer;
width: 50px;
text-align: center;
border-right: 1px solid #DCDFE6;
}
.convenientBtn:last-child {
border-right: 0;
border-radius: 0 6px 6px 0;
}
.convenientBtn:first-child {
border-radius: 6px 0 0 6px;
}
.activeIndex {
color: #ffffff;
background: #409EFF;
@ -1219,16 +1257,19 @@
}
}
}
.refreshIcon{
.refreshIcon {
color: #409EFF;
font-weight: bold;
font-size: 18px;
cursor: pointer;
}
.anim {
transition: all 0.5s;
margin-top: -35px; //高度等于行高
}
.lists {
height: 100%;
line-height: 35px;
@ -1236,28 +1277,35 @@
overflow-y: scroll;
padding-right: 40px;
margin: 0 !important;
.listItem {
height: 40px;
line-height: 40px;
font-size: 12px;
.itemText {
display: flex;
justify-content: space-between;
}
}
}
.nearStatus{
.nearStatus {
color: #e6a23c;
}
.outStatus{
.outStatus {
color: #f56c6c;
}
#chartColumn > div {
height: 100% !important;
canvas {
height: 100% !important;
}
}
#dashboardMiddle .el-range-editor--medium.el-input__inner,
#dashboardMiddle .el-range-editor.el-input__inner {
height: 30px !important;

View File

@ -2,34 +2,40 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增设备</el-button
>
<el-input
v-model="listQuery.search"
placeholder="设备名称/设备编号/备注"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<el-button
v-if="checkPermission(['equipment_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增设备
</el-button>
<el-input
v-model="listQuery.search"
placeholder="设备名称/设备编号/备注"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="equipmentList.results"
@ -37,92 +43,82 @@
fit
stripe
highlight-current-row
height="100"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="设备名称" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="设备名称" prop="name" width="120" show-overflow-tooltip>
</el-table-column>
<el-table-column label="设备编号" width="120">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="设备编号" prop="number" width="120">
</el-table-column>
<el-table-column label="型号规格" width="120">
<template slot-scope="scope">{{ scope.row.model }}</template>
<el-table-column label="型号规格" prop="model" width="120">
</el-table-column>
<el-table-column label="生产厂及国别" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.factory }}</template>
<el-table-column label="生产厂及国别" prop="factory" width="120" show-overflow-tooltip>
</el-table-column>
<el-table-column label="生产日期" width="120">
<template slot-scope="scope">{{ scope.row.production_date }}</template>
<el-table-column label="生产日期" prop="production_date" width="120">
</el-table-column>
<el-table-column label="购置日期" width="120">
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
<el-table-column label="购置日期" prop="buy_date" width="120">
</el-table-column>
<el-table-column label="数量" width="120">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column label="数量" prop="count" width="120">
</el-table-column>
<el-table-column label="状态" width="120">
<el-table-column label="状态" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }}
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30" >
{{ state_[scope.row.state] }}
<el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="技术指标" width="120" show-overflow-tooltip>
<el-table-column label="技术指标" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.parameter }}</template>
</el-table-column>
<el-table-column label="保管人" width="120">
<el-table-column label="保管人" width="120">
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
</el-table-column>
<el-table-column label="存放位置" width="120" show-overflow-tooltip>
<el-table-column label="存放位置" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.place }}</template>
</el-table-column>
<el-table-column label="绑定工序" width="120" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.step_">
<el-table-column label="绑定工序" width="120" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.step_">
<el-tag v-for="item in scope.row.step_"
:key="item.number"
:label="item.name"
:value="item.number">{{item.name}}</el-tag>
:value="item.number">{{item.name}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="120px"
fixed="right"
fixed="right"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['equipment_update'])"
type="primary"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['equipment_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -146,72 +142,70 @@
label-position="right"
:rules="rule1"
>
<el-row>
<el-col :span="12">
<el-form-item label="设备名称" prop="name">
<el-input v-model="equipment.name" placeholder="设备名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="count">
<el-input v-model="equipment.count" placeholder="数量" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="厂商及国别" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="production_date">
<el-date-picker
v-model="equipment.production_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购置日期" prop="buy_date">
<el-date-picker
v-model="equipment.buy_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="设备名称" prop="name">
<el-input v-model="equipment.name" placeholder="设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="状态" prop="state">
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-col :span="12">
<el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="count">
<el-input v-model="equipment.count" placeholder="数量"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="厂商及国别" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别"/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="production_date">
<el-date-picker
v-model="equipment.production_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购置日期" prop="buy_date">
<el-date-picker
v-model="equipment.buy_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="状态" prop="state">
<el-select style="width: 100%" v-model="equipment.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-form-item label="技术指标" prop="parameter">
<el-input
type="textarea"
:rows="4"
@ -219,38 +213,35 @@
placeholder="技术指标"
/>
</el-form-item>
<el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="所属部门" prop="belong_dept">
<el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader" style="width:100%" v-model="equipment.belong_dept"></el-cascader>
<el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="所属部门" prop="belong_dept">
<el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader"
style="width:100%" v-model="equipment.belong_dept"></el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保管人" prop="keeper">
<el-select
v-model="equipment.keeper"
filterable
style="width: 100%"
allow-create
default-first-option
placeholder="请选择">
<el-option
v-for="item in keeperOptions"
<el-col :span="12">
<el-form-item label="保管人" prop="keeper">
<el-select
v-model="equipment.keeper"
filterable
style="width: 100%"
allow-create
default-first-option
placeholder="请选择">
<el-option
v-for="item in keeperOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="设备备注" prop="description">
<el-input
type="textarea"
@ -259,15 +250,6 @@
placeholder="设备备注"
/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -277,33 +259,33 @@
</div>
</template>
<script>
import { getpEquipmentList, createEquipment,updateEquipment,deleteEquipment } from "@/api/equipment";
import { getUserList } from "@/api/user";
import { getOrgList } from "@/api/org";
import checkPermission from "@/utils/permission";
import {getpEquipmentList, createEquipment, updateEquipment, deleteEquipment} from "@/api/equipment";
import {getUserList} from "@/api/user";
import {getOrgList} from "@/api/org";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
name: "",
number: "",
};
export default {
components: { Pagination },
data() {
return {
equipment: defaultequipment,
equipmentList: {
count: 0,
},
state_:{
10:'完好',
20:'限用',
30:'在修',
40:'禁用',
},
options: [{
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
name: "",
number: "",
};
export default {
components: {Pagination},
data() {
return {
equipment: defaultequipment,
equipmentList: {
count: 0,
},
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
},
options: [{
value: 10,
label: '完好'
}, {
@ -316,130 +298,135 @@ export default {
value: 40,
label: '禁用'
}],
listQuery: {
page: 1,
page_size: 20,
},
keeperOptions:[],
depOptions:[],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
type: [{ required: true, message: "请输入", trigger: "blur" }],
model: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ required: true, message: "请选择", trigger: "blur" }],
belong_dept:[{ required: true, message: "请选择", trigger: "blur" }]
},
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getUserList();
this.getOrgList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type=1;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
listQuery: {
page: 1,
page_size: 20,
},
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{required: true, message: "请输入", trigger: "blur"}],
type: [{required: true, message: "请输入", trigger: "blur"}],
model: [{required: true, message: "请输入", trigger: "blur"}],
state: [{required: true, message: "请选择", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
},
};
},
//组员列表
getUserList() {
getUserList({pageoff:true}).then((res) => {
this.keeperOptions = genTree(res.data);
});
},
//部门列表
getOrgList() {
getOrgList({pageoff:true}).then((res) => {
this.depOptions = genTree(res.data);
});
computed: {},
watch: {},
created() {
this.getList();
this.getUserList();
this.getOrgList();
},
methods: {
checkPermission,
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type=1;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type = 1;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
} else {
return false;
this.listLoading = false;
});
},
//组员列表
getUserList() {
getUserList({pageoff: true}).then((res) => {
this.keeperOptions = genTree(res.data);
});
},
//部门列表
getOrgList() {
getOrgList({pageoff: true}).then((res) => {
this.depOptions = genTree(res.data);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
});
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type = 1;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
},
},
};
};
</script>

View File

@ -2,9 +2,14 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增设备</el-button
<el-button
v-if="checkPermission(['equipment_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增设备
</el-button>
<el-input
v-model="listQuery.search"
placeholder="检测设备名称/检测设备编号/备注"
@ -17,39 +22,39 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="equipmentList.results"
border
fit
stripe
height="100"
v-el-height-adaptive-table="{ bottomOffset: 42 }"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="设备编号" width="100">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="管理类别">
<template slot-scope="scope">{{
mgmtype_[scope.row.mgmtype]
}}</template>
<template slot-scope="scope">
{{mgmtype_[scope.row.mgmtype]}}
</template>
</el-table-column>
<el-table-column label="校/检方式" width="100">
<el-table-column label="校/检方式" width="100">
<template slot-scope="scope">{{ waytype_[scope.row.way] }}</template>
</el-table-column>
<el-table-column label="标准/依据" width="100">
@ -63,13 +68,12 @@
</el-table-column>
<el-table-column label="下次校准日期" width="130">
<template slot-scope="scope">
<el-tag v-if="scope.row.next_check_date" :type="setClass(scope.row.next_check_date)">
{{scope.row.next_check_date}}
</el-tag>
<div v-else></div></template
>
<el-tag v-if="scope.row.next_check_date" :type="setClass(scope.row.next_check_date)">
{{scope.row.next_check_date}}
</el-tag>
<div v-else></div>
</template>
</el-table-column>
<el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
@ -83,23 +87,20 @@
<el-table-column label="使用类别">
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
</el-table-column>
<el-table-column label="校/检状态" width="100">
<el-table-column label="校/检状态" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="保管人">
<template slot-scope="scope" v-if="scope.row.keeper_">{{
scope.row.keeper_.username
}}</template>
<template slot-scope="scope" v-if="scope.row.keeper_">
{{scope.row.keeper_.username}}
</template>
</el-table-column>
<el-table-column label="存放位置" width="100">
<template slot-scope="scope">{{ scope.row.place }}</template>
@ -111,28 +112,30 @@
:key="item.number"
:label="item.name"
:value="item.number"
>{{ item.name }}</el-tag
>
{{ item.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="120px">
<el-table-column align="center" label="操作" fixed="right" width="120px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['equipment_update'])"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['equipment_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -159,19 +162,19 @@
<el-row>
<el-col :span="12">
<el-form-item label="设备名称" prop="name">
<el-input v-model="equipment.name" placeholder="设备名称" />
<el-input v-model="equipment.name" placeholder="设备名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="number">
<el-input v-model="equipment.number" placeholder="设备编号" />
<el-input v-model="equipment.number" placeholder="设备编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="型号规格" prop="model">
<el-input v-model="equipment.model" placeholder="规格型号规格" />
<el-input v-model="equipment.model" placeholder="规格型号规格"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -183,7 +186,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="校/检状态" prop="state">
@ -223,7 +225,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" />
<el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -267,7 +269,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="存放位置" prop="place">
<el-input v-model="equipment.place" placeholder="存放位置" />
<el-input v-model="equipment.place" placeholder="存放位置"/>
</el-form-item>
</el-col>
</el-row>
@ -298,11 +300,9 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item label="生产厂家" prop="factory">
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
<el-input v-model="equipment.factory" placeholder="生产厂商及国别"/>
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input
type="textarea"
@ -321,230 +321,235 @@
</template>
<script>
import {
getpEquipmentList,
createEquipment,
updateEquipment,
deleteEquipment,
} from "@/api/equipment";
import { getUserList } from "@/api/user";
import checkPermission from "@/utils/permission";
import {
getpEquipmentList,
createEquipment,
updateEquipment,
deleteEquipment,
} from "@/api/equipment";
import {getUserList} from "@/api/user";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
name: "",
number: "",
type:null,
};
export default {
components: { Pagination },
data() {
return {
equipment: defaultequipment,
equipmentList: {
count: 0,
},
mgmtype_: {
1: "A",
2: "B",
3: "C",
},
mgmoptions: [
{
value: 1,
label: "A",
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
name: "",
number: "",
type: null,
};
export default {
components: {Pagination},
data() {
return {
equipment: defaultequipment,
equipmentList: {
count: 0,
},
{
value: 2,
label: "B",
mgmtype_: {
1: "A",
2: "B",
3: "C",
},
{
value: 3,
label: "C",
mgmoptions: [
{
value: 1,
label: "A",
},
{
value: 2,
label: "B",
},
{
value: 3,
label: "C",
},
],
waytype_: {
1: "外检",
2: "自检",
},
],
waytype_: {
1: "外检",
2: "自检",
},
wayoptions: [
{
value: 1,
label: "外检",
wayoptions: [
{
value: 1,
label: "外检",
},
{
value: 2,
label: "自检",
},
],
usetype_: {
1: "专用",
2: "公用",
},
{
value: 2,
label: "自检",
useoptions: [
{
value: 1,
label: "专用",
},
{
value: 2,
label: "公用",
},
],
state_: {
10: "合格",
40: "禁用",
50: "报废",
},
],
usetype_: {
1: "专用",
2: "公用",
},
useoptions: [
{
value: 1,
label: "专用",
options: [
{
value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
}
,
{
value: 50,
label: "报废",
},
],
listQuery: {
page: 1,
page_size: 20,
type: null,
},
{
value: 2,
label: "公用",
},
],
state_: {
10: "合格",
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{required: true, message: "请输入", trigger: "blur"}],
40: "禁用",
},
options: [
{
value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
},
],
listQuery: {
page: 1,
page_size: 20,
type:null,
},
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
model: [{ required: true, message: "请输入", trigger: "blur" }],
state: [{ required: true, message: "请选择", trigger: "blur" }],
},
datatime: null,
};
},
computed: {},
watch: {},
created() {
this.getList();
model: [{required: true, message: "请输入", trigger: "blur"}],
state: [{required: true, message: "请选择", trigger: "blur"}],
this.getUserList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type = 2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
},
datatime: null,
};
},
computed: {},
watch: {},
created() {
this.getList();
//校准时间提醒
setClass:function(check_date) {
this.getUserList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
this.listQuery.type = 2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
}
this.listLoading = false;
});
},
//校准时间提醒
setClass: function (check_date) {
let obj = {};
if(check_date!=null){
if (check_date != null) {
let dat = new Date();
let time = dat.getTime();
let check = new Date(check_date).getTime();
let timeDiffer = (check-time)/1000/60/60/24;
if (4>timeDiffer&&timeDiffer>0) {
let timeDiffer = (check - time) / 1000 / 60 / 60 / 24;
if (4 > timeDiffer && timeDiffer > 0) {
obj = 'warning';
}else if (timeDiffer<0) {
} else if (timeDiffer < 0) {
obj = "danger";
}
}
return obj;
},
//组员列表
getUserList() {
getUserList({ page: 0 }).then((res) => {
this.keeperOptions = res.data;
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
//组员列表
getUserList() {
getUserList({page: 0}).then((res) => {
this.keeperOptions = res.data;
});
},
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.equipment = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipment = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipment(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipment(this.equipment.id, this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.equipment.type = 2;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
this.equipment.type = 2;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
return false;
}
} else {
return false;
}
});
});
},
},
},
};
};
</script>

View File

@ -2,34 +2,40 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增校准或检定</el-button
>
<el-input
v-model="listQuery.search"
placeholder="设备名称/设备编号/备注"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<el-button
v-if="checkPermission(['echeckrecord_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增校准或检定
</el-button>
<el-input
v-model="listQuery.search"
placeholder="设备名称/设备编号/备注"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="equipmentrecordList.results"
@ -40,55 +46,52 @@
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.equipment_.name }}</template>
</el-table-column>
<el-table-column label="设备编号">
<el-table-column label="设备编号">
<template slot-scope="scope">{{ scope.row.equipment_.number }}</template>
</el-table-column>
<el-table-column label="型号规格">
<el-table-column label="型号规格">
<template slot-scope="scope">{{ scope.row.equipment_.model }}</template>
</el-table-column>
<el-table-column label="设备状态">
<template slot-scope="scope">
<el-table-column label="设备状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.equipment_.state===10" type="success">
{{ state_[scope.row.equipment_.state] }}
{{ state_[scope.row.equipment_.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.equipment_.state] }}
<el-tag v-else type="danger">
{{ state_[scope.row.equipment_.state] }}
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="校准检查日期">
<el-table-column label="校准检查日期">
<template slot-scope="scope">{{ scope.row.check_date }}</template>
</el-table-column>
<el-table-column label="备注">
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="120px"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['equipment_update'])"
type="primary"
v-if="checkPermission(['echeckrecord_update'])"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['equipment_delete'])"
v-if="checkPermission(['echeckrecord_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -112,21 +115,19 @@
label-position="right"
:rules="rule1"
>
<el-form-item label="校准检定设备" prop="equipment">
<el-select style="width: 100%" v-model="equipmentrecord.equipment" placeholder="请选择">
<el-option
v-for="item in equipmentoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-select style="width: 100%" v-model="equipmentrecord.equipment" placeholder="请选择">
<el-option
v-for="item in equipmentoptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="校准检查日期" prop="check_date">
<el-date-picker
<el-form-item label="校准检查日期" prop="check_date">
<el-date-picker
v-model="equipmentrecord.check_date"
type="date"
placeholder="选择日期"
@ -134,20 +135,15 @@
style="width: 100%"
>
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="description">
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input
v-model="equipmentrecord.description"
type="textarea"
:rows="4"
v-model="equipmentrecord.description"
placeholder="备注"
/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -157,143 +153,142 @@
</div>
</template>
<script>
import { getpEquipmentList,
getEquipmentrecordList, createEquipmentrecord,updateEquipmentrecord,deleteEquipmentrecord } from "@/api/equipment";
import { getUserList } from "@/api/user";
import { getOrgList } from "@/api/org";
import checkPermission from "@/utils/permission";
import {
getpEquipmentList,
getEquipmentrecordList, createEquipmentrecord, updateEquipmentrecord, deleteEquipmentrecord
} from "@/api/equipment";
// import {getUserList} from "@/api/user";
// import {getOrgList} from "@/api/org";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {
};
export default {
components: { Pagination },
data() {
return {
equipmentrecord: defaultequipment,
equipmentrecordList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
equipmentoptions:[],
state_:{
10:'合格',
40:'禁用',
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultequipment = {};
export default {
components: {Pagination},
data() {
return {
equipmentrecord: defaultequipment,
equipmentrecordList: {
count: 0,
},
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
equipment: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getequipmentList();
this.getList();
},
methods: {
checkPermission,
//设备
getequipmentList() {
getpEquipmentList({pageoff:true,type:2}).then((res) => {
this.equipmentoptions = genTree(res.data);
});
},
getList() {
this.listLoading = true;
getEquipmentrecordList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentrecordList = response.data;
}
this.listLoading = false;
});
listQuery: {
page: 1,
page_size: 20,
},
equipmentoptions: [],
state_: {
10: '合格',
40: '禁用',
},
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
equipment: [{required: true, message: "请输入", trigger: "blur"}],
},
};
},
handleFilter() {
this.listQuery.page = 1;
created() {
this.getequipmentList();
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.equipmentrecord = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipmentrecord = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipmentrecord(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
methods: {
checkPermission,
//设备
getequipmentList() {
getpEquipmentList({pageoff: true, type: 2}).then((res) => {
this.equipmentoptions = genTree(res.data);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipmentrecord(this.equipmentrecord.id, this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createEquipmentrecord(this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
getList() {
this.listLoading = true;
getEquipmentrecordList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentrecordList = response.data;
}
} else {
return false;
}
});
this.listLoading = false;
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.equipmentrecord = Object.assign({}, defaultequipment);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.equipmentrecord = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteEquipmentrecord(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateEquipmentrecord(this.equipmentrecord.id, this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createEquipmentrecord(this.equipmentrecord).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
},
},
};
};
</script>

View File

@ -2,12 +2,22 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handlecgCreate"
>新增采购入库</el-button
<el-button
v-if="checkPermission(['fifo_in_pur'])"
type="primary"
icon="el-icon-plus"
@click="handlecgCreate"
>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增其他入库</el-button
新增采购入库
</el-button>
<el-button
v-if="checkPermission(['fifo_in_other'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增其他入库
</el-button>
<el-input
v-model="listQuery.search"
placeholder="仓库名称/仓库编号"
@ -20,15 +30,17 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
</el-card>
<el-card>
@ -42,18 +54,15 @@
height="100"
v-el-height-adaptive-table="{ bottomOffset: 42 }"
>
<el-table-column type="index" width="50" />
<el-table-column label="记录编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="记录编号" prop="number">
</el-table-column>
<el-table-column label="操作人员">
<template slot-scope="scope" v-if="scope.row.create_by">{{
scope.row.create_by_.name
}}</template>
<template slot-scope="scope" v-if="scope.row.create_by">
{{scope.row.create_by_.name}}
</template>
</el-table-column>
<el-table-column label="出/入库时间">
<template slot-scope="scope">{{ scope.row.inout_date }}</template>
<el-table-column label="出/入库时间" prop="inout_date">
</el-table-column>
<el-table-column label="出/入库类型">
<template slot-scope="scope">{{ types_[scope.row.type] }}</template>
@ -64,35 +73,38 @@
<el-tag v-else>已审核</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="scope.row.type==2"
v-if="checkPermission(['fifo_pack'])&&scope.row.type==2"
type="primary"
@click="handlePack(scope)"
>装箱</el-link
>
<el-link
v-if="checkPermission(['warehouse_update'])"
装箱
</el-link>
<el-link
v-if="checkPermission(['fifo_pack'])"
type="primary"
@click="handleDetail(scope)"
>查看</el-link
>
查看
</el-link>
<el-link
v-if="scope.row.is_audited == false"
v-if="checkPermission(['fifo_hear'])&&scope.row.is_audited == false"
type="primary"
@click="handleAudit(scope)"
>审核</el-link
>
审核
</el-link>
<el-link
v-if="checkPermission(['warehouse_delete'])"
v-if="checkPermission(['fifo_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -116,7 +128,7 @@
label-position="right"
:rules="rule1"
>
<el-form-item label="采购订单" >
<el-form-item label="采购订单">
<el-select v-model="inpur.pu_order">
<el-option
v-for="item in puorderoptions"
@ -129,12 +141,18 @@
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisibles = false"
>取消</el-button
<el-button
type="danger"
@click="dialogVisibles = false"
>
<el-button type="primary" @click="confirminpur('Form1')"
>确认</el-button
取消
</el-button>
<el-button
type="primary"
@click="confirminpur('Form1')"
>
确认
</el-button>
</div>
</el-dialog>
<el-dialog
@ -150,7 +168,7 @@
label-position="right"
:rules="rule1"
>
<el-form-item class="warehouse" label="供应商" >
<el-form-item class="warehouse" label="供应商">
<el-select v-model="inventory.vendor" size="small">
<el-option
v-for="item in vendoroptions"
@ -180,7 +198,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-right: 10px">
<el-form-item
class="material"
@ -198,7 +215,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-right: 10px">
<el-form-item
class="count"
@ -220,24 +236,22 @@
<el-input v-model="item.batch" placeholder="批次号"></el-input>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-right: 10px">
<el-col :span="5" style="margin-right: 10px">
<el-form-item
class="expiration_date"
label="有效期"
:prop="'details.' + index + '.expiration_date'"
>
<el-date-picker
v-model="item.expiration_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
<el-date-picker
v-model="item.expiration_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<!-- 删除按钮 -->
<el-col :span="1">
<el-tooltip
@ -295,234 +309,233 @@
</div>
</template>
<script>
import {
getfifoList,
createInventory,
createInother,
getWarehouseList,
deleteFifoitem,
deleteFifo,
audit,
} from "@/api/inm";
import { getPuorderList } from "@/api/pum";
import checkPermission from "@/utils/permission";
import { getpVendorList } from "@/api/vendor";
import { getMaterialList } from "@/api/mtm";
import { getUserList } from "@/api/user";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteinventory = {
vendor: null,
details: [
{
warehouse: "", //仓库
material: "", // 物料
count: "", //数量
batch: "", //批次
import {
getfifoList,
createInventory,
createInother,
getWarehouseList,
deleteFifoitem,
deleteFifo,
audit,
} from "@/api/inm";
import {getPuorderList} from "@/api/pum";
import checkPermission from "@/utils/permission";
import {getpVendorList} from "@/api/vendor";
import {getMaterialList} from "@/api/mtm";
import {getUserList} from "@/api/user";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteinventory = {
vendor: null,
details: [
{
warehouse: "", //仓库
material: "", // 物料
count: "", //数量
batch: "", //批次
},
],
};
export default {
components: {Pagination},
data() {
return {
inventory: defaulteinventory,
fifoList: {
count: 0,
},
types_: {
1: "生产领料",
2: "销售提货",
3: "采购入库",
4: "生产入库",
5: "其他入库",
},
inpur: {},
listQuery: {
page: 1,
page_size: 20,
},
puorderoptions: [],
warehouseData: [],
materialoptions: [],
vendoroptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
dialogVisibles: false,
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
},
};
},
],
};
export default {
components: { Pagination },
data() {
return {
inventory: defaulteinventory,
fifoList: {
count: 0,
},
types_: {
1: "生产领料",
2: "销售提货",
3: "采购入库",
4: "生产入库",
5: "其他入库",
},
inpur: {},
listQuery: {
page: 1,
page_size: 20,
},
puorderoptions: [],
warehouseData: [],
materialoptions: [],
vendoroptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
dialogVisibles: false,
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getlists();
this.getList();
this.getListgys();
this.getmaterialList();
this.getpuorderList();
},
methods: {
checkPermission,
computed: {},
watch: {},
created() {
this.getlists();
this.getList();
this.getListgys();
this.getmaterialList();
this.getpuorderList();
},
methods: {
checkPermission,
getList() {
this.listLoading = true;
getList() {
this.listLoading = true;
getfifoList(this.listQuery).then((response) => {
if (response.data) {
this.fifoList = response.data;
}
this.listLoading = false;
});
},
//出入库详情
handleDetail(scope) {
this.$router.push({
name: "fifodetail",
params: { id: scope.row.id, pu_order: scope.row.pu_order},
});
},
//供应商列表
getListgys() {
getpVendorList({ page: 0 }).then((response) => {
if (response.data) {
this.vendoroptions = response.data;
}
});
},
//采购订单
getpuorderList() {
getPuorderList({ page: 0 }).then((response) => {
if (response.data) {
this.puorderoptions = response.data;
}
});
},
//采购入库提交
confirminpur() {
createInventory(this.inpur).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisibles = false;
this.$message.success("成功");
}
});
},
//仓库
getlists() {
getWarehouseList({ page: 0 }).then((response) => {
if (response.data) {
this.warehouseData = genTree(response.data);
}
this.listLoading = false;
});
},
handlecgCreate() {
this.dialogVisibles = true;
},
addConditions() {
if (this.inventory.details.length <= 10) {
this.inventory.details.push({
warehouse: "", //仓库
material: "", // 物料
count: "", //数量
batch: "", // 批次
getfifoList(this.listQuery).then((response) => {
if (response.data) {
this.fifoList = response.data;
}
this.listLoading = false;
});
} else {
this.$message("最多可添加十项条件");
},
//出入库详情
handleDetail(scope) {
this.$router.push({
name: "fifodetail",
params: {id: scope.row.id, pu_order: scope.row.pu_order},
});
},
//供应商列表
getListgys() {
getpVendorList({page: 0}).then((response) => {
if (response.data) {
this.vendoroptions = response.data;
}
});
},
//采购订单
getpuorderList() {
getPuorderList({page: 0}).then((response) => {
if (response.data) {
this.puorderoptions = response.data;
}
});
},
//采购入库提交
confirminpur() {
createInventory(this.inpur).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisibles = false;
this.$message.success("成功");
}
});
},
//仓库
getlists() {
getWarehouseList({page: 0}).then((response) => {
if (response.data) {
this.warehouseData = genTree(response.data);
}
this.listLoading = false;
});
},
handlecgCreate() {
this.dialogVisibles = true;
},
addConditions() {
if (this.inventory.details.length <= 10) {
this.inventory.details.push({
warehouse: "", //仓库
material: "", // 物料
count: "", //数量
batch: "", // 批次
});
} else {
this.$message("最多可添加十项条件");
}
},
deleteItem(index) {
this.inventory.details.splice(index, 1);
},
//物料
getmaterialList() {
this.listLoading = true;
getMaterialList({pageoff: true}).then((response) => {
if (response.data) {
this.materialoptions = genTree(response.data);
}
this.listLoading = false;
});
},
handleCreate() {
this.inventory.details = [
{
warehouse: "", // 仓库
material: "", // 物料
count: "", //数量
batch: "", //批次
},
];
this.inventory = Object.assign({}, defaulteinventory);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
//审核
handleAudit(scope) {
this.$confirm("是否通过?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "success",
})
.then(async () => {
await audit(scope.row.id);
this.getList();
this.$message.success("已审核");
})
.catch((err) => {
console.error(err);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
async confirm(form) {
console.log(this.inventory);
createInother(this.inventory).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteFifo(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
//装箱
handlePack(scope) {
this.$router.push({name: "salesdetail", params: {id: scope.row.sale},})
}
},
deleteItem(index) {
this.inventory.details.splice(index, 1);
},
//物料
getmaterialList() {
this.listLoading = true;
getMaterialList({ pageoff: true }).then((response) => {
if (response.data) {
this.materialoptions = genTree(response.data);
}
this.listLoading = false;
});
},
handleCreate() {
this.inventory.details = [
{
warehouse: "", // 仓库
material: "", // 物料
count: "", //数量
batch: "", //批次
},
];
this.inventory = Object.assign({}, defaulteinventory);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
//审核
handleAudit(scope) {
this.$confirm("是否通过?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "success",
})
.then(async () => {
await audit(scope.row.id);
this.getList();
this.$message.success("已审核");
})
.catch((err) => {
console.error(err);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
async confirm(form) {
console.log(this.inventory);
createInother(this.inventory).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteFifo(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
//装箱
handlePack(scope)
{
this.$router.push({name: "salesdetail", params: { id: scope.row.sale }, })
}
},
};
};
</script>

View File

@ -47,10 +47,15 @@
<el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="有效期">
<template slot-scope="scope">{{ scope.row.expiration_date }}</template>
<el-table-column label="有效期" >
<template slot-scope="scope">
<el-tag v-if="scope.row.expiration_date" :type="setClass(scope.row.expiration_date)">
{{scope.row.expiration_date}}
</el-tag>
<div v-else></div></template
>
</el-table-column>
<el-table-column label="物料编号">
<template slot-scope="scope">{{
scope.row.material_.number
@ -130,7 +135,23 @@ export default {
this.listLoading = false;
});
},
//校准时间提醒
setClass:function(check_date) {
let obj = {};
if(check_date!=null){
let dat = new Date();
let time = dat.getTime();
let check = new Date(check_date).getTime();
let timeDiffer = (check-time)/1000/60/60/24;
if (timeDiffer<0) {
obj = "danger";
}
}
return obj;
},
handleFilter() {
this.listQuery.page = 1;
this.getList();

View File

@ -1,13 +1,18 @@
<template>
<div class="app-container">
<el-card>
<el-button type="primary" icon="el-icon-plus" @click="handleorder"
>选择订单
<el-button
v-if="checkPermission(['wp_to_order'])"
type="primary"
icon="el-icon-plus"
@click="handleorder"
>
选择订单
</el-button>
<el-table
ref="multipleTable"
v-loading="listLoading"
:data="iproductData.results"
ref="multipleTable"
border
fit
stripe
@ -17,12 +22,9 @@
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
@ -30,13 +32,10 @@
<el-table-column label="所在仓库">
<template slot-scope="scope">{{scope.row.warehouse_.name}}</template>
</el-table-column>
<el-table-column label="订单">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
<el-tag
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
<el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
需要确定订单
</el-tag>
<span v-else></span>
@ -45,9 +44,7 @@
<el-table-column label="合同">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
<span
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
</span>
<span v-else></span>
</template>
@ -55,9 +52,7 @@
<el-table-column label="客户">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
<span
v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"
>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
</span>
<span v-else></span>
</template>
@ -69,13 +64,9 @@
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="销售状态">
<el-table-column label="销售状态">
<template slot-scope="scope">{{state_[scope.row.state]}}</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
@ -150,7 +141,8 @@
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="toorders(scope)"
>确认
>
确认
</el-link>
</template>
</el-table-column>
@ -167,7 +159,7 @@
import checkPermission from "@/utils/permission";
import {getOrderList} from "@/api/sam";
import {mtest, toorder} from "@/api/wpm";
import {genTree} from "@/utils";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
@ -188,12 +180,12 @@
mtestform: {
is_mtestok: false,
},
state_: {
10: "可出售",
20: "销售锁定",
30: "已售出",
},
state_: {
10: "可出售",
20: "销售锁定",
30: "已售出",
},
form1: {},
dialogFormVisibleorder: false,
orderList: [],
@ -225,10 +217,12 @@
this.listLoading = false;
});
},
handleMtest(scope) {
this.saleproduct = scope.row.id;
this.dialogVisible = true;
},
submtest() {
mtest(this.saleproduct, this.mtestform).then((res) => {
if (res.code >= 200) {
@ -237,6 +231,7 @@
}
});
},
//批量选择成品发给谋订单
handleorder() {
this.dialogFormVisibleorder = true;
@ -261,6 +256,7 @@
}
);
},
//提交批量产品选择的订单
toorders(scope) {
toorder({

View File

@ -2,9 +2,14 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增仓库</el-button
<el-button
v-if="checkPermission(['warehouse_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增仓库
</el-button>
<el-input
v-model="listQuery.search"
placeholder="仓库名称/仓库编号"
@ -17,19 +22,20 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="warehouseList.results"
@ -37,45 +43,41 @@
fit
stripe
highlight-current-row
height="100"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="仓库名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="仓库名称" prop="name">
</el-table-column>
<el-table-column label="仓库编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="仓库编号" prop="number">
</el-table-column>
<el-table-column label="具体地点">
<template slot-scope="scope">{{ scope.row.place }}</template>
<el-table-column label="具体地点" prop="place">
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
type="primary"
type="primary"
@click="handleMaterial(scope)"
>查看物料</el-link
>
查看物料
</el-link>
<el-link
v-if="checkPermission(['warehouse_update'])"
type="primary"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['warehouse_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -100,13 +102,13 @@
:rules="rule1"
>
<el-form-item label="仓库名称" prop="name">
<el-input v-model="warehouse.name" placeholder="仓库名称" />
<el-input v-model="warehouse.name" placeholder="仓库名称"/>
</el-form-item>
<el-form-item label="仓库编号" prop="number">
<el-input v-model="warehouse.number" placeholder="仓库编号" />
<el-input v-model="warehouse.number" placeholder="仓库编号"/>
</el-form-item>
<el-form-item label="具体地点" prop="place">
<el-input v-model="warehouse.place" placeholder="具体地点" />
<el-input v-model="warehouse.place" placeholder="具体地点"/>
</el-form-item>
</el-form>
<div style="text-align: right">
@ -117,146 +119,151 @@
</div>
</template>
<script>
import {
getWarehouseList,
createWarehouse,
updateWarehouse,
deleteWarehouse,
} from "@/api/inm";
import checkPermission from "@/utils/permission";
import {
getWarehouseList,
createWarehouse,
updateWarehouse,
deleteWarehouse,
} from "@/api/inm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultewarehouse = {};
export default {
components: { Pagination },
data() {
return {
warehouse: defaultewarehouse,
warehouseList: {
count: 0,
},
options: [
{
value: 0,
label: "运转正常",
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultewarehouse = {};
export default {
components: {Pagination},
data() {
return {
warehouse: defaultewarehouse,
warehouseList: {
count: 0,
},
{
value: 1,
label: "停用",
options: [
{
value: 0,
label: "运转正常",
},
{
value: 1,
label: "停用",
},
{
value: 2,
label: "报废",
},
],
listQuery: {
page: 1,
page_size: 20,
},
{
value: 2,
label: "报废",
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{required: true, message: "请输入", trigger: "blur"}],
place: [{required: true, message: "请输入", trigger: "blur"}],
},
],
listQuery: {
page: 1,
page_size: 20,
},
keeperOptions: [],
depOptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
place: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
getWarehouseList(this.listQuery).then((response) => {
if (response.data) {
this.warehouseList = response.data;
}
this.listLoading = false;
});
},
//跳转到该仓库的物料表
handleMaterial(scope) {
this.$router.push({ name: "inventory", params: { id: scope.row.id } });
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
},
computed: {},
watch: {},
created() {
this.getList();
},
handleCreate() {
this.warehouse = Object.assign({}, defaultewarehouse);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.warehouse = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWarehouse(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateWarehouse(this.warehouse.id, this.warehouse).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createWarehouse(this.warehouse).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
getWarehouseList(this.listQuery).then((response) => {
if (response.data) {
this.warehouseList = response.data;
}
} else {
return false;
}
});
this.listLoading = false;
});
},
//跳转到该仓库的物料表
handleMaterial(scope) {
this.$router.push({name: "inventory", params: {id: scope.row.id}});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.warehouse = Object.assign({}, defaultewarehouse);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.warehouse = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWarehouse(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateWarehouse(this.warehouse.id, this.warehouse).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createWarehouse(this.warehouse).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
},
},
};
};
</script>

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">
<el-button v-if="checkPermission(['material_create'])" type="primary" icon="el-icon-plus" @click="handleCreate">
新增物料
</el-button>
<el-input
@ -85,7 +85,7 @@
>检查表
</el-link>
<el-link
v-if="checkPermission(['material_update'])"
subproduction_delete
type="primary"
@click="handleEdit(scope)"
>编辑

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<div style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">
<el-button v-if="checkPermission(['process_create'])" type="primary" icon="el-icon-plus" @click="handleCreate">
新增工序
</el-button>
</div>
@ -46,6 +46,7 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['process_update'])"
type="primary"
@click="handleAdd(scope)"
>

View File

@ -42,25 +42,28 @@
<el-col :span="15">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 16px;
<span style="font-size: 16px;
font-weight: 700;
">工艺流程</span>
</div>
<el-steps :active="values" spac="400px" align-center="" style="padding-top: 20px;height:80px">
<el-step :title="item.name" v-for="(item,index) in processoptions " :key="index"
@click.native=stepclick(item.id)>
<el-step
v-for="(item,index) in processoptions "
:key="index"
:title="item.name"
@click.native=stepclick(item.id)
>
</el-step>
</el-steps>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 16px;
<span style="font-size: 16px;
font-weight: 700;
">流程分解</span>
</div>
<el-button type="primary" icon="el-icon-plus" @click="handlesubproducationCreate"
>新增
<el-button v-if="checkPermission(['subproduction_create'])" type="primary" icon="el-icon-plus" @click="handlesubproducationCreate">
新增
</el-button>
<el-table
height="190px"
@ -87,33 +90,29 @@
<el-table-column label="排序">
<template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handlesubproducationEdit(scope)"
>编辑
</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
v-if="checkPermission(['subproduction_delete'])"
type="danger"
@click="handlesubproducationDelete(scope)"
>删除
</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog
:visible.sync="dialogVisiblesp"
:title="dialogTypesp === 'edit' ? '编辑流程分解' : '新增流程分解'"
@ -124,7 +123,6 @@
label-width="80px"
label-position="right"
>
<el-form-item label="名称" prop="name">
<el-input v-model="subproducation.name"/>
</el-form-item>
@ -137,7 +135,6 @@
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否质检" prop="need_combtest">
<el-switch v-model="subproducation.need_combtest"></el-switch>
@ -149,8 +146,6 @@
:max="2147483647"
></el-input-number>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisiblesp = false">取消</el-button>
@ -160,8 +155,13 @@
</el-card>
<el-tabs type="border-card" style="height:310px">
<el-tab-pane label="输入物料">
<el-button type="primary" icon="el-icon-plus" @click="handleinputCreate"
>新增
<el-button
v-if="checkPermission(['subproduction_update'])"
type="primary"
icon="el-icon-plus"
@click="handleinputCreate"
>
新增
</el-button>
<el-table
:data="inputtableData"
@ -190,16 +190,18 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handleinputEdit(scope)"
>编辑
>
编辑
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
v-if="checkPermission(['subproduction_update'])"
type="danger"
@click="handleinputDelete(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -244,8 +246,13 @@
</el-dialog>
</el-tab-pane>
<el-tab-pane label="输出物料">
<el-button type="primary" icon="el-icon-plus" @click="handleoutputCreate"
>新增
<el-button
v-if="checkPermission(['subproduction_update'])"
type="primary"
icon="el-icon-plus"
@click="handleoutputCreate"
>
新增
</el-button>
<el-table
:data="outputtableData"
@ -268,7 +275,7 @@
</el-table-column>
<el-table-column label="是否主产出">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_main==true"> </el-tag>
<el-tag v-if="scope.row.is_main==true"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
@ -279,16 +286,18 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handleoutputEdit(scope)"
>编辑
>
编辑
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
v-if="checkPermission(['subproduction_update'])"
type="danger"
@click="handleoutputDelete(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -336,8 +345,13 @@
</el-dialog>
</el-tab-pane>
<el-tab-pane label="工具工装">
<el-button type="primary" icon="el-icon-plus" @click="handleotherCreate"
>新增
<el-button
v-if="checkPermission(['subproduction_update'])"
type="primary"
icon="el-icon-plus"
@click="handleotherCreate"
>
新增
</el-button>
<el-table
:data="othertableData"
@ -362,16 +376,18 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['material_update'])"
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handleotherEdit(scope)"
>编辑
>
编辑
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
v-if="checkPermission(['subproduction_update'])"
type="danger"
@click="handleotherDelete(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -418,8 +434,13 @@
</el-dialog>
</el-tab-pane>
<el-tab-pane label="子工序列表">
<el-button type="primary" icon="el-icon-plus" @click="handleusedstepCreate"
>新增
<el-button
v-if="checkPermission(['subproduction_update'])"
type="primary"
icon="el-icon-plus"
@click="handleusedstepCreate"
>
新增
</el-button>
<el-table
:data="usedsteptableData"
@ -433,7 +454,6 @@
</el-table-column>
<el-table-column label="工序内检验">
<template slot-scope="scope">
<!--{{ scope.row.need_test }}-->
<span v-if=" scope.row.need_test">检验</span>
<span v-else>不检验</span>
</template>
@ -447,20 +467,24 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handleEdit(scope)"
>编辑
>
编辑
</el-link>
<el-link
type="primary"
@click="handlesearch(scope)"
>查看
>
查看
</el-link>
<el-link
v-if="checkPermission(['material_delete'])"
v-if="checkPermission(['subproduction_update'])"
type="danger"
@click="handleusedstepDelete(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -503,8 +527,13 @@
</el-dialog>
</el-tab-pane>
<el-tab-pane label="技术文件">
<el-button type="primary" icon="el-icon-plus" @click="handletechdocCreate"
>新增
<el-button
v-if="checkPermission(['subproduction_update'])"
type="primary"
icon="el-icon-plus"
@click="handletechdocCreate"
>
新增
</el-button>
<el-table
:data="techdoctableData"
@ -535,16 +564,18 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['process_update'])"
v-if="checkPermission(['subproduction_update'])"
type="primary"
@click="handletechdocEdit(scope)"
>编辑
>
编辑
</el-link>
<el-link
v-if="checkPermission(['process_delete'])"
v-if="checkPermission(['subproduction_update'])"
type="danger"
@click="handletechdocDelete(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -628,7 +659,7 @@
deleteOthermaterial,
updateOthermaterial
} from "@/api/mtm";
import { getEquipmentAll } from "@/api/equipment";
import {getEquipmentAll} from "@/api/equipment";
import {quillEditor} from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
@ -641,8 +672,8 @@
const defaultinputmaterial = {};
const defaultoutputmaterial = {};
const defaultother = {};
const defaultusedstep = {need_test:false};
const defaulttechdoc = {enabled: false,name:""};
const defaultusedstep = {need_test: false};
const defaulttechdoc = {enabled: false, name: ""};
const defaultsubproducation = {
need_combtest: false,
};
@ -831,11 +862,11 @@
})
.then(async () => {
await deletesubproducation(scope.row.id);
this.getsubproducationList()
this.getsubproducationList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
@ -847,7 +878,7 @@
this.subproducation.product = this.product;
updatesubproducation(this.subproducation.id, this.subproducation).then((res) => {
if (res.code >= 200) {
this.getsubproducationList()
this.getsubproducationList();
this.dialogVisiblesp = false;
this.$message.success("成功");
}
@ -856,7 +887,7 @@
this.subproducation.product = this.product;
createsubproducation(this.subproducation).then((res) => {
if (res.code >= 200) {
this.getsubproducationList()
this.getsubproducationList();
this.dialogVisiblesp = false;
this.$message.success("成功");
}
@ -906,11 +937,11 @@
})
.then(async () => {
await deleteInputmaterial(scope.row.id);
this.getInputmaterialLists()
this.getInputmaterialLists();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
@ -922,7 +953,7 @@
this.inputmaterial.subproduction = this.subproduction;
updateInputmaterial(this.inputmaterial.id, this.inputmaterial).then((res) => {
if (res.code >= 200) {
this.getInputmaterialLists()
this.getInputmaterialLists();
this.dialogVisible = false;
this.$message.success("成功");
}
@ -931,7 +962,7 @@
this.inputmaterial.subproduction = this.subproduction;
createInputmaterial(this.inputmaterial).then((res) => {
if (res.code >= 200) {
this.getInputmaterialLists()
this.getInputmaterialLists();
this.dialogVisible = false;
this.$message.success("成功");
}
@ -980,11 +1011,11 @@
})
.then(async () => {
await deleteOutputmaterial(scope.row.id);
this.getOutputmaterialLists()
this.getOutputmaterialLists();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
async outputconfirm(form) {
@ -995,7 +1026,7 @@
this.outputmaterial.subproduction = this.subproduction;
updateOutputmaterial(this.outputmaterial.id, this.outputmaterial).then((res) => {
if (res.code >= 200) {
this.getOutputmaterialLists()
this.getOutputmaterialLists();
this.dialogVisible1 = false;
this.$message.success("成功");
}
@ -1004,7 +1035,7 @@
this.outputmaterial.subproduction = this.subproduction;
createOutputmaterial(this.outputmaterial).then((res) => {
if (res.code >= 200) {
this.getOutputmaterialLists()
this.getOutputmaterialLists();
this.dialogVisible1 = false;
this.$message.success("成功");
}
@ -1056,7 +1087,7 @@
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
@ -1068,7 +1099,7 @@
this.othermaterial.subproduction = this.subproduction;
updateOthermaterial(this.othermaterial.id, this.othermaterial).then((res) => {
if (res.code >= 200) {
this.getOthermaterialLists()
this.getOthermaterialLists();
this.dialogVisibleother = false;
this.$message.success("成功");
}
@ -1077,7 +1108,7 @@
this.othermaterial.subproduction = this.subproduction;
createOthermaterial(this.othermaterial).then((res) => {
if (res.code >= 200) {
this.getOthermaterialLists()
this.getOthermaterialLists();
this.dialogVisibleother = false;
this.$message.success("成功");
}
@ -1125,9 +1156,9 @@
});
},
//编辑子工序
handleEdit(scope){
this.subProcessId = scope.row.id;
this.usedstep = Object.assign({}, scope.row);
handleEdit(scope) {
this.subProcessId = scope.row.id;
this.usedstep = Object.assign({}, scope.row);
this.dialogTypes = "edit";
this.dialogVisibleusedstep = true;
},
@ -1141,11 +1172,11 @@
})
.then(async () => {
await deleteUsedstep(scope.row.id);
this.getUsedstepLists()
this.getUsedstepLists();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
@ -1153,11 +1184,11 @@
async usedstepconfirm(form) {
let that = this;
this.usedstep.subproduction = this.subproduction;
if(that.dialogTypes === 'edit'){
if (that.dialogTypes === 'edit') {
let obj = new Object();
obj.remark =this.usedstep.remark;
obj.need_test =this.usedstep.need_test;
updateUsedstep(that.subProcessId,obj).then((res) => {
obj.remark = this.usedstep.remark;
obj.need_test = this.usedstep.need_test;
updateUsedstep(that.subProcessId, obj).then((res) => {
if (res.code >= 200) {
this.getUsedstepLists();
this.getMaterial();
@ -1165,7 +1196,7 @@
this.$message.success("成功");
}
});
}else{
} else {
createUsedstep(this.usedstep).then((res) => {
if (res.code >= 200) {
this.getUsedstepLists();
@ -1208,11 +1239,11 @@
handleUpSuccess(res, file, filelist) {
this.techdoc.file = res.data.id;
console.log(res.data);
// console.log(res.data);
this.techdoc.name = res.data.name;
},
handleRemove(file, filelist) {
handleRemove() {
this.techdoc.file = null;
},
@ -1245,7 +1276,7 @@
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},

View File

@ -13,46 +13,38 @@
border
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50" label="序号"/>
<el-table-column align="center" prop="number" label="工号">
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column align="center" prop="name" label="姓名">
</el-table-column>
<el-table-column align="center" label="到岗情况">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag>
<el-tag type="danger" v-else>离岗</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="离岗备注">
<template slot-scope="scope">{{
scope.row.not_work_remark
}}</template>
<el-table-column align="center" prop="not_work_remark" label="离岗备注">
</el-table-column>
<el-table-column align="center" label="打卡时间">
<template slot-scope="scope">{{ scope.row.last_check_time }}</template>
<el-table-column align="center" prop="last_check_time" label="打卡时间">
</el-table-column>
<el-table-column align="header-center" label="部门">
<template v-if="scope.row.dept_" slot-scope="scope">{{
scope.row.dept_.name
}}</template>
<template v-if="scope.row.dept_" slot-scope="scope">
{{scope.row.dept_.name}}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['employee_notworkremark'])&&scope.row.is_atwork == false"
type="primary"
v-if="scope.row.is_atwork == false"
@click="handlestopwork(scope)"
>离岗说明
>
离岗说明
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="userList.count > 0"
:total="userList.count"
@ -60,7 +52,6 @@
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
<el-dialog
:visible.sync="dialogVisible"
:close-on-click-modal="false"
@ -74,17 +65,25 @@
>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
v-model="stopwork.not_work_remark"
type="textarea"
placeholder="备注"
/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false"
>取消</el-button
<el-button
type="danger"
@click="dialogVisible = false"
>
<el-button type="primary" @click="smtconfirm()">确认</el-button>
取消
</el-button>
<el-button
type="primary"
@click="smtconfirm()"
>
确认
</el-button>
</div>
</el-dialog>
</el-tab-pane>
@ -99,7 +98,12 @@
placeholder="选择年月"
>
</el-date-picker>
<el-button type="primary" @click="submit">查询</el-button>
<el-button
type="primary"
@click="submit"
>
查询
</el-button>
</div>
<el-table
:data="atworkList"
@ -112,35 +116,25 @@
@current-change="handleCurrentChange"
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50" label="序号"/>
<el-table-column align="center" prop="number" label="工号">
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column align="center" prop="name" label="姓名">
</el-table-column>
<el-table-column align="header-center" label="部门">
<template slot-scope="scope">{{
scope.row.dept_name
}}</template>
<el-table-column align="header-center" prop="dept_name" label="部门">
</el-table-column>
<el-table-column align="center" label="出勤天数">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column align="center" prop="count" label="出勤天数">
</el-table-column>
<el-table-column align="center" label="应到天数">
<template slot-scope="scope">{{
scope.row.count_workday
}}</template>
<el-table-column align="center" prop="count_workday" label="应到天数">
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<el-calendar v-model="value">
<template slot="dateCell" slot-scope="{ date, data }">
<p >
{{ data.day.split("-").slice(1).join("-") }}<br />
{{ dealMyDate(data.day) }}
<p>
{{ data.day.split("-").slice(1).join("-") }}<br/>
{{ dealMyDate(data.day) }}
</p>
</template>
</el-calendar>
@ -152,155 +146,158 @@
</div>
</template>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 100px;
height: 100px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 100px;
height: 100px;
display: block;
}
</style>
<script>
import { getEmployeeList } from "@/api/employee";
import checkPermission from "@/utils/permission";
import { notWork, getNotWorkList ,getClockrecordList} from "@/api/hrm";
import {getEmployeeList} from "@/api/employee";
import checkPermission from "@/utils/permission";
import {notWork, getNotWorkList, getClockrecordList} from "@/api/hrm";
import { getatwork } from "@/api/srm";
import { upUrl, upHeaders } from "@/api/file";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getatwork} from "@/api/srm";
import {upUrl, upHeaders} from "@/api/file";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { Pagination, Treeselect },
data() {
return {
userList: { count: 0 },
atworkList: [],
stopwork: { not_work_remark: "" },
value3: null,
value2: null,
listLoading: true,
dialogVisible: false,
stopworkID: null,
notworkList: "",
listQuery: {
page: 1,
page_size: 20,
},
resDate: [
{ date: "2022-02-20", content: "放假" },
{ date: "2022-02-26", content: "去交电费" },
{ date: "2022-02-25", content: "去学习vue" },
],
atworkDate: { year: null, month: null },
value: new Date(),
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
checkPermission,
//今日到岗
getList() {
this.listQuery.fields = "number,name,is_atwork,dept_,id,not_work_remark,last_check_time";
getEmployeeList(this.listQuery).then((response) => {
if (response.data) {
this.userList = response.data;
}
});
export default {
components: {Pagination, Treeselect},
data() {
return {
userList: {count: 0},
atworkList: [],
stopwork: {not_work_remark: ""},
value3: null,
value2: null,
listLoading: true,
dialogVisible: false,
stopworkID: null,
notworkList: "",
listQuery: {
page: 1,
page_size: 20,
},
resDate: [
{date: "2022-02-20", content: "放假"},
{date: "2022-02-26", content: "去交电费"},
{date: "2022-02-25", content: "去学习vue"},
],
atworkDate: {year: null, month: null},
value: new Date(),
};
},
handlestopwork(scope) {
this.dialogVisible = true;
this.stopworkID = scope.row.id;
computed: {},
watch: {},
created() {
this.getList();
},
handleCurrentChange(row) {
this.resDate=[],
getNotWorkList({page:0,user:row.user_id}).then((response) => {
if (response.data) {
response.data.forEach((item) => {
this.resDate.push({
data: item.not_work_date,
content: item.remark,
});
});
}
});
getClockrecordList({page:0,create_by:row.user_id}).then((response) => {
if (response.data) {
response.data.forEach((item) => {
var curTime=(item.update_time).substring(0,10)
console.log(curTime);
this.resDate.push({
data: curTime,
content: "在岗",
});
});
}
});
},
//离职备注提交
smtconfirm() {
notWork(this.stopworkID, this.stopwork).then((res) => {
if (res.code >= 200) {
this.$message.success("离职备注提交成功!");
this.dialogVisible = false;
this.getList();
}
});
},
//到岗统计
submit() {
this.atworkDate.year = this.value2.getFullYear();
this.atworkDate.month = this.value2.getMonth() + 1;
this.value = this.value2;
(this.resDate = []),
getatwork(this.atworkDate).then((response) => {
methods: {
checkPermission,
//今日到岗
getList() {
this.listQuery.fields = "number,name,is_atwork,dept_,id,not_work_remark,last_check_time";
getEmployeeList(this.listQuery).then((response) => {
if (response.data) {
this.atworkList = response.data;
this.userList = response.data;
}
});
},
},
handlestopwork(scope) {
this.dialogVisible = true;
this.stopworkID = scope.row.id;
},
handleCurrentChange(row) {
this.resDate = [],
getNotWorkList({page: 0, user: row.user_id}).then((response) => {
if (response.data) {
response.data.forEach((item) => {
this.resDate.push({
data: item.not_work_date,
content: item.remark,
});
});
//考勤日历
dealMyDate(v) {
let len = this.resDate.length;
let res = "";
for (let i = 0; i < len; i++) {
if (this.resDate[i].data == v) {
res = this.resDate[i].content;
break;
}
});
getClockrecordList({page: 0, create_by: row.user_id}).then((response) => {
if (response.data) {
response.data.forEach((item) => {
var curTime = (item.update_time).substring(0, 10)
console.log(curTime);
this.resDate.push({
data: curTime,
content: "在岗",
});
});
}
});
},
//离职备注提交
smtconfirm() {
notWork(this.stopworkID, this.stopwork).then((res) => {
if (res.code >= 200) {
this.$message.success("离职备注提交成功!");
this.dialogVisible = false;
this.getList();
}
});
},
//到岗统计
submit() {
this.atworkDate.year = this.value2.getFullYear();
this.atworkDate.month = this.value2.getMonth() + 1;
this.value = this.value2;
(this.resDate = []),
getatwork(this.atworkDate).then((response) => {
if (response.data) {
this.atworkList = response.data;
}
});
},
//考勤日历
dealMyDate(v) {
let len = this.resDate.length;
let res = "";
for (let i = 0; i < len; i++) {
if (this.resDate[i].data == v) {
res = this.resDate[i].content;
break;
}
}
}
return res;
return res;
},
},
},
};
};
</script>

View File

@ -1,249 +1,249 @@
<template>
<div class="app-container">
<el-card>
<div>
<el-input
v-model="listQuery.name"
placeholder="姓名"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
size="small"
>搜索</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
size="small"
>重置</el-button>
</div>
<el-table
v-loading="listLoading"
:data="userList.results"
style="width: 100%;margin-top:6px;"
highlight-current-row
row-key="id"
height="100"
stripe
border
v-el-height-adaptive-table="{bottomOffset: 41}"
>
<el-table-column type="index" width="50" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="header-center" label="照片">
<template slot-scope="scope"> <img :src="scope.row.photo" min-width="70" height="70"/></template>
</el-table-column>
<el-table-column align="header-center" label="电子签名">
<template slot-scope="scope"> <img :src="scope.row.signature" min-width="70" height="40"/></template>
</el-table-column>
<el-table-column align="header-center" label="部门">
<template
v-if="scope.row.dept_"
slot-scope="scope"
>{{ scope.row.dept_.name }}</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['user_update'])"
type="primary"
size="small"
@click="handleEdit(scope)"
>编辑</el-link>
<el-link
v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['user_delete'])"
type="danger"
size="small"
@click="handleDelete(scope)"
>删除</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="userList.count>0"
:total="userList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
<el-card>
<div>
<el-input
v-model="listQuery.name"
placeholder="姓名"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
</el-card>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
size="small"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
size="small"
@click="resetFilter"
>
重置
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="userList.results"
style="width: 100%;margin-top:6px;"
highlight-current-row
row-key="id"
height="100"
stripe
border
v-el-height-adaptive-table="{bottomOffset: 41}"
>
<el-table-column type="index" width="50"/>
<el-table-column align="center" label="工号" prop="number">
</el-table-column>
<el-table-column align="center" label="姓名" prop="name">
</el-table-column>
<el-table-column align="header-center" label="照片">
<template slot-scope="scope"><img :src="scope.row.photo" min-width="70" height="70"/></template>
</el-table-column>
<el-table-column align="header-center" label="电子签名">
<template slot-scope="scope"><img :src="scope.row.signature" min-width="70" height="40"/></template>
</el-table-column>
<el-table-column align="header-center" label="部门">
<template
v-if="scope.row.dept_"
slot-scope="scope"
>
{{ scope.row.dept_.name }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['employee_update'])"
type="primary"
size="small"
@click="handleEdit(scope)"
>
编辑
</el-link>
<el-link
v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['user_delete'])"
type="danger"
size="small"
@click="handleDelete(scope)"
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="userList.count>0"
:total="userList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card>
</div>
</template>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 100px;
height: 100px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 100px;
height: 100px;
display: block;
}
</style>
<script>
import { getUserList, createUser, deleteUser, updateUser } from "@/api/user";
import { deleteUser} from "@/api/user";
import {getEmployeeList,} from "@/api/employee";
import checkPermission from "@/utils/permission"
import {upUrl, upHeaders} from "@/api/file"
import Pagination from "@/components/Pagination" // secondary package based on el-pagination
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getEmployeeList, } from "@/api/employee";
import { getOrgAll } from "@/api/org"
import { getRoleAll } from "@/api/role"
import { genTree } from "@/utils"
import checkPermission from "@/utils/permission"
import { upUrl, upHeaders } from "@/api/file"
import Pagination from "@/components/Pagination" // secondary package based on el-pagination
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
const defaultUser = {
id: "",
name: "",
username: "",
dept: null,
avatar: "/media/default/avatar.png"
};
export default {
components: { Pagination, Treeselect },
data() {
return {
user: defaultUser,
upHeaders: upHeaders(),
upUrl: upUrl(),
userList: {count:0},
roles: [],
listLoading: true,
listQuery: {
page: 1,
page_size: 20
},
enabledOptions: [
{ key: "true", display_name: "激活" },
{ key: "false", display_name: "禁用" }
],
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
username: [{ required: true, message: "请输入账号", trigger: "change" }]
// password: [
// { required: true, message: '请输入密码', trigger: 'change' }
// ],
},
filterOrgText: "",
treeLoding: false,
orgData: []
};
},
computed: {},
watch: {
filterOrgText(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
},
methods: {
checkPermission,
handleAvatarSuccess(res, file) {
this.user.avatar = res.data.path
},
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 0.5;
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 500KB!");
}
return isLt2M;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
handleOrgClick(obj, node, vue) {
this.listQuery.page = 1;
this.listQuery.dept = obj.id;
this.getList();
},
getList() {
this.listLoading = true;
getEmployeeList(this.listQuery).then(response => {
if (response.data) {
this.userList = response.data
}
this.listLoading = false;
});
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20
const defaultUser = {
id: "",
name: "",
username: "",
dept: null,
avatar: "/media/default/avatar.png"
};
export default {
components: {Pagination},
data() {
return {
user: defaultUser,
upHeaders: upHeaders(),
upUrl: upUrl(),
userList: {count: 0},
roles: [],
listLoading: true,
listQuery: {
page: 1,
page_size: 20
},
enabledOptions: [
{key: "true", display_name: "激活"},
{key: "false", display_name: "禁用"}
],
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入姓名", trigger: "blur"}],
username: [{required: true, message: "请输入账号", trigger: "change"}]
},
filterOrgText: "",
treeLoding: false,
orgData: []
};
},
computed: {},
watch: {
filterOrgText(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
handleEdit(scope) {
this.$router.push({name:"userupdate",params:{id:scope.row.id}})
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error"
})
.then(async () => {
await deleteUser(scope.row.id);
this.userList.splice(scope.row.index, 1);
this.$message({
type: "success",
message: "成功删除!"
});
})
.catch(err => {
console.error(err);
methods: {
checkPermission,
handleAvatarSuccess(res) {
this.user.avatar = res.data.path
},
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 0.5;
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 500KB!");
}
return isLt2M;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
handleOrgClick(obj) {
this.listQuery.page = 1;
this.listQuery.dept = obj.id;
this.getList();
},
getList() {
this.listLoading = true;
getEmployeeList(this.listQuery).then(response => {
if (response.data) {
this.userList = response.data
}
this.listLoading = false;
});
},
}
};
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20
};
this.getList();
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
handleEdit(scope) {
this.$router.push({name: "userupdate", params: {id: scope.row.id}})
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error"
})
.then(async () => {
await deleteUser(scope.row.id);
this.userList.splice(scope.row.index, 1);
this.$message({
type: "success",
message: "成功删除!"
});
})
.catch(err => {
this.$message.error(err);
});
},
}
};
</script>

View File

@ -3,31 +3,30 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>生产任务列表</span>
<el-input
v-model="listQuery.search"
placeholder="任务编号/订单编号/合同编号/产品名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.search"
placeholder="任务编号/订单编号/合同编号/产品名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
<el-table
:data="productionplanList.results"
border
@ -37,61 +36,54 @@
height="300"
@row-click="tableRowClick"
>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" width="110">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="任务编号" prop="number" width="110">
</el-table-column>
<el-table-column label="订单编号" width="110">
<template slot-scope="scope">{{ scope.row.order_.number }}</template>
</el-table-column>
<el-table-column label="合同编号" width="110">
<template slot-scope="scope" v-if="scope.row.order_">{{
scope.row.order_.contract_.number
}}</template>
<template slot-scope="scope" v-if="scope.row.order_">
<span v-if="scope.row.order_.contract_">{{scope.row.order_.contract_.number}}</span>
</template>
</el-table-column>
<el-table-column label="产品名称" width="250" >
<el-table-column label="产品名称" width="250">
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
</el-table-column>
<el-table-column label="产品型号" width="110">
<template slot-scope="scope">{{
scope.row.product_.specification
}}</template>
<template slot-scope="scope">
{{scope.row.product_.specification}}
</template>
</el-table-column>
<el-table-column label="产品单位" width="110">
<template slot-scope="scope">{{ scope.row.product_.unit }}</template>
</el-table-column>
<el-table-column label="生产数量" width="110">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column label="生产数量" prop="count" width="110">
</el-table-column>
<el-table-column label="状态" width="110">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="计划开工时间" width="110">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
<el-table-column label="计划开工时间" prop="start_date" width="110">
</el-table-column>
<el-table-column label="计划完工时间" width="110">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
<el-table-column label="计划完工时间" prop="end_date" width="110">
</el-table-column>
<el-table-column label="交付截止时间" width="110">
<template slot-scope="scope">{{
scope.row.order_.delivery_date
}}</template>
<template slot-scope="scope">
{{scope.row.order_.delivery_date}}
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
fixed="right"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.is_planed&&checkPermission(['testitem_detail'])"
type="primary"
v-if="scope.row.is_planed"
@click="handleselectplan(scope)"
>详情
>
详情
</el-link>
</template>
</el-table-column>
@ -107,79 +99,159 @@
<el-card class="box-card">
<div style="height: 40px;line-height: 40px;background: #F5F7FA;padding-left: 20px;">甘特图</div>
<gantt
style="position: relative"
v-if="proList.length>0"
:proList="proList"
style="position: relative"
></gantt>
</el-card>
</div>
</template>
<script>
import {getPlanGantt} from "@/api/srm";
import gantt from "@/components/Gantt/index";
import { getProductionplanList} from "@/api/pm";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination, gantt },
data() {
return {
productionplanList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
state_:{
10: "制定中",
20: "已下达",
30: "已接受",
40: "生产中",
50: "已完成",
60: "军检完成",
70: "暂停",
80: "终止"},
listLoading: true,
proList: [],
import {getPlanGantt} from "@/api/srm";
import gantt from "@/components/Gantt/index";
import {getProductionplanList} from "@/api/pm";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: {Pagination, gantt},
data() {
return {
productionplanList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
state_: {
10: "制定中",
20: "已下达",
30: "已接受",
40: "生产中",
50: "已完成",
60: "军检完成",
70: "暂停",
80: "终止"
},
listLoading: true,
proList: [],
};
},
computed: {},
watch: {},
created() {
this.getplanList();
},
methods: {
checkPermission,
//搜索生产计划
handleFilter() {
this.listQuery.page = 1;
};
},
computed: {},
watch: {},
created() {
this.getplanList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getplanList();
},
//生产计划列表
tableRowClick(row){
let that = this;
getPlanGantt({}).then(res=>{
if(res.code===200){
let arr =[],list=[];
let li = res.data.results;
li.forEach((item)=>{
if(item.id===row.id){
list.push(item)
}
});
debugger;
console.log(list);
list.forEach(item => {
if (!item.children || item.children.length < 1) {
methods: {
checkPermission,
//搜索生产计划
handleFilter() {
this.listQuery.page = 1;
this.getplanList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getplanList();
},
//生产计划列表
tableRowClick(row) {
let that = this;
getPlanGantt({}).then(res => {
if (res.code === 200) {
let arr = [], list = [];
let li = res.data.results;
li.forEach((item) => {
if (item.id === row.id) {
list.push(item)
}
});
// debugger;
// console.log(list);
list.forEach(item => {
if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.per1 = item.count_ok;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
} else if (item.children && item.children.length >= 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let temp = [];
let parentId = item.id;
let children = item.children;
children.forEach(child => {
let start = new Date(child.start_date).getTime();
let end = new Date(child.end_date).getTime();
let objChild = new Object();
objChild.name = child.number;
objChild.id = child.id;
objChild.top = 50;
objChild.parentId = parentId;
objChild.startTime = start;
objChild.endTime = end;
objChild.planTime = [start, end];
objChild.per = child.count;
objChild.per1 = child.count_ok;
objChild.type = 1;
objChild.productName = child.product_.name;
objChild.productNum = child.product_.specification;
objChild.isShow = true;
temp.push(objChild);
});
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.per1 = item.count_ok;
obj.type = 3;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.children = temp;
obj.isShow = true;
arr.push(obj);
}
that.proList = arr;
// debugger;
// console.log(arr)
});
} else {
that.$message.error(res.msg);
}
})
},
//列表
getplanList() {
let that = this;
this.listLoading = true;
getProductionplanList(this.listQuery).then((response) => {
if (response.data) {
this.productionplanList = response.data;
let list = response.data.results;
let arr = [];
debugger;
list.forEach((item) => {
// if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
@ -195,105 +267,28 @@ export default {
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
} else if (item.children && item.children.length >= 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let temp =[];
let parentId = item.id;
let children = item.children;
children.forEach(child => {
let start = new Date(child.start_date).getTime();
let end = new Date(child.end_date).getTime();
let objChild = new Object();
objChild.name = child.number;
objChild.id = child.id;
objChild.top=50;
objChild.parentId=parentId;
objChild.startTime = start;
objChild.endTime = end;
objChild.planTime = [start,end];
objChild.per = child.count;
objChild.per1 = child.count_real;
objChild.type = 1;
objChild.productName = child.product_.name;
objChild.productNum = child.product_.specification;
objChild.isShow= true;
temp.push(objChild);
});
let obj=new Object();
obj.name=item.number;
obj.id=item.id;
obj.top=20;
obj.startTime=startTime;
obj.endTime=endTime;
obj.planTime = [startTime,endTime];
obj.per=item.count;
obj.per1=item.count_real;
obj.type=3;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.children = temp;
obj.isShow= true;
arr.push(obj);
}
that.proList = arr;
debugger;
console.log(arr)
});
}else{
that.$message.error(res.msg);
}
})
// }
that.proList = arr;
});
}
this.listLoading = false;
});
},
//详情
handleselectplan(scope) {
this.$router.push({name: "plandetails", params: {id: scope.row.id}});
},
},
//列表
getplanList() {
let that = this;
this.listLoading = true;
getProductionplanList(this.listQuery).then((response) => {
if (response.data) {
this.productionplanList = response.data;
let list = response.data.results;
let arr = [];
list.forEach((item) => {
// if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
// }
that.proList = arr;
});
}
this.listLoading = false;
});
},
//详情
handleselectplan(scope){
this.$router.push({ name: "plandetails", params: { id: scope.row.id } });
},
},
};
};
</script>
//样式文件
<style>
.el-table .warning-row {
background: oldlace;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@ -16,14 +16,16 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置
>
重置
</el-button>
<el-table
:data="productionplanList.results"
@ -33,55 +35,49 @@
style="width: 100%"
height="300"
>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" width="110">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="任务编号" prop="number" width="110">
</el-table-column>
<el-table-column label="订单编号" width="110">
<template slot-scope="scope">{{ scope.row.order_.number }}</template>
</el-table-column>
<el-table-column label="合同编号" width="110">
<template slot-scope="scope" v-if="scope.row.contract">{{
scope.row.order_.contract_.number
}}</template>
<template slot-scope="scope" v-if="scope.row.order_.contract_">
<span v-if="scope.row.order_.contract_">{{scope.row.order_.contract_.number }}</span>
</template>
</el-table-column>
<el-table-column label="产品名称" width="150" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
</el-table-column>
<el-table-column label="产品型号" width="110">
<template slot-scope="scope">{{
scope.row.product_.specification
}}</template>
<template slot-scope="scope">
{{scope.row.product_.specification}}
</template>
</el-table-column>
<el-table-column label="产品单位" width="110">
<template slot-scope="scope">{{ scope.row.product_.unit }}</template>
</el-table-column>
<el-table-column label="生产数量" width="110">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column label="生产数量" prop="count" width="110">
</el-table-column>
<el-table-column label="状态" width="110">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="计划开工时间" width="110">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
<el-table-column label="计划开工时间" prop="start_date" width="110">
</el-table-column>
<el-table-column label="计划完工时间" width="110">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
<el-table-column label="计划完工时间" prop="end_date" width="110">
</el-table-column>
<el-table-column label="交货日期" width="110">
<template slot-scope="scope">{{
scope.row.order_.delivery_date
}}</template>
<template slot-scope="scope">
{{scope.row.order_.delivery_date}}
</template>
</el-table-column>
<el-table-column label="是否生成子计划" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_planed == false"></el-tag>
<el-tag v-if="scope.row.is_planed == true"></el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time" width="160">
</el-table-column>
<el-table-column
align="center"
@ -90,31 +86,40 @@
width="150px"
>
<template slot-scope="scope">
<el-link type="warning"
v-if="scope.row.state != 70"
@click="handlestatesuspended(scope)"
>暂停
<el-link
v-if="checkPermission(['plan_toggle'])&&scope.row.state !== 70"
type="warning"
@click="handlestatesuspended(scope)"
>
暂停
</el-link>
<el-link
v-if="checkPermission(['plan_toggle'])&&scope.row.state === 70"
type="primary"
v-if="scope.row.state == 70"
@click="handlestate(scope)"
>启用
>
启用
</el-link>
<el-link
type="danger"
v-if="scope.row.state == 70"
v-if="checkPermission(['plan_stop'])&&scope.row.state === 70"
type="danger"
@click="handlestatestop(scope)"
>终止
>
终止
</el-link>
<el-link
v-if="checkPermission(['plan_subcreate'])&&scope.row.is_planed"
type="primary"
v-if="scope.row.is_planed"
@click="handleselectplan(scope)"
>查看子计划
>
查看子计划
</el-link>
<el-link type="primary" v-else @click="handleWork(scope)"
>生成子计划
<el-link
v-if="checkPermission(['plan_subcreate'])&&!scope.row.is_planed"
type="primary"
@click="handleWork(scope)"
>
生成子计划
</el-link>
</template>
</el-table-column>
@ -161,7 +166,8 @@
<el-table-column label="产品型号" width="110">
<template slot-scope="scope">{{
scope.row.product_.specification
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="产品数量">
<template slot-scope="scope">{{ scope.row.count }}</template>
@ -182,10 +188,12 @@
width="80px"
>
<template slot-scope="scope">
<el-link type="primary"
v-if="checkPermission(['warehouse_update'])"
@click="handleclick(scope)"
>排产
<el-link
v-if="checkPermission(['plan_create'])"
type="primary"
@click="handleclick(scope)"
>
排产
</el-link>
</template>
</el-table-column>
@ -229,10 +237,18 @@
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false"
>取消</el-button
<el-button
type="danger"
@click="dialogVisible = false"
>
<el-button type="primary" @click="confirm('Form')">确认</el-button>
取消
</el-button>
<el-button
type="primary"
@click="confirm('Form')"
>
确认
</el-button>
</div>
</el-dialog>
</el-tab-pane>
@ -243,264 +259,264 @@
</div>
</template>
<script>
import gantt from "@/components/Gantt/index";
import { getordertoplan } from "@/api/sam";
import {
createProductionplan,
getProductionplanList,
createsubplan,
plantoggle,
planstop
} from "@/api/pm";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
import gantt from "@/components/Gantt/index";
import {getordertoplan} from "@/api/sam";
import {
createProductionplan,
getProductionplanList,
createsubplan,
plantoggle,
planstop
} from "@/api/pm";
import {getMaterialList} from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = {};
export default {
components: { Pagination, gantt },
data() {
return {
orderplan: defaulteorderplan,
orderList: {
count: 0,
},
state_: {
10: "制定中",
20: "已下达",
30: "已接受",
40: "生产中",
50: "已完成",
60: "军检完成",
70: "暂停",
80: "终止",
},
listQuery: {
page: 1,
page_size: 20,
},
productionplanList: {
count: 0,
},
listQuery1: {
page: 1,
page_size: 20,
},
value1: "",
listLoading: true,
dialogVisiblestate: false,
ganttShow: false,
dialogVisible: false,
dialogType: "new",
activeName: "订单排产",
rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }],
},
proList: [],
};
},
computed: {},
watch: {},
created() {
this.getorderList();
this.getplanList();
},
methods: {
checkPermission,
//订单列表
getorderList() {
this.listLoading = true;
getordertoplan(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
},
//生产计划列表
//列表
getplanList() {
let that = this;
this.listLoading = true;
getProductionplanList(this.listQuery1).then((response) => {
if (response.data) {
this.productionplanList = response.data;
let list = response.data.results;
let arr = [];
list.forEach((item) => {
if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
}
that.proList = arr;
});
}
this.listLoading = false;
});
},
//修改任务状态设置暂停
handlestatesuspended(scope) {
this.$confirm("确认暂停任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await plantoggle(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务暂停成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//修改任务状态设置启动
handlestate(scope) {
this.$confirm("确认启动任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await plantoggle(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务启动成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//修改任务状态设置终止
handlestatestop(scope) {
this.$confirm("确认终止任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await planstop(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务终止成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//搜索生产计划
handleFilter() {
this.listQuery1.page = 1;
this.getplanList();
},
resetFilter() {
this.listQuery1 = {
page: 1,
page_size: 20,
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = {};
export default {
components: {Pagination, gantt},
data() {
return {
orderplan: defaulteorderplan,
orderList: {
count: 0,
},
state_: {
10: "制定中",
20: "已下达",
30: "已接受",
40: "生产中",
50: "已完成",
60: "军检完成",
70: "暂停",
80: "终止",
},
listQuery: {
page: 1,
page_size: 20,
},
productionplanList: {
count: 0,
},
listQuery1: {
page: 1,
page_size: 20,
},
value1: "",
listLoading: true,
dialogVisiblestate: false,
ganttShow: false,
dialogVisible: false,
dialogType: "new",
activeName: "订单排产",
rule1: {
number: [{required: true, message: "请输入", trigger: "blur"}],
},
proList: [],
};
},
computed: {},
watch: {},
created() {
this.getorderList();
this.getplanList();
},
handleclick(scope) {
this.orderID = scope.row.id;
this.countsx = scope.row.count;
this.planed_count = scope.row.planed_count;
this.delivery_date = scope.row.delivery_date;
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].resetFields();
this.value1 = "";
});
},
async confirm(form) {
this.orderplan.start_date = this.value1[0];
methods: {
checkPermission,
if (this.delivery_date >= this.value1[1]) {
this.orderplan.end_date = this.value1[1];
} else {
this.$message.error("计划完成时间超过订单交付日期,请从新选择日期!");
}
this.orderplan.order = this.orderID;
if (this.orderplan.count <= this.countsx - this.planed_count) {
createProductionplan(this.orderplan).then((res) => {
if (res.code >= 200) {
this.getorderList();
this.getplanList();
this.dialogVisible = false;
this.$message.success("成功");
//订单列表
getorderList() {
this.listLoading = true;
getordertoplan(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
} else {
this.$message.error("排产数超过所需数,请合理排产!");
}
},
handleWork(scope) {
this.$confirm("确认生成子计划?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await createsubplan(scope.row.id).then((res) => {
},
//生产计划列表
//列表
getplanList() {
let that = this;
this.listLoading = true;
getProductionplanList(this.listQuery1).then((response) => {
if (response.data) {
this.productionplanList = response.data;
let list = response.data.results;
let arr = [];
list.forEach((item) => {
if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
}
that.proList = arr;
});
}
this.listLoading = false;
});
},
//修改任务状态设置暂停
handlestatesuspended(scope) {
this.$confirm("确认暂停任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await plantoggle(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务暂停成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//修改任务状态设置启动
handlestate(scope) {
this.$confirm("确认启动任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await plantoggle(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务启动成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//修改任务状态设置终止
handlestatestop(scope) {
this.$confirm("确认终止任务?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await planstop(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("任务终止成功!");
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
//搜索生产计划
handleFilter() {
this.listQuery1.page = 1;
this.getplanList();
},
resetFilter() {
this.listQuery1 = {
page: 1,
page_size: 20,
};
this.getplanList();
},
handleclick(scope) {
this.orderID = scope.row.id;
this.countsx = scope.row.count;
this.planed_count = scope.row.planed_count;
this.delivery_date = scope.row.delivery_date;
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].resetFields();
this.value1 = "";
});
},
async confirm(form) {
this.orderplan.start_date = this.value1[0];
if (this.delivery_date >= this.value1[1]) {
this.orderplan.end_date = this.value1[1];
} else {
this.$message.error("计划完成时间超过订单交付日期,请从新选择日期!");
}
this.orderplan.order = this.orderID;
if (this.orderplan.count <= this.countsx - this.planed_count) {
createProductionplan(this.orderplan).then((res) => {
if (res.code >= 200) {
this.$message.success("生成子计划成功!");
this.$router.push({ name: "work", params: { id: scope.row.id } });
this.getorderList();
this.getplanList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.$message.error("排产数超过所需数,请合理排产!");
}
},
handleWork(scope) {
this.$confirm("确认生成子计划?", "提醒", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.catch((err) => {
console.error(err);
});
.then(async () => {
await createsubplan(scope.row.id).then((res) => {
if (res.code >= 200) {
this.$message.success("生成子计划成功!");
this.$router.push({name: "work", params: {id: scope.row.id}});
this.getplanList();
}
});
})
.catch((err) => {
console.error(err);
});
},
activeNameClick(tab, event) {
debugger;
console.log(tab, event);
if (tab.label === "甘特图") {
this.ganttShow = true;
} else {
this.ganttShow = false;
}
},
//查看子计划
handleselectplan(scope) {
this.$router.push({name: "work", params: {id: scope.row.id}});
},
},
activeNameClick(tab, event) {
debugger;
console.log(tab, event);
if (tab.label === "甘特图") {
this.ganttShow = true;
} else {
this.ganttShow = false;
}
},
//查看子计划
handleselectplan(scope) {
this.$router.push({ name: "work", params: { id: scope.row.id } });
},
},
};
};
</script>
<style>
.el-table .warning-row {
background: oldlace;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@ -6,10 +6,16 @@
<div slot="header" class="clearfix">
<span>合同订单列表</span>
</div>
<el-button type="primary" @click="handlecount">计算物料</el-button>
<el-button
v-if="checkPermission(['resource_cal'])"
type="primary"
@click="handlecount"
>
计算物料
</el-button>
<el-table
:data="orderList.results"
ref="multipleTable"
:data="orderList.results"
border
fit
stripe
@ -17,7 +23,7 @@
height="100"
v-el-height-adaptive-table="{ bottomOffset: 25 }"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="订单编号" width="110">
<template slot-scope="scope">{{ scope.row.number }}</template>
@ -26,7 +32,8 @@
<el-table-column label="所需产品" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.product_.name
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="产品数量">
@ -35,38 +42,45 @@
<el-table-column label="已派数量">
<template slot-scope="scope">{{
scope.row.planed_count
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="产品型号">
<template slot-scope="scope">{{
scope.row.product_.specification
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="客户名称" show-overflow-tooltip width="150">
<template slot-scope="scope">{{
scope.row.customer_.name
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="合同编号" show-overflow-tooltip width="150">
<template slot-scope="scope" v-if=" scope.row.contract_">{{
scope.row.contract_.number
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="合同名称" show-overflow-tooltip width="150">
<template slot-scope="scope" v-if=" scope.row.contract_">{{
scope.row.contract_.name
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="交货日期" width="110">
<template slot-scope="scope">{{
scope.row.delivery_date
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="创建时间" width="110">
<template slot-scope="scope">{{
scope.row.create_time
}}</template>
}}
</template>
</el-table-column>
<el-table-column label="计划生产数" width="150px" fixed="right">
<template slot-scope="scope">
@ -99,12 +113,13 @@
<div slot="header" class="clearfix">
<span>物料配置</span>
<el-button
v-if="butshow&&checkPermission(['resource_cal'])"
type="primary"
style="float: right; "
@click="handlebcpcount"
type="primary"
v-if="butshow"
>半成品折合</el-button
>
半成品折合
</el-button>
</div>
<el-table
:data="materialpzTable"
@ -115,16 +130,16 @@
height="330"
ref="multipleTables"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column label="物料名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="物料类型">
<template slot-scope="scope">
{{ options_[scope.row.type] }}</template
>
{{ options_[scope.row.type] }}
</template>
</el-table-column>
<el-table-column label="物料编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
@ -142,30 +157,26 @@
</el-form-item>
</el-form>
</div>
<div v-else>{{ scope.row.count }}</div></template
>
<div v-else>{{ scope.row.count }}</div>
</template>
</el-table-column>
<el-table-column label="剩余量">
<template slot-scope="scope">
<el-tag
v-if="
scope.row.count_safe != null &&
scope.row.count_safe >
scope.row.inv_count - scope.row.count
"
v-if="scope.row.count_safe != null &&scope.row.count_safe >scope.row.inv_count - scope.row.count"
type="danger"
>
{{ scope.row.inv_count - scope.row.count }}</el-tag
>
{{ scope.row.inv_count - scope.row.count }}
</el-tag>
<el-tag v-else>
{{ scope.row.inv_count - scope.row.count }}</el-tag
>
{{ scope.row.inv_count - scope.row.count }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="安全库存">
<template slot-scope="scope">{{
scope.row.count_safe
}}</template>
<template slot-scope="scope">
{{scope.row.count_safe }}
</template>
</el-table-column>
</el-table>
</el-card>
@ -185,41 +196,41 @@
style="width: 100%"
height="280"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="设备名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="设备状态">
<template slot-scope="scope">
<div v-if="scope.row.type===2">
<el-tag v-if="scope.row.state===40" type="danger">
禁用
</el-tag>
<el-tag v-else type="success">
合格
</el-tag>
</div>
<div v-else>
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</div>
</template>
<div v-if="scope.row.type===2">
<el-tag v-if="scope.row.state===40" type="danger">
禁用
</el-tag>
<el-tag v-else type="success">
合格
</el-tag>
</div>
<div v-else>
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="设备编号">
<template slot-scope="scope">
{{ scope.row.number }}</template
>
{{ scope.row.number }}
</template>
</el-table-column>
<el-table-column label="设备型号">
<template slot-scope="scope"> {{ scope.row.model }}</template>
@ -239,152 +250,152 @@
</el-row>
</div>
</template>
<script>
import { getordertoplan } from "@/api/sam";
import {
createProductionplan,
createConvert,
createresource,
createequip,
} from "@/api/pm";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
<script>
import {getordertoplan} from "@/api/sam";
import {
createProductionplan,
createConvert,
createresource,
createequip,
} from "@/api/pm";
import {getMaterialList} from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = {};
export default {
components: { Pagination },
data() {
return {
orderplan: defaulteorderplan,
orderList: {
count: 0,
},
options_: {
1: "成品",
2: "半成品",
3: "主要原料",
4: "辅助原料",
5: "加工工具",
6: "辅助工具",
},
state_: {
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
listQuery: {
page: 1,
page_size: 20,
},
materialpzTable: [],
mutipID: [],
bcpID: [],
equipmentTable: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
zhbcp: [],
rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }],
},
butshow:true,
};
},
computed: {},
watch: {},
created() {
this.getorderList();
},
methods: {
checkPermission,
//订单列表
getorderList() {
this.listLoading = true;
getordertoplan(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = {};
export default {
components: {Pagination},
data() {
return {
orderplan: defaulteorderplan,
orderList: {
count: 0,
},
options_: {
1: "成品",
2: "半成品",
3: "主要原料",
4: "辅助原料",
5: "加工工具",
6: "辅助工具",
},
state_: {
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
listQuery: {
page: 1,
page_size: 20,
},
materialpzTable: [],
mutipID: [],
bcpID: [],
equipmentTable: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
zhbcp: [],
rule1: {
number: [{required: true, message: "请输入", trigger: "blur"}],
},
butshow: true,
};
},
//物料计算
handlecount() {
let _this = this;
this.butshow=true;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push({
id: item.product_.id,
count: item.pgcount,
});
});
createresource(this.mutipID).then((res) => {
if (res.code >= 200) {
this.materialpzTable = res.data;
this.$message.success("物料计算成功");
}
});
createequip(this.mutipID).then((res) => {
if (res.code >= 200) {
this.equipmentTable = res.data;
this.$message.success("成功");
}
});
computed: {},
watch: {},
created() {
this.getorderList();
},
//半成品折合物料
handlebcpcount() {
let _this = this;
_this.bcpID = [];
this.$refs.multipleTables.selection.forEach((item) => {
_this.bcpID.push({
id: item.id,
count: item.bcpcount,
methods: {
checkPermission,
//订单列表
getorderList() {
this.listLoading = true;
getordertoplan(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
});
},
createConvert(this.bcpID).then((res) => {
if (res.code >= 200) {
this.materialpzTable.forEach((items) => {
res.data.forEach((item) => {
if (item.id == items.id) {
items.count = items.count - item.count;
}
});
//物料计算
handlecount() {
let _this = this;
this.butshow = true;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push({
id: item.product_.id,
count: item.pgcount,
});
});
console.log(this.materialpzTable);
this.butshow=false;
}
});
},
createresource(this.mutipID).then((res) => {
if (res.code >= 200) {
this.materialpzTable = res.data;
this.$message.success("物料计算成功");
}
});
createequip(this.mutipID).then((res) => {
if (res.code >= 200) {
this.equipmentTable = res.data;
this.$message.success("成功");
}
});
},
handleclick(scope) {
this.orderID = scope.row.id;
//半成品折合物料
handlebcpcount() {
let _this = this;
_this.bcpID = [];
this.$refs.multipleTables.selection.forEach((item) => {
_this.bcpID.push({
id: item.id,
count: item.bcpcount,
});
});
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
createConvert(this.bcpID).then((res) => {
if (res.code >= 200) {
this.materialpzTable.forEach((items) => {
res.data.forEach((item) => {
if (item.id == items.id) {
items.count = items.count - item.count;
}
});
});
console.log(this.materialpzTable);
this.butshow = false;
}
});
},
handleclick(scope) {
this.orderID = scope.row.id;
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
async confirm(form) {
this.orderplan.start_date = this.value1[0];
this.orderplan.end_date = this.value1[1];
this.orderplan.order = this.orderID;
createProductionplan(this.orderplan).then((res) => {
if (res.code >= 200) {
this.getorderList();
this.getplanList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
},
async confirm(form) {
this.orderplan.start_date = this.value1[0];
this.orderplan.end_date = this.value1[1];
this.orderplan.order = this.orderID;
createProductionplan(this.orderplan).then((res) => {
if (res.code >= 200) {
this.getorderList();
this.getplanList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
},
};
</script>
};
</script>

View File

@ -2,10 +2,14 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增采购订单</el-button
<el-button
v-if="checkPermission(['puorder_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增采购订单
</el-button>
<el-input
v-model="listQuery.search"
placeholder="采购订单编号、供应商名称"
@ -18,15 +22,17 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
</el-card>
<el-card style="margin-top: 2px">
@ -41,14 +47,13 @@
height="100"
v-el-height-adaptive-table="{ bottomOffset: 43 }"
>
<el-table-column type="index" width="50" />
<el-table-column label="采购订单编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="采购订单编号" prop="number">
</el-table-column>
<el-table-column label="供应商">
<template slot-scope="scope" v-if="scope.row.vendor_">{{
scope.row.vendor_.name
}}</template>
<template slot-scope="scope" v-if="scope.row.vendor_">
{{scope.row.vendor_.name}}
</template>
</el-table-column>
<el-table-column label="审核情况" width="150">
<template slot-scope="scope">
@ -56,38 +61,38 @@
<el-tag v-else-if="scope.row.is_audited == true">已审核</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['vendor_update'])"
type="primary"
v-if="checkPermission(['puorder_update'])"
type="primary"
@click="handlePuOrderItem(scope)"
>订单项</el-link
>
订单项
</el-link>
<el-link
v-if="
checkPermission(['vendor_update']) &&
scope.row.is_audited == false
"
type="primary"
v-if="checkPermission(['puorder_hear']) &&scope.row.is_audited == false"
type="primary"
@click="handleAudit(scope)"
>审核</el-link
>
审核
</el-link>
<el-link
v-if="checkPermission(['vendor_update'])"
type="primary"
v-if="checkPermission(['puorder_update'])"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['vendor_delete'])"
v-if="checkPermission(['puorder_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -111,13 +116,13 @@
:rules="rule1"
>
<el-form-item label="订单编号" prop="number">
<el-input v-model="puorder.number" placeholder="订单编号" />
<el-input v-model="puorder.number" placeholder="订单编号"/>
</el-form-item>
<el-form-item label="供应商" prop="vendor">
<el-select
style="width: 100%"
v-model="puorder.vendor"
style="width: 100%"
placeholder="请选择"
>
<el-option
@ -138,157 +143,157 @@
</div>
</template>
<script>
import { getpVendorList } from "@/api/vendor";
import { getUserList } from "@/api/user";
import {
getPuorderList,
createPuorder,
updatePuorder,
deletePuorder,
createPuorderAudit,
createPuorderItem,
deletePuorderItem,
} from "@/api/pum";
import checkPermission from "@/utils/permission";
import {getpVendorList} from "@/api/vendor";
import {getUserList} from "@/api/user";
import {
getPuorderList,
createPuorder,
updatePuorder,
deletePuorder,
createPuorderAudit,
createPuorderItem,
deletePuorderItem,
} from "@/api/pum";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultpuorder = {
number: "",
};
export default {
components: { Pagination },
data() {
return {
puorder: defaultpuorder,
puorderList: {
count: 0,
},
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultpuorder = {
number: "",
};
export default {
components: {Pagination},
data() {
return {
puorder: defaultpuorder,
puorderList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
vendorList: [],
dialogVisible: false,
dialogType: "new",
rule1: {
number: [{ required: true, message: "请输入", trigger: "blur" }],
vendor: [
{ required: true, message: "请选择供应商", trigger: "change" },
],
},
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getVendorList();
},
methods: {
checkPermission,
//采购订单
getList() {
this.listLoading = true;
getPuorderList(this.listQuery).then((response) => {
if (response.data) {
this.puorderList = response.data;
}
this.listLoading = false;
});
},
//供应商列表
getVendorList() {
getpVendorList({ page: 0 }).then((response) => {
if (response.data) {
this.vendorList = response.data;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
listQuery: {
page: 1,
page_size: 20,
},
vendorList: [],
dialogVisible: false,
dialogType: "new",
rule1: {
number: [{required: true, message: "请输入", trigger: "blur"}],
vendor: [
{required: true, message: "请选择供应商", trigger: "change"},
],
},
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getVendorList();
},
handleCreate() {
this.puorder = Object.assign({}, defaultpuorder);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.puorder = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deletePuorder(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updatePuorder(this.puorder.id, this.puorder).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createPuorder(this.puorder).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
methods: {
checkPermission,
//采购订单
getList() {
this.listLoading = true;
getPuorderList(this.listQuery).then((response) => {
if (response.data) {
this.puorderList = response.data;
}
} else {
return false;
}
});
},
handlePuOrderItem(scope) {
this.$router.push({ name: "puorderitem", params: { id: scope.row.id } });
},
handleAudit(scope) {
this.listLoading = false;
});
},
//供应商列表
getVendorList() {
getpVendorList({page: 0}).then((response) => {
if (response.data) {
this.vendorList = response.data;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.puorder = Object.assign({}, defaultpuorder);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
createPuorderAudit(scope.row.id).then((res) => {
if (res.code >= 200) {
this.getList();
this.$message.success("审核成功!");
}
});
handleEdit(scope) {
this.puorder = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deletePuorder(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updatePuorder(this.puorder.id, this.puorder).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createPuorder(this.puorder).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
handlePuOrderItem(scope) {
this.$router.push({name: "puorderitem", params: {id: scope.row.id}});
},
handleAudit(scope) {
createPuorderAudit(scope.row.id).then((res) => {
if (res.code >= 200) {
this.getList();
this.$message.success("审核成功!");
}
});
},
},
},
};
};
</script>

View File

@ -2,7 +2,12 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">
<el-button
v-if="checkPermission(['vendor_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增供应商
</el-button>
<el-input
@ -43,27 +48,19 @@
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="供应商名">
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column label="供应商名" prop="name">
</el-table-column>
<el-table-column label="联系人">
<template slot-scope="scope">{{ scope.row.contact }}</template>
<el-table-column label="联系人" prop="contact">
</el-table-column>
<el-table-column label="联系电话">
<template slot-scope="scope">{{ scope.row.contact_phone }}</template>
<el-table-column label="联系电话" prop="contact_phone">
</el-table-column>
<el-table-column label="地址" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.address }}</template>
<el-table-column label="地址" prop="address" min-width="120" show-overflow-tooltip>
</el-table-column>
<el-table-column label="供应物料">
<template slot-scope="scope">{{ scope.row.material }}</template>
<el-table-column label="供应物料" prop="material">
</el-table-column>
<el-table-column label="备注">
<template slot-scope="scope">{{ scope.row.description }}</template>
<el-table-column label="备注" prop="description">
</el-table-column>
<el-table-column label="创建时间" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time" width="160">
</el-table-column>
<el-table-column
align="center"
@ -98,7 +95,7 @@
</el-card>
<el-dialog
:visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑设备' : '新增设备'"
:title="dialogType === 'edit' ? '编辑供应商' : '新增供应商'"
>
<el-form
ref="Form"
@ -124,9 +121,9 @@
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input
v-model="vendor.description"
type="textarea"
:rows="4"
v-model="vendor.description"
placeholder="备注"
/>
</el-form-item>
@ -140,10 +137,9 @@
</template>
<script>
import {getpVendorList, createVendor, updateVendor, deleteVendor} from "@/api/vendor";
import {getUserList} from "@/api/user";
// import {getUserList} from "@/api/user";
import checkPermission from "@/utils/permission";
import {genTree} from "@/utils";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultvendor = {
name: "",
@ -205,13 +201,15 @@
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
};
this.getList();
},
handleCreate() {
this.vendor = Object.assign({}, defaultvendor);
this.dialogType = "new";
@ -229,6 +227,7 @@
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
@ -241,7 +240,7 @@
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},

View File

@ -1,289 +1,242 @@
<template>
<div class="app-container">
<el-card>
<el-tabs v-model="activeName" type="card">
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="待军检" name="first">
<el-button type="primary" icon="el-icon-plus" @click="handleorder"
>申请
<el-button
v-if="checkPermission(['wp_need_to_order'])"
type="primary"
icon="el-icon-plus"
@click="handleorder"
>
申请
</el-button>
<el-table
:data="iproductData.results"
ref="multipleTable"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData.count > 0"
:total="iproductData.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
<el-table
ref="multipleTable"
:data="iproductData.results"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData.count > 0"
:total="iproductData.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="军检列表" name="second">
<el-table
:data="iproductData2.results"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
<el-table-column label="订单">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{
scope.row.to_order_.number
}}</span>
<el-tag
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
<el-table
:data="iproductData2.results"
border
fit
stripe
highlight-current-row
max-height="700"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column>
<el-table-column label="订单">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
<el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
需要确定订单
</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="军检">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
>
需要确定订单
</el-tag>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{
scope.row.to_order_.contract_.name
}}</span>
<span
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
>
</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope">
<span v-if="scope.row.to_order_">{{
scope.row.to_order_.customer_.name
}}</span>
<span
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
>
</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="军检">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
<span v-else></span></template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="220px"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.is_mtestok==null"
@click="handleMtest(scope)"
>军检</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData2.count > 0"
:total="iproductData2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
@click="handleMtest(scope)"
>
军检
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="iproductData2.count > 0"
:total="iproductData2.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-tab-pane>
</el-tabs>
<el-dialog
:visible.sync="dialogVisible"
:close-on-click-modal="false"
title="军检"
>
<el-form
ref="Form"
:model="mtest"
label-width="150px"
label-position="right"
<el-dialog
:visible.sync="dialogVisible"
:close-on-click-modal="false"
title="军检"
>
<el-form
ref="Form"
:model="mtest"
label-width="150px"
label-position="right"
>
<el-form-item label="军检是否合格">
<el-radio v-model="mtest.is_mtestok" label=True >合格</el-radio>
<el-radio v-model="mtest.is_mtestok" label=False >不合格</el-radio>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="mtest.remark_mtest" placeholder="备注" />
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="smtconfirm('Form')">确认</el-button>
</div>
</el-dialog>
<el-radio v-model="mtest.is_mtestok" label=True>合格</el-radio>
<el-radio v-model="mtest.is_mtestok" label=False>不合格</el-radio>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="mtest.remark_mtest" placeholder="备注"/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="smtconfirm('Form')">确认</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { getiproductList,saleMtest} from "@/api/inm";
import checkPermission from "@/utils/permission";
import { mtest, needtoorder, } from "@/api/wpm";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import {getiproductList} from "@/api/inm";
import checkPermission from "@/utils/permission";
import {mtest, needtoorder,} from "@/api/wpm";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
iproductData: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
iproductData2: {
count: 0,
},
listQuery2: {
page: 1,
page_size: 20,
},
mtest: {},
salesdetail:"",
saleproduct:"",
dialogVisible:false,
activeName: 'first',
mutipID1:[],
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getList2();
},
methods: {
checkPermission,
getList(){
this.listQuery.material__type = 1;
this.listQuery.need_to_order=false;
getiproductList(this.listQuery).then((response) => {
if (response.data) {
this.iproductData= response.data;
}
});
},
getList2(){
this.listQuery2.material__type = 1;
getiproductList(this.listQuery2).then((response) => {
if (response.data) {
this.iproductData2= response.data;
}
});
},
handleMtest(scope){
this.saleproduct=scope.row.wproduct;
this.dialogVisible=true;
export default {
components: {Pagination},
data() {
return {
iproductData: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
iproductData2: {
count: 0,
},
listQuery2: {
page: 1,
page_size: 20,
},
mtest: {},
salesdetail: "",
saleproduct: "",
dialogVisible: false,
activeName: 'first',
mutipID1: [],
};
},
smtconfirm(){
mtest(this.saleproduct,this.mtest).then((res) => {
if (res.code >= 200) {
this.getList2();
this.dialogVisible = false;
this.$message.success("成功");
}
});
created() {
this.getList();
this.getList2();
},
//批量申请
handleorder() {
let _this = this;
_this.mutipID1 = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID1.push(item.wproduct);
});
needtoorder({
wproducts: this.mutipID1,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("申请成功!");
this.getList();
}
});
}
},
};
methods: {
checkPermission,
getList() {
this.listQuery.material__type = 1;
this.listQuery.need_to_order = false;
getiproductList(this.listQuery).then((response) => {
if (response.data) {
this.iproductData = response.data;
}
});
},
getList2() {
this.listQuery2.material__type = 1;
getiproductList(this.listQuery2).then((response) => {
if (response.data) {
this.iproductData2 = response.data;
}
});
},
handleMtest(scope) {
this.saleproduct = scope.row.wproduct;
this.dialogVisible = true;
},
smtconfirm() {
mtest(this.saleproduct, this.mtest).then((res) => {
if (res.code >= 200) {
this.getList2();
this.dialogVisible = false;
this.$message.success("成功");
}
});
},
//批量申请
handleorder() {
let _this = this;
_this.mutipID1 = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID1.push(item.wproduct);
});
needtoorder({
wproducts: this.mutipID1,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("申请成功!");
this.getList();
}
});
}
},
};
</script>

View File

@ -2,70 +2,67 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增合同</el-button
>
<el-input
v-model="listQuery.search"
placeholder="客户名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<el-button
v-if="checkPermission(['contract_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增合同
</el-button>
<el-input
v-model="listQuery.search"
placeholder="客户名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="contractList.results"
border
border
fit
stripe
highlight-current-row
height="100"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="合同名称" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="合同名称" prop="name" width="160" show-overflow-tooltip>
</el-table-column>
<el-table-column label="合同编号" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="合同编号" prop="number" width="160" show-overflow-tooltip>
</el-table-column>
<el-table-column label="合同金额(元)" width="120">
<template slot-scope="scope">{{ scope.row.amount }}</template>
<el-table-column label="合同金额(元)" prop="amount" width="120">
</el-table-column>
<el-table-column label="开票金额(元)" width="120" >
<template slot-scope="scope">{{ scope.row.invoice }}</template>
<el-table-column label="开票金额(元)" prop="invoice" width="120">
</el-table-column>
<el-table-column label="客户名称" width="130" show-overflow-tooltip>
<el-table-column label="客户名称" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
</el-table-column>
<el-table-column label="签订日期" width="120" >
<template slot-scope="scope">{{ scope.row.sign_date }}</template>
<el-table-column label="签订日期" prop="sign_date" width="120">
</el-table-column>
<el-table-column label="描述" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.description }}</template>
<el-table-column label="描述" prop="description" width="130" show-overflow-tooltip>
</el-table-column>
<el-table-column label="创建时间" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time" width="160">
</el-table-column>
<el-table-column
align="center"
@ -74,27 +71,27 @@
fixed="right"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['contract_update'])"
type="primary"
@click="handleEdit(scope)"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['warehouse_delete'])"
v-if="checkPermission(['contract_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
<el-link
v-if="checkPermission(['warehouse_delete'])"
type="primary"
删除
</el-link>
<el-link
v-if="checkPermission(['contract_update'])"
type="primary"
@click="handleDetail(scope)"
>详情</el-link
>
详情
</el-link>
</template>
</el-table-column>
</el-table>
@ -118,19 +115,19 @@
:rules="rule1"
>
<el-form-item label="合同名称" prop="name">
<el-input v-model="contract.name" placeholder="合同名称" />
<el-input v-model="contract.name" placeholder="合同名称"/>
</el-form-item>
<el-form-item label="合同编号" prop="number">
<el-input v-model="contract.number" placeholder="合同编号" />
<el-input v-model="contract.number" placeholder="合同编号"/>
</el-form-item>
<el-form-item label="合同金额(元)" prop="amount">
<el-input v-model="contract.amount" placeholder="合同金额" />
<el-form-item label="合同金额(元)" prop="amount">
<el-input v-model="contract.amount" placeholder="合同金额"/>
</el-form-item>
<el-form-item label="开票金额(元)" prop="invoice">
<el-input v-model="contract.invoice" placeholder="开票金额" />
<el-input v-model="contract.invoice" placeholder="开票金额"/>
</el-form-item>
<el-form-item label="签订日期" prop="sign_date">
<el-date-picker
<el-form-item label="签订日期" prop="sign_date">
<el-date-picker
v-model="contract.sign_date"
type="date"
placeholder="选择日期"
@ -139,20 +136,19 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="客户" prop="sign_date">
<el-select style="width: 100%" v-model="contract.customer" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-form-item label="客户" prop="sign_date">
<el-select style="width: 100%" v-model="contract.customer" 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-form-item label="描述" prop="description">
<el-input v-model="contract.description" placeholder="描述" />
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="contract.description" placeholder="描述"/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -162,137 +158,137 @@
</div>
</template>
<script>
import { getContractList, createContract,updateContract,deleteContract,getCustomerList } from "@/api/sam";
import checkPermission from "@/utils/permission";
import {getContractList, createContract, updateContract, deleteContract, getCustomerList} from "@/api/sam";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultecontract = {
};
export default {
components: { Pagination },
data() {
return {
contract: defaultecontract,
contractList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
options:[],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getLists();
this.getList();
},
methods: {
checkPermission,
getList() {
this.listLoading = true;
getContractList(this.listQuery).then((response) => {
if (response.data) {
this.contractList = response.data;
}
this.listLoading = false;
});
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultecontract = {};
export default {
components: {Pagination},
data() {
return {
contract: defaultecontract,
contractList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
options: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
},
};
},
getLists() {
getCustomerList({pageoff:true}).then((response) => {
this.options = genTree(response.data);
});
},
handleFilter() {
this.listQuery.page = 1;
created() {
this.getLists();
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.contract = Object.assign({}, defaultecontract);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.contract = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteContract(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateContract(this.contract.id, this.contract).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createContract(this.contract).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
methods: {
checkPermission,
getList() {
this.listLoading = true;
getContractList(this.listQuery).then((response) => {
if (response.data) {
this.contractList = response.data;
}
} else {
return false;
}
});
this.listLoading = false;
});
},
getLists() {
getCustomerList({pageoff: true}).then((response) => {
this.options = genTree(response.data);
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.contract = Object.assign({}, defaultecontract);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.contract = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteContract(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateContract(this.contract.id, this.contract).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createContract(this.contract).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
//合同详情
handleDetail(scope) {
this.$router.push({name: "contractdetail", params: {id: scope.row.id},})
}
},
//合同详情
handleDetail(scope){
this.$router.push({name: "contractdetail", params: { id: scope.row.id }, })
}
},
};
};
</script>

View File

@ -2,34 +2,40 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增客户</el-button
>
<el-input
v-model="listQuery.search"
placeholder="客户名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<el-button
v-if="checkPermission(['customer_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增客户
</el-button>
<el-input
v-model="listQuery.search"
placeholder="客户名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="customerList.results"
@ -37,48 +43,41 @@
fit
stripe
highlight-current-row
height="100"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="客户名称" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="客户名称" prop="name" width="200" show-overflow-tooltip>
</el-table-column>
<el-table-column label="详细地址" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.address }}</template>
<el-table-column label="详细地址" prop="address" width="200" show-overflow-tooltip>
</el-table-column>
<el-table-column label="联系人" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.contact }}</template>
<el-table-column label="联系人" prop="contact" width="130" show-overflow-tooltip>
</el-table-column>
<el-table-column label="联系电话" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.contact_phone }}</template>
<el-table-column label="联系电话" prop="contact_phone" width="130" show-overflow-tooltip>
</el-table-column>
<el-table-column label="描述" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.description }}</template>
<el-table-column label="描述" prop="description" width="200" show-overflow-tooltip>
</el-table-column>
<el-table-column label="创建时间" width="160" >
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column label="创建时间" prop="create_time" width="160">
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleEdit(scope)"
v-if="checkPermission(['customer_update'])"
type="primary"
>编辑</el-link
@click="handleEdit(scope)"
>
编辑
</el-link>
<el-link
v-if="checkPermission(['warehouse_delete'])"
v-if="checkPermission(['customer_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -103,21 +102,21 @@
:rules="rule1"
>
<el-form-item label="客户名称" prop="name">
<el-input v-model="customer.name" placeholder="客户名称" />
<el-input v-model="customer.name" placeholder="客户名称"/>
</el-form-item>
<el-form-item label="客户地址" prop="address">
<el-input v-model="customer.address" placeholder="客户地址" />
<el-input v-model="customer.address" placeholder="客户地址"/>
</el-form-item>
<el-form-item label="联系人" prop="contact">
<el-input v-model="customer.contact" placeholder="联系人" />
<el-form-item label="联系人" prop="contact">
<el-input v-model="customer.contact" placeholder="联系人"/>
</el-form-item>
<el-form-item label="联系电话" prop="contact_phone">
<el-input v-model="customer.contact_phone" placeholder="联系电话" />
<el-form-item label="联系电话" prop="contact_phone">
<el-input v-model="customer.contact_phone" placeholder="联系电话"/>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="customer.description" placeholder="描述" />
<el-form-item label="描述" prop="description">
<el-input v-model="customer.description" placeholder="描述"/>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -127,123 +126,124 @@
</div>
</template>
<script>
import { getCustomerList, createCustomer,updateCustomer,deleteCustomer } from "@/api/sam";
import checkPermission from "@/utils/permission";
import {getCustomerList, createCustomer, updateCustomer, deleteCustomer} from "@/api/sam";
import checkPermission from "@/utils/permission";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultecustomer = {};
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultecustomer = {
};
export default {
components: { Pagination },
data() {
return {
customer: defaultecustomer,
customerList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
getCustomerList(this.listQuery).then((response) => {
if (response.data) {
this.customerList = response.data;
}
this.listLoading = false;
});
export default {
components: {Pagination},
data() {
return {
customer: defaultecustomer,
customerList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
},
};
},
handleFilter() {
this.listQuery.page = 1;
created() {
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.customer = Object.assign({}, defaultecustomer);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.customer = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteCustomer(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateCustomer(this.customer.id, this.customer).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createCustomer(this.customer).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
methods: {
checkPermission,
//设备列表
getList() {
this.listLoading = true;
getCustomerList(this.listQuery).then((response) => {
if (response.data) {
this.customerList = response.data;
}
} else {
return false;
}
});
this.listLoading = false;
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.customer = Object.assign({}, defaultecustomer);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.customer = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteCustomer(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateCustomer(this.customer.id, this.customer).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createCustomer(this.customer).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
},
},
};
};
</script>

View File

@ -2,34 +2,40 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增订单</el-button
>
<el-input
v-model="listQuery.search"
placeholder="订单名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<el-button
v-if="checkPermission(['order_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增订单
</el-button>
<el-input
v-model="listQuery.search"
placeholder="订单名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>
重置
</el-button>
</div>
</el-card>
<el-card >
<el-card>
<el-table
v-loading="listLoading"
:data="orderList.results"
@ -37,69 +43,67 @@
fit
stripe
highlight-current-row
height="100"
height="100"
v-el-height-adaptive-table="{bottomOffset: 42}"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="订单编号" prop="number" width="160" show-overflow-tooltip>
</el-table-column>
<el-table-column label="客户" width="200" show-overflow-tooltip>
<el-table-column label="客户" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template>
</el-table-column>
<el-table-column label="所属合同" width="200" show-overflow-tooltip>
<el-table-column label="所属合同" width="200" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.contract">{{ scope.row.contract_.name }}</template>
</el-table-column>
<el-table-column label="产品名称" width="200" show-overflow-tooltip>
<el-table-column label="产品名称" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
</el-table-column>
<el-table-column label="产品型号" width="120" show-overflow-tooltip>
<el-table-column label="产品型号" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
</el-table-column>
<el-table-column label="产品数量" width="90" >
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column label="产品数量" prop="count" width="90">
</el-table-column>
<el-table-column label="交货日期" width="150" >
<template slot-scope="scope">{{ scope.row.delivery_date }}</template>
<el-table-column label="交货日期" prop="delivery_date" width="150">
</el-table-column>
<el-table-column label="已交货数量" width="150" >
<template slot-scope="scope">{{ scope.row.delivered_count }}</template>
<el-table-column label="已交货数量" prop="delivered_count" width="150">
</el-table-column>
<el-table-column label="是否需要军检" width="150" >
<template slot-scope="scope">
<el-tag v-if="scope.row.need_mtest == false"></el-tag>
<el-tag v-else-if="scope.row.need_mtest == true"></el-tag></template>
</el-table-column>
<el-table-column label="创建时间" width="160" >
<el-table-column label="是否需要军检" width="150">
<template slot-scope="scope">
<el-tag v-if="scope.row.need_mtest === false"></el-tag>
<el-tag v-else-if="scope.row.need_mtest === true"></el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
fixed="right"
width="130"
fixed="right"
width="130"
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['order_update'])"
@click="handleEdit(scope)"
type="primary"
>编辑</el-link
>
编辑
</el-link>
<el-link
v-if="checkPermission(['warehouse_delete'])"
v-if="checkPermission(['order_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
<el-link
v-if="checkPermission(['warehouse_delete'])"
type="primary"
删除
</el-link>
<el-link
v-if="checkPermission(['order_update'])"
type="primary"
@click="handleDetail(scope)"
>详情</el-link
>
详情
</el-link>
</template>
</el-table-column>
</el-table>
@ -123,26 +127,24 @@
label-position="right"
:rules="rule1"
>
<el-form-item label="订单编号" prop="number">
<el-input v-model="order.number" placeholder="订单编号自动生成" disabled="true" />
<el-input v-model="order.number" placeholder="订单编号自动生成" disabled="true"/>
</el-form-item>
<el-form-item label="所需产品" prop="product">
<el-select style="width: 100%" v-model="order.product" placeholder="请选择">
<el-option
v-for="item in productoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-form-item label="所需产品" prop="product">
<el-select style="width: 100%" v-model="order.product" placeholder="请选择">
<el-option
v-for="item in productoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所需数量" prop="count" >
<el-input-number type="number" v-model="order.count" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="交货日期" prop="delivery_date">
<el-date-picker
<el-form-item label="所需数量" prop="count">
<el-input-number type="number" v-model="order.count" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="交货日期" prop="delivery_date">
<el-date-picker
v-model="order.delivery_date"
type="date"
placeholder="选择日期"
@ -151,31 +153,30 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="客户" prop="customer">
<el-select style="width: 100%" v-model="order.customer" placeholder="请选择">
<el-option
v-for="item in customeroptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
<el-form-item label="客户" prop="customer">
<el-select style="width: 100%" v-model="order.customer" placeholder="请选择">
<el-option
v-for="item in customeroptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属合同" prop="contract">
<el-select style="width: 100%" v-model="order.contract" @change="selectcontract" placeholder="请选择">
<el-option
v-for="item in contractoptions"
:key="item.id"
:label="item.name+'____'+item.number"
:value="item.id">
</el-option>
</el-form-item>
<el-form-item label="所属合同" prop="contract">
<el-select style="width: 100%" v-model="order.contract" @change="selectcontract" placeholder="请选择">
<el-option
v-for="item in contractoptions"
:key="item.id"
:label="item.name+'____'+item.number"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否军检">
<el-switch v-model="order.need_mtest"></el-switch>
</el-form-item>
</el-form-item>
<el-form-item label="是否军检">
<el-switch v-model="order.need_mtest"></el-switch>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -185,172 +186,174 @@
</div>
</template>
<script>
import { getOrderList, createOrder,updateOrder,deleteOrder,getContractList,getCustomerList,getContract } from "@/api/sam";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
import {
getOrderList,
createOrder,
updateOrder,
deleteOrder,
getContractList,
getCustomerList,
getContract
} from "@/api/sam";
import {getMaterialList} from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorder = {
need_mtest:false,
customer:""
};
export default {
components: { Pagination },
data() {
return {
order: defaulteorder,
orderList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
contractoptions:[],
productoptions:[],
customeroptions:[],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
product: [{ required: true, message: "请输入", trigger: "blur" }],
delivery_date: [{ required: true, message: "请输入", trigger: "blur" }],
},
};
},
computed: {},
watch: {},
created() {
this.getListm();
this.getListc();
this.getListcm();
this.getList();
},
methods: {
checkPermission,
getList() {
this.listLoading = true;
getOrderList(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
this.listLoading = false;
});
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorder = {
need_mtest: false,
customer: ""
};
export default {
components: {Pagination},
data() {
return {
order: defaulteorder,
orderList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
contractoptions: [],
productoptions: [],
customeroptions: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
rule1: {
product: [{required: true, message: "请输入", trigger: "blur"}],
delivery_date: [{required: true, message: "请输入", trigger: "blur"}],
},
};
},
getListm() {
getMaterialList({pageoff:true,type:1}).then((response) => {
this.productoptions = genTree(response.data);
});
},
getListc() {
getContractList({pageoff:true}).then((response) => {
this.contractoptions = response.data;
});
},
getListcm() {
getCustomerList({pageoff:true}).then((response) => {
this.customeroptions = genTree(response.data);
});
},
selectcontract(selval)
{
getContract(selval).then((response) => {
if (response.data) {
console.log(response.data);
this.order.customer = response.data.customer_.name;
}
});
},
handleFilter() {
this.listQuery.page = 1;
created() {
this.getListm();
this.getListc();
this.getListcm();
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.order = Object.assign({}, defaulteorder);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.order = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteOrder(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateOrder(this.order.id, this.order).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createOrder(this.order).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
methods: {
checkPermission,
getList() {
this.listLoading = true;
getOrderList(this.listQuery).then((response) => {
if (response.data) {
this.orderList = response.data;
}
} else {
return false;
}
});
this.listLoading = false;
});
},
getListm() {
getMaterialList({pageoff: true, type: 1}).then((response) => {
this.productoptions = genTree(response.data);
});
},
getListc() {
getContractList({pageoff: true}).then((response) => {
this.contractoptions = response.data;
});
},
getListcm() {
getCustomerList({pageoff: true}).then((response) => {
this.customeroptions = genTree(response.data);
});
},
selectcontract(selval) {
getContract(selval).then((response) => {
if (response.data) {
// console.log(response.data);
this.order.customer = response.data.customer_.name;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.order = Object.assign({}, defaulteorder);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.order = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteOrder(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateOrder(this.order.id, this.order).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
createOrder(this.order).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
//订单详情
handleDetail(scope) {
this.$router.push({name: "orderdetail", params: {id: scope.row.id},})
}
},
//订单详情
handleDetail(scope){
this.$router.push({name: "orderdetail", params: { id: scope.row.id }, })
}
},
};
};
</script>

View File

@ -49,6 +49,9 @@
</el-table-column>
<el-table-column label="生产数量" >
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
<el-table-column label="状态" width="110">
<template slot-scope="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="计划开工时间" >
<template slot-scope="scope">{{ scope.row.start_date }}</template>
@ -88,6 +91,16 @@ export default {
productionplan:"",
orderdetail:"",
state_: {
10: "制定中",
20: "已下达",
30: "已接受",
40: "生产中",
50: "已完成",
60: "军检完成",
70: "暂停",
80: "终止",
},
};
},

View File

@ -2,9 +2,14 @@
<div class="app-container">
<el-card>
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>新增销售发货</el-button
<el-button
v-if="checkPermission(['sale_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增销售发货
</el-button>
<el-input
v-model="listQuery.search"
placeholder="客户名称"
@ -17,15 +22,17 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
重置
</el-button>
</div>
</el-card>
<el-card>
@ -38,82 +45,73 @@
height="100"
v-el-height-adaptive-table="{ bottomOffset: 42 }"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="产品名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.product">{{
scope.row.product_.name
}}</template>
<template slot-scope="scope" v-if="scope.row.product">
{{scope.row.product_.name}}
</template>
</el-table-column>
<el-table-column label="产品型号" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.product">{{
scope.row.product_.specification
}}</template>
<template slot-scope="scope" v-if="scope.row.product">
{{scope.row.product_.specification}}
</template>
</el-table-column>
<el-table-column label="客户名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.customer">{{
scope.row.customer_.name
}}</template>
<template slot-scope="scope" v-if="scope.row.customer">
{{scope.row.customer_.name}}
</template>
</el-table-column>
<el-table-column label="订单编号" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.order">{{
scope.row.order_.number
}}</template>
<template slot-scope="scope" v-if="scope.row.order">
{{scope.row.order_.number }}
</template>
</el-table-column>
<el-table-column label="合同名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.order_">{{
scope.row.order_.contract_.name
}}</template>
<template slot-scope="scope" v-if="scope.row.order_">
{{scope.row.order_.contract_.name}}
</template>
</el-table-column>
<el-table-column label="预计发货时间">
<template slot-scope="scope">{{ scope.row.edelivery_date }}</template>
<el-table-column label="预计发货时间" prop="edelivery_date">
</el-table-column>
<el-table-column label="预计发货数量">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column label="预计发货数量" prop="count">
</el-table-column>
<el-table-column label="实际发货数量">
<template slot-scope="scope">{{ scope.row.count_real }}</template>
<el-table-column label="实际发货数量" prop="count_real">
</el-table-column>
<el-table-column label="是否审核">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_audited == false"></el-tag>
<el-tag v-else></el-tag></template
>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="收货人">
<template slot-scope="scope">{{ scope.row.receiver }}</template>
<el-table-column label="收货人" prop="receiver">
</el-table-column>
<el-table-column label="收货人电话">
<template slot-scope="scope">{{ scope.row.receiver_phone }}</template>
<el-table-column label="收货人电话" prop="receiver_phone">
</el-table-column>
<el-table-column label="收货人地址" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.receiver_address
}}</template>
<el-table-column label="收货人地址" prop="receiver_address" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_delete'])"
v-if="checkPermission(['sale_create'])"
type="primary"
@click="handleDetail(scope)"
>详情</el-link
>
详情
</el-link>
<el-link
v-if="scope.row.is_audited == false"
v-if="checkPermission(['sale_hear'])&&scope.row.is_audited == false"
type="primary"
@click="handleAudit(scope)"
>审核</el-link
>
审核
</el-link>
<el-link
v-if="scope.row.is_audited == false"
v-if="checkPermission(['sale_delete'])&&scope.row.is_audited == false"
type="danger"
@click="handleDelete(scope)"
>删除</el-link
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
@ -139,10 +137,10 @@
>
<el-form-item label="关联订单" prop="name">
<el-select
style="width: 100%"
v-model="sale.order"
@change="selectorder"
style="width: 100%"
placeholder="请选择"
@change="selectorder"
>
<el-option
v-for="item in orderoptions"
@ -153,14 +151,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关联客户" prop="customer" >
<el-form-item label="关联客户" prop="customer">
<el-select
style="width: 100%"
v-model="sale.customer"
@change="selectcustomer"
style="width: 100%"
placeholder="请选择"
:disabled="show"
:disabled="show"
@change="selectcustomer"
>
<el-option
v-for="item in customeroptions"
@ -171,18 +168,17 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关联合同" prop="contract">
<el-input v-model="sale.contract" placeholder="关联合同" :disabled="edit"/>
<el-form-item label="关联合同" prop="contract">
<el-input v-model="sale.contract" placeholder="关联合同" :disabled="edit"/>
</el-form-item>
<el-form-item label="所需产品" prop="product">
<el-select
:disabled="show"
style="width: 100%"
v-model="sale.product"
@change="selectproduct"
placeholder="请选择"
ref="btn"
v-model="sale.product"
:disabled="show"
style="width: 100%"
placeholder="请选择"
@change="selectproduct"
>
<el-option
v-for="item in materialoptions"
@ -193,46 +189,41 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="选择产品" prop="iproducts">
<el-table
ref="multipleTable"
:data="iproductoptions"
border
fit
stripe
highlight-current-row
ref="multipleTable"
height="200"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column label="成品编号" prop="number">
</el-table-column>
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
<el-table-column label="成品批次" prop="batch">
</el-table-column>
<el-table-column label="成品名称">
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
<template slot-scope="scope">
{{scope.row.material_.name}}
</template>
</el-table-column>
<el-table-column label="所在仓库">
<template slot-scope="scope">{{
scope.row.warehouse_.name
}}</template>
<template slot-scope="scope">
{{scope.row.warehouse_.name}}
</template>
</el-table-column>
<el-table-column label="是否已军检">
<template slot-scope="scope">
<el-tag v-if="scope.row.is_mtested == false">未军检</el-tag>
<el-tag v-else>已军检</el-tag></template
>
<el-tag v-else>已军检</el-tag>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="预计发货时间" prop="edelivery_date">
<el-date-picker
v-model="sale.edelivery_date"
@ -261,7 +252,7 @@
</el-form-item>
<el-form-item label="收货人" prop="receiver">
<el-input v-model="sale.receiver" placeholder="收货人" />
<el-input v-model="sale.receiver" placeholder="收货人"/>
</el-form-item>
<el-form-item label="联系电话" prop="receiver_phone">
<el-input
@ -270,11 +261,11 @@
/>
</el-form-item>
<el-form-item label="收货地址" prop="receiver_address">
<el-input v-model="sale.receiver_address" placeholder="收货地址" />
<el-input v-model="sale.receiver_address" placeholder="收货地址"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="sale.remark" placeholder="备注" />
<el-input v-model="sale.remark" placeholder="备注"/>
</el-form-item>
</el-form>
@ -286,296 +277,293 @@
</div>
</template>
<script>
import {
createSale,
getOrderList,
getCustomerList,
getSaleList,
getOrder,
deleteSale,
getSale,
saleAudit,
getCustomer
} from "@/api/sam";
import checkPermission from "@/utils/permission";
import { getMaterialList } from "@/api/mtm";
import { getiproductList } from "@/api/inm";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteSale = {
order: null,
customer: null,
contract:"",
product: null,
edelivery_date: "",
trans_mode: null,
receiver: "",
receiver_phone: "",
receiver_address: "",
remark: "",
};
export default {
components: { Pagination },
data() {
return {
sale: defaulteSale,
saleList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
iproducts: [],
orderoptions: [],
customeroptions: [],
materialoptions: [],
iproductoptions: [],
dialogVisible: false,
show:false,
edit:true,
dialogType: "new",
options: [
{
value: 10,
label: "铁路快运",
import {
createSale,
getOrderList,
getCustomerList,
getSaleList,
getOrder,
deleteSale,
getSale,
saleAudit,
getCustomer,
updateContract
} from "@/api/sam";
import checkPermission from "@/utils/permission";
import {getMaterialList} from "@/api/mtm";
import {getiproductList} from "@/api/inm";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteSale = {
order: null,
customer: null,
contract: "",
product: null,
edelivery_date: "",
trans_mode: null,
receiver: "",
receiver_phone: "",
receiver_address: "",
remark: "",
};
export default {
components: {Pagination},
data() {
return {
sale: defaulteSale,
saleList: {
count: 0,
},
{
value: 20,
label: "铁路慢运",
listQuery: {
page: 1,
page_size: 20,
},
{
value: 30,
label: "铁路整车",
},
{
value: 40,
label: "汽车运输",
},
{
value: 50,
label: "空运",
},
],
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getCustomerLists();
// this.getproductList();
this.getOrderLists();
this.getMaterialList();
},
methods: {
checkPermission,
//关联订单
getOrderLists() {
getOrderList({ page: 0 }).then((response) => {
if (response.data) {
this.orderoptions = response.data;
}
});
},
//选择订单变化
selectorder(selval) {
getOrder(selval).then((response) => {
if (response.data) {
this.show=true;
this.sale.customer = response.data.customer;
this.sale.product = response.data.product;
this.sale.contract = response.data.contract_.name;
this.sale.receiver = response.data.customer_.contact;
this.sale.receiver_phone = response.data.customer_.contact_phone;
this.sale.receiver_address = response.data.customer_.address;
getiproductList({
page: 0,
to_order: response.data.id,
state: 10,
}).then((response) => {
if (response.data) {
this.iproductoptions = response.data;
}
});
}
});
},
selectcustomer(selval)
{
getCustomer(selval).then((response) => {
if (response.data) {
this.sale.receiver = response.data.contact;
this.sale.receiver_phone = response.data.contact_phone;
this.sale.receiver_address = response.data.address;
}
});
},
getList() {
getSaleList(this.listQuery).then((response) => {
if (response.data) {
this.saleList = response.data;
}
});
},
//关联客户
getCustomerLists() {
getCustomerList({ page: 0 }).then((response) => {
this.customeroptions = response.data;
});
},
//选择产品
getMaterialList() {
getMaterialList({ type: 1, page: 0 }).then((response) => {
if (response.data) {
this.materialoptions = response.data;
}
});
},
//成品
// getproductList() {
// getiproductList({page:0,material__type:1}).then((response) => {
// if (response.data) {
// this.iproductoptions=response.data;
// }
// });
// },
//根据选择的产品弹出对应库里的产品
selectproduct() {
getiproductList({
page: 0,
material__type: 1,
material: this.sale.product,
}).then((response) => {
if (response.data) {
this.iproductoptions = response.data;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
iproducts: [],
orderoptions: [],
customeroptions: [],
materialoptions: [],
iproductoptions: [],
dialogVisible: false,
show: false,
edit: true,
dialogType: "new",
options: [
{
value: 10,
label: "铁路快运",
},
{
value: 20,
label: "铁路慢运",
},
{
value: 30,
label: "铁路整车",
},
{
value: 40,
label: "汽车运输",
},
{
value: 50,
label: "空运",
},
],
};
},
computed: {},
watch: {},
created() {
this.getList();
this.getCustomerLists();
// this.getproductList();
this.getOrderLists();
this.getMaterialList();
},
handleCreate() {
this.sale = Object.assign({}, defaulteSale);
this.dialogType = "new";
this.dialogVisible = true;
this.iproducts = [];
this.$nextTick(() => {
this.$refs["Form"].resetFields();
this.iproductoptions = [];
});
},
handleEdit(scope) {
this.sale = Object.assign({}, scope.row); // copy obj
console.log(this.sale);
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].resetFields();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteSale(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
methods: {
checkPermission,
//关联订单
getOrderLists() {
getOrderList({page: 0}).then((response) => {
if (response.data) {
this.orderoptions = response.data;
}
});
},
},
//选择订单变化
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateContract(this.sale.id, this.sale).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.$refs.multipleTable.selection.forEach((item) => {
this.iproducts.push(item.id);
});
selectorder(selval) {
this.sale.iproducts = this.iproducts;
createSale(this.sale).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
getOrder(selval).then((response) => {
if (response.data) {
this.show = true;
this.sale.customer = response.data.customer;
this.sale.product = response.data.product;
this.sale.contract = response.data.contract_.name;
this.sale.receiver = response.data.customer_.contact;
this.sale.receiver_phone = response.data.customer_.contact_phone;
this.sale.receiver_address = response.data.customer_.address;
getiproductList({
page: 0,
to_order: response.data.id,
state: 10,
}).then((response) => {
if (response.data) {
this.iproductoptions = response.data;
}
});
}
} else {
return false;
}
});
},
//销售详情
handleDetail(scope) {
this.$router.push({ name: "salesdetail", params: { id: scope.row.id } });
},
//审核
handleAudit(scope) {
this.$confirm("确认审核?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "success",
})
.then(async () => {
await saleAudit(scope.row.id);
this.getList();
this.$message.success("审核成功!");
})
.catch((err) => {
console.error(err);
});
},
selectcustomer(selval) {
getCustomer(selval).then((response) => {
if (response.data) {
this.sale.receiver = response.data.contact;
this.sale.receiver_phone = response.data.contact_phone;
this.sale.receiver_address = response.data.address;
}
});
},
getList() {
getSaleList(this.listQuery).then((response) => {
if (response.data) {
this.saleList = response.data;
}
});
},
//关联客户
getCustomerLists() {
getCustomerList({page: 0}).then((response) => {
this.customeroptions = response.data;
});
},
//选择产品
getMaterialList() {
getMaterialList({type: 1, page: 0}).then((response) => {
if (response.data) {
this.materialoptions = response.data;
}
});
},
//成品
// getproductList() {
// getiproductList({page:0,material__type:1}).then((response) => {
// if (response.data) {
// this.iproductoptions=response.data;
// }
// });
// },
//根据选择的产品弹出对应库里的产品
selectproduct() {
getiproductList({
page: 0,
material__type: 1,
material: this.sale.product,
}).then((response) => {
if (response.data) {
this.iproductoptions = response.data;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
handleCreate() {
this.sale = Object.assign({}, defaulteSale);
this.dialogType = "new";
this.dialogVisible = true;
this.iproducts = [];
this.$nextTick(() => {
this.$refs["Form"].resetFields();
this.iproductoptions = [];
});
},
handleEdit(scope) {
this.sale = Object.assign({}, scope.row); // copy obj
// console.log(this.sale);
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].resetFields();
});
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteSale(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
async confirm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
updateContract(this.sale.id, this.sale).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.$refs.multipleTable.selection.forEach((item) => {
this.iproducts.push(item.id);
});
this.sale.iproducts = this.iproducts;
createSale(this.sale).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
//销售详情
handleDetail(scope) {
this.$router.push({name: "salesdetail", params: {id: scope.row.id}});
},
//审核
handleAudit(scope) {
this.$confirm("确认审核?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "success",
})
.then(async () => {
await saleAudit(scope.row.id);
this.getList();
this.$message.success("审核成功!");
})
.catch((err) => {
this.$message.error(err);
});
},
},
},
};
};
</script>
<style scoped>
.trdiv >>> .el-transfer-panel {
width: 350px;
}
.trdiv >>> .el-transfer__buttons {
width: 110px;
}
.trdiv >>> .el-transfer-panel {
width: 350px;
}
.trdiv >>> .el-transfer__buttons {
width: 110px;
}
</style>

View File

@ -26,7 +26,7 @@
{{ salesdetail.order_.number }}
</el-descriptions-item>
<el-descriptions-item label="物流详情" v-if="ship_pic!=''">
<el-link :href="salesdetail.ship_pic">物流单</el-link></el-descriptions-item>
<el-link type="primary" :href="salesdetail.ship_pic">物流单</el-link></el-descriptions-item>
</el-descriptions>
<el-button type="primary" style="margin-top:10px" @click="upload">上传物流信息</el-button>
</el-card>
@ -76,7 +76,7 @@
<el-table-column label="装箱单号" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.packnum }}</template>
</el-table-column>
<el-table-column label="未装箱说明" show-overflow-tooltip>
<el-table-column label="备注" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.remark }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
@ -295,6 +295,7 @@ export default {
},
handleUpSuccess(res, file, filelist) {
this.ship.path = res.data.path;
this.salesdetail.ship_pic=res.data.path;
console.log(this.ship.path)
},
handleRemove(file, filelist){

View File

@ -2,30 +2,37 @@
<div class="app-container">
<el-card>
<div>
<el-button
v-if="checkPermission(['workflow_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增
</el-button>
<el-input
v-model="listQuery.search"
placeholder="名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
v-model="listQuery.search"
placeholder="名称"
style="width: 300px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div>
<div style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
重置
</el-button>
</div>
</el-card>
<el-card style="margin-top: 2px">
@ -38,20 +45,17 @@
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column type="index" width="50" />
<el-table-column label="名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
<el-table-column type="index" width="50"/>
<el-table-column label="名称" prop="name">
</el-table-column>
<el-table-column label="描述">
<template slot-scope="scope">{{ scope.row.description }}</template>
<el-table-column label="描述" prop="description">
</el-table-column>
<el-table-column label="工单查看权限校验">
<template slot-scope="scope">
{{ !!(scope.row.view_permission_check)?'':'' }}
</template>
</el-table-column>
<el-table-column width="180" label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
<el-table-column width="180" prop="create_time" label="创建时间">
</el-table-column>
<el-table-column
align="center"
@ -62,24 +66,36 @@
<el-link
v-if="checkPermission(['workflow_update'])"
@click="handlecfgt(scope)"
>配置</el-link>
>
配置
</el-link>
<el-link
v-if="checkPermission(['workflow_update'])"
@click="handleEdit(scope)"
>编辑</el-link>
>
编辑
</el-link>
<el-link
v-if="checkPermission(['workflow_delete'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link>
>
删除
</el-link>
<el-link
v-if="checkPermission(['workflow_update'])"
type="primary"
@click="handleTicket(scope)"
>查看工单</el-link>
>
查看工单
</el-link>
<el-link
v-if="checkPermission(['workflow_update'])"
type="primary"
@click="handleWatch(scope)"
>查看流程图</el-link>
>
查看流程图
</el-link>
</template>
</el-table-column>
</el-table>
@ -116,18 +132,19 @@
:model="workflow"
label-width="100px"
label-position="right"
:rules="rule1">
:rules="rule1"
>
<el-form-item label="名称" prop="name">
<el-input v-model="workflow.name" placeholder="名称" />
<el-input v-model="workflow.name" placeholder="名称"/>
</el-form-item>
<el-form-item label="流水号前缀">
<el-input v-model="workflow.sn_prefix " placeholder="流水号前缀" />
<el-input v-model="workflow.sn_prefix " placeholder="流水号前缀"/>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input
v-model="workflow.description"
type="textarea"
:rows="4"
v-model="workflow.description"
placeholder="描述"
/>
</el-form-item>
@ -147,10 +164,10 @@
/>
</el-form-item>
<el-form-item label="标题模板" prop="title_template">
<el-input v-model="workflow.title_template" placeholder="你有一个待办工单:{title}" />
<el-input v-model="workflow.title_template" placeholder="你有一个待办工单:{title}"/>
</el-form-item>
<el-form-item label="内容模板" prop="content_template">
<el-input v-model="workflow.content_template" placeholder="标题:{title}, 创建时间:{create_time}" />
<el-input v-model="workflow.content_template" placeholder="标题:{title}, 创建时间:{create_time}"/>
</el-form-item>
</el-form>
<div style="text-align: right">
@ -162,253 +179,274 @@
</template>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
import { getWfTransitionList,getWorkflowList, createWorkflow,updateWorkflow,deleteWorkflow,getWfCustomfieldList,getWfStateList } from "@/api/workflow";
import {
getWfTransitionList,
getWorkflowList,
createWorkflow,
updateWorkflow,
deleteWorkflow,
getWfCustomfieldList,
getWfStateList
} from "@/api/workflow";
import checkPermission from "@/utils/permission";
// import vueJsonEditor from 'vue-json-editor'
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import dagreD3 from 'dagre-d3'
import * as d3 from 'd3'
const defaultworkflow = {
name: "",
number: "",
};
export default {
components: { Pagination },
data() {
return {
// workflow: defaultworkflow,
workflow:{
name:'',
sn_prefix:'',
description:'',
view_permission_check:'',
display_form_str:'',
title_template:'',
content_template:'',
},
limitedWatch:false,
view_permission_check:false,
hasJsonFlag:true, // json是否验证通过
hasJsonFlag1:true, // json是否验证通过
workflowList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
choiceOption:[],
display_form_str:[],
limit_expression:[],
listLoading: true,
dialogVisible: false,
dialogType: "new",
watchedName:'',
watchedCreateTime:'',
rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
description: [{ required: true, message: "请输入", trigger: "blur" }]
},
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
checkPermission,
getList() {
this.listLoading = true;
getWorkflowList(this.listQuery).then((response) => {
if (response.data) {
this.workflowList = response.data;
}
this.listLoading = false;
});
const defaultworkflow = {
name: "",
number: "",
};
export default {
components: {Pagination},
data() {
return {
// workflow: defaultworkflow,
workflow: {
name: '',
sn_prefix: '',
description: '',
view_permission_check: '',
display_form_str: '',
title_template: '',
content_template: '',
},
limitedWatch: false,
view_permission_check: false,
hasJsonFlag: true, // json是否验证通过
hasJsonFlag1: true, // json是否验证通过
workflowList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
choiceOption: [],
display_form_str: [],
limit_expression: [],
listLoading: true,
dialogVisible: false,
dialogType: "new",
watchedName: '',
watchedCreateTime: '',
rule1: {
name: [{required: true, message: "请输入", trigger: "blur"}],
description: [{required: true, message: "请输入", trigger: "blur"}]
},
};
},
handleFilter() {
this.listQuery.page = 1;
computed: {},
watch: {},
created() {
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.workflow = Object.assign({}, defaultworkflow);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.workflow = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
getWfCustomfieldList(scope.row.id).then((response) => {
if (response.data) {
this.choiceOption = response.data;
}
});
},
handlecfgt(scope)
{
this.$router.push({name:"configuration",params:{workflow:scope.row.id}})
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWorkflow(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
handleTicket(scope){
this.$router.push({name:"workFlowTickets",params:{workflow:scope.row.id}})
},
async confirm(form) {
debugger;
console.log(this.workflow.display_form_str)
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
this.checkJson();
this.checkJson2();
updateWorkflow(this.workflow.id, this.workflow).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.checkJson();
this.checkJson2();
createWorkflow(this.workflow).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
handleWatch(scope){
let that = this;
let workFlow = scope.row.id;
that.watchedName = scope.row.name;
that.watchedCreateTime = scope.row.create_time;
that.limitedWatch = true;
that.$nextTick(()=>{
var g = new dagreD3.graphlib.Graph().setGraph({
rankdir: 'DL',
nodesep: 100,
edgesep: 10,//两条线之间的距离
ranksep: 50,//节点之间的距离
marginx: 160,
marginy: 20,
});
//获取state得到节点
getWfStateList(workFlow).then((response) => {
methods: {
checkPermission,
getList() {
this.listLoading = true;
getWorkflowList(this.listQuery).then((response) => {
if (response.data) {
let nodes = response.data;
// 添加节点
nodes.forEach((item) => {
g.setNode(item.id, {
// 节点标签
label: item.name,
// 节点形状
shape: 'rect',
toolText: item.name,
//节点样式
style: "fill:#fff;stroke:#000",
labelStyle: "fill:#000;",
rx :5,//矩形节点圆角度
ry :5
});
});
g.nodes().forEach(function (v) {
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
});
//获取流转得到线 链接关系
getWfTransitionList(workFlow).then((res)=>{
if(res.data){
let transitionList = res.data;
transitionList.forEach((transition0)=>{
if (transition0.condition_expression.length>0){
debugger;
g.setNode(transition0.source_state_.id+100000, {label: "条件表达式",style: "stroke: #000;fill: #afa", shape: "diamond"});
g.setEdge(transition0.source_state_.id, transition0.source_state_.id+100000, {
// 边标签
label: transition0.name,
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
});
let condition_expression = transition0.condition_expression;
condition_expression.forEach(condition_expression0=>{
g.setEdge(transition0.source_state_.id+100000, condition_expression0.target_state, {
label: condition_expression0.label,
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
})
})
}else{
g.setEdge(transition0.source_state_.id, transition0.destination_state_.id, {
// 边标签
label: transition0.name,
// 边样式
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
});
}
})
g.nodes().length-1
g.nodes().forEach(function (v) {
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
});
// 创建渲染器
let render = new dagreD3.render();
// 选择 svg 并添加一个g元素作为绘图容器.
let svg = d3.select('#mySvg');
let svgGroup = svg.append('g');
// 在绘图容器上运行渲染器生成流程图.
render(d3.select("svg g"), g);
}else{}
});
this.workflowList = response.data;
}
this.listLoading = false;
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.workflow = Object.assign({}, defaultworkflow);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.workflow = Object.assign({}, scope.row); // copy obj
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
getWfCustomfieldList(scope.row.id).then((response) => {
if (response.data) {
this.choiceOption = response.data;
}
});
},
})
},
closeMark(){
this.limitedWatch = false;
},
onJsonChange (value) {
handlecfgt(scope) {
this.$router.push({name: "configuration", params: {workflow: scope.row.id}})
},
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWorkflow(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
handleTicket(scope) {
this.$router.push({name: "workFlowTickets", params: {workflow: scope.row.id}})
},
async confirm(form) {
// console.log(this.workflow.display_form_str)
this.$refs[form].validate((valid) => {
if (valid) {
const isEdit = this.dialogType === "edit";
if (isEdit) {
this.checkJson();
this.checkJson2();
updateWorkflow(this.workflow.id, this.workflow).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.checkJson();
this.checkJson2();
createWorkflow(this.workflow).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else {
return false;
}
});
},
handleWatch(scope) {
let that = this;
let workFlow = scope.row.id;
that.watchedName = scope.row.name;
that.watchedCreateTime = scope.row.create_time;
that.limitedWatch = true;
that.$nextTick(() => {
var g = new dagreD3.graphlib.Graph().setGraph({
rankdir: 'DL',
nodesep: 100,
edgesep: 10,//两条线之间的距离
ranksep: 50,//节点之间的距离
marginx: 160,
marginy: 20,
});
//获取state得到节点
getWfStateList(workFlow).then((response) => {
if (response.data) {
let nodes = response.data;
// 添加节点
nodes.forEach((item) => {
g.setNode(item.id, {
// 节点标签
label: item.name,
// 节点形状
shape: 'rect',
toolText: item.name,
//节点样式
style: "fill:#fff;stroke:#000",
labelStyle: "fill:#000;",
rx: 5,//矩形节点圆角度
ry: 5
});
});
g.nodes().forEach(function (v) {
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
});
//获取流转得到线 链接关系
getWfTransitionList(workFlow).then((res) => {
if (res.data) {
let transitionList = res.data;
transitionList.forEach((transition0) => {
if (transition0.condition_expression.length > 0) {
debugger;
g.setNode(transition0.source_state_.id + 100000, {
label: "条件表达式",
style: "stroke: #000;fill: #afa",
shape: "diamond"
});
g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, {
// 边标签
label: transition0.name,
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
});
let condition_expression = transition0.condition_expression;
condition_expression.forEach(condition_expression0 => {
g.setEdge(transition0.source_state_.id + 100000, condition_expression0.target_state, {
label: condition_expression0.label,
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
})
})
} else {
g.setEdge(transition0.source_state_.id, transition0.destination_state_.id, {
// 边标签
label: transition0.name,
// 边样式
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
});
}
})
g.nodes().length - 1
g.nodes().forEach(function (v) {
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
});
// 创建渲染器
let render = new dagreD3.render();
// 选择 svg 并添加一个g元素作为绘图容器.
let svg = d3.select('#mySvg');
let svgGroup = svg.append('g');
// 在绘图容器上运行渲染器生成流程图.
render(d3.select("svg g"), g);
} else {
}
});
}
});
})
},
closeMark() {
this.limitedWatch = false;
},
onJsonChange(value) {
// console.log('更改value:', value);
// 实时保存
this.onJsonSave(value)
},
onJsonSave (value) {
onJsonSave(value) {
// console.log('保存value:', value);
this.limit_expression = value
this.hasJsonFlag = true
@ -416,20 +454,21 @@ export default {
onError(value) {
this.hasJsonFlag = false
},
onJsonChange1 (value) {
onJsonChange1(value) {
// 实时保存
this.onJsonSave1(value)
},
onJsonSave1 (value) {
onJsonSave1(value) {
this.display_form_str = value
this.hasJsonFlag1 = true
},
onError1(value) {
this.hasJsonFlag1 = false
},
// 检查json
checkJson(){
if (this.hasJsonFlag == false){
checkJson() {
if (this.hasJsonFlag == false) {
// alert("限制表达式json验证失败")
return false
} else {
@ -437,9 +476,10 @@ export default {
return true
}
},
// 检查json
checkJson2(){
if (this.hasJsonFlag1 == false){
// 检查json
checkJson2() {
if (this.hasJsonFlag1 == false) {
// alert("展现表单字段json验证失败")
return false
} else {
@ -447,24 +487,27 @@ export default {
return true
}
},
},
};
},
};
</script>
<style scoped>
::-webkit-scrollbar {
width: 15px;
}
::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.2);
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: #fefefe;
border-radius: 7px;
}
::-webkit-scrollbar-thumb{
::-webkit-scrollbar-thumb {
border-radius: 7px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.5);
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
background-color: #f5f5f5;
}
.svgMark{
.svgMark {
width: 100%;
height: 100%;
position: fixed;
@ -475,9 +518,10 @@ export default {
overflow: auto;
margin: 0;
z-index: 2000;
background: rgba(0,0,0,.3);
background: rgba(0, 0, 0, .3);
}
.svgWrapper{
.svgWrapper {
background: #fff;
width: 800px;
margin: 10vh auto 0;
@ -486,30 +530,36 @@ export default {
max-height: 80vh;
overflow-y: scroll;
}
.svgItem{
padding: 20px 40px 0 ;
.svgItem {
padding: 20px 40px 0;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
font-size: 18px;
display: flex;
justify-content: space-between;
}
svg {
font-size: 14px;
}
.node rect {
stroke: #606266;
fill: #fff;
}
.edgePath path {
stroke: #606266;
fill: #333;
stroke-width: 1.5px;
}
g.conditions > rect {
fill: #00ffd0;
stroke: #000;
}
.el-icon-close{
.el-icon-close {
cursor: pointer;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -63,21 +63,21 @@
>
<template slot-scope="scope">
<el-link
v-if="scope.row.first_test===null"
v-if="checkPermission(['first_test'])&&scope.row.first_test===null"
type="primary"
@click="handleTest(scope)"
>
首件检验
</el-link>
<el-link
v-else-if="scope.row.first_test!==null&&!scope.row.first_test_.is_submited"
v-else-if="checkPermission(['first_test'])&&scope.row.first_test!==null&&!scope.row.first_test_.is_submited"
type="primary"
@click="handleTestContinue(scope)"
>
检验
</el-link>
<el-link
v-else-if="scope.row.first_test_.is_submited&&(scope.row.leader_1===null||scope.row.leader_2===null||scope.row.leader_3===null)"
v-else-if="checkPermission(['first_audit'])&&scope.row.first_test_.is_submited&&(scope.row.leader_1===null||scope.row.leader_2===null||scope.row.leader_3===null)"
type="primary"
@click="handleSelectclick(scope,'0')"
>
@ -291,12 +291,14 @@
}
});
},
//工序转换
changeIndex(item,index) {
this.activeIndex = index;
this.listQuery.process = item.id;
this.getTableData();
},
//获取table数据
getTableData() {
this.listLoading = true;
@ -309,8 +311,12 @@
this.listLoading = false;
});
},
//分页
getsList(){},
getsList(){
this.getTableData
},
//第一次点击首件检验
handleTest(scope){
let that = this;
@ -331,6 +337,7 @@
}
});
},
//首件审批
handleSelectclick(scope,index){
let that = this;
@ -362,6 +369,7 @@
});
})
},
//选择物料检查表
recordFormChange() {
let that = this;
@ -370,6 +378,7 @@
});
that.formName = arr[0].name;
},
//根据选择的表渲染检查项目
selectedRecordForm() {
let that = this;
@ -396,40 +405,27 @@
});
} else this.$message.error("请选择检查表!");
},
//第一次保存提交检查项目
recordCancel() {
this.recordVisible = false;
this.listVisible = false;
this.getTableData();
},
/*关闭相机*/
closeCamera () {
this.$refs.faceTracking.closeCamera();
let video = document.getElementById('video');
let stream = video.srcObject;
console.log(stream);
// console.log(stream);
let tracks = stream.getTracks();
tracks.forEach(track => {
track.stop()
});
video.srcObject = null;
/*let firstTestIndex = sessionStorage.getItem('firstTestIndex');
let firstTestProcess = sessionStorage.getItem('firstTestProcess');
if(firstTestIndex){
sessionStorage.removeItem('firstTestIndex');
sessionStorage.setItem('firstTestIndex',this.activeIndex);
}else{
sessionStorage.setItem('firstTestIndex',this.activeIndex);
}
if(firstTestProcess){
sessionStorage.removeItem('firstTestProcess');
sessionStorage.setItem('firstTestProcess',this.listQuery.process);
}else{
sessionStorage.setItem('firstTestProcess',this.listQuery.process);
}
this.reload();*/
// this.thisVideo.srcObject.getTracks()[0].stop();
},
//保存首件检查
recordSave(value) {
let that = this;
@ -445,10 +441,10 @@
that.$message.error(res.msg)
}
}).catch((err) => {
// console.error(err);
that.$message.error(err)
});
},
//提交首件检查
recordSubmit(value) {
let that = this;
@ -471,6 +467,7 @@
that.$message.error(err);
});
},
//再次点击首件检验
handleTestContinue(scope) {
let that = this;
@ -508,11 +505,13 @@
}
});*/
},
//点击人脸验证
directorConfirm(index){
this.leader = index;
this.limitedPhoto = true;
},
//获取人脸数据
getMsgFormSon(data){
let that =this;
@ -553,25 +552,7 @@
},
},
mounted() {
debugger;
this.getProcessList();
/*let that = this;
let activeIndex = sessionStorage.getItem('firstTestIndex');
let firstTestProcess = sessionStorage.getItem('firstTestProcess');
if(activeIndex&&firstTestProcess){
this.activeIndex = parseInt(activeIndex);
this.listQuery.process = parseInt(firstTestProcess);
sessionStorage.removeItem('firstTestIndex');
sessionStorage.removeItem('firstTestProcess');
this.getTableData();
getProcessList({page: 0}).then((response) => {
if (response.data) {
that.processOption = response.data;
}
});
}else{
this.getProcessList();
}*/
},
}
</script>

View File

@ -15,14 +15,16 @@
type="primary"
icon="el-icon-search"
@click="handleFilter1"
>搜索
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter1"
>重置
>
重置
</el-button>
<el-table
v-loading="listLoading"
@ -38,15 +40,12 @@
<el-table-column label="半成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="半成品编号" prop="number">
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="检测状态"
>
<el-table-column label="检测状态">
<template slot-scope="scope">
{{ actstate_[scope.row.act_state] }}
</template>
@ -54,31 +53,34 @@
<el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag"
filter-placement="bottom-end">
<el-table-column
label="所在子工序"
:filters="filtersList"
:filter-method="filterTag"
filter-placement="bottom-end"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
v-if="checkPermission(['wp_test_init'])&&scope.row.test===null"
@click="handleInspection(scope,'1')"
>检验
>
检验
</el-link>
<el-link
v-if="scope.row.test!==null"
@click="checkRecord(scope,'1')"
>检验记录
>
检验记录
</el-link>
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['wp_scrap'])"
type="danger"
@click="handleScrapbcp(scope)"
>报废
>
报废
</el-link>
</template>
</el-table-column>
@ -129,22 +131,22 @@
type="primary"
icon="el-icon-search"
@click="handleFilter2"
>搜索
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter2"
>重置
>
重置
</el-button>
<el-table
:data="wproductList2.results"
border
fit
stripe
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}"
@ -153,7 +155,6 @@
<el-table-column label="半成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
@ -168,18 +169,17 @@
<el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column>
<el-table-column label="所在子工序"
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag">
<el-table-column
label="所在子工序"
:filters="filtersList"
:filter-method="filterTag"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
v-if="checkPermission(['wp_test_init'])&&scope.row.test===null"
@click="handleInspection(scope,'2')"
>检验
</el-link>
@ -217,26 +217,26 @@
type="primary"
icon="el-icon-search"
@click="handleFilter3"
>搜索
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter3"
>重置
>
重置
</el-button>
<el-table
:data="wproductList1.results"
ref="multipleTable"
:data="wproductList1.results"
border
fit
stripe
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column
type="selection"
@ -246,9 +246,7 @@
<el-table-column label="半成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="半成品编号" prop="number">
</el-table-column>
<el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
@ -261,26 +259,26 @@
<el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column>
<el-table-column label="所在子工序"
:filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag">
<el-table-column
label="所在子工序"
:filters="filtersList"
:filter-method="filterTag"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['wp_putins'])"
@click="handlePutin(scope)"
>入库
>
入库
</el-link>
<el-link
v-if="scope.row.test!==null"
@click="checkRecord(scope)"
>检验记录
>
检验记录
</el-link>
</template>
</el-table-column>
@ -308,17 +306,18 @@
type="primary"
icon="el-icon-search"
@click="handleFilter4"
>搜索
>
搜索
</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter4"
>重置
>
重置
</el-button>
<el-table
:data="wproductList4.results"
border
fit
@ -331,7 +330,6 @@
<el-table-column label="半成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column>
<el-table-column label="半成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
@ -343,11 +341,11 @@
<el-table-column label="规格型号">
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
</el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]"
:filter-method="filterTag">
<el-table-column
label="所在子工序"
:filters="filtersList"
:filter-method="filterTag"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column label="不合格标记">
@ -361,14 +359,14 @@
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['wmaterial_scrap'])"
type="danger"
@click="handleScrap(scope)"
>
报废
</el-link>
<el-link
v-if="!scope.row.ticket"
v-if="checkPermission(['operation_hear'])&&!scope.row.ticket"
type="primary"
@click="handleRetrial(scope)"
>
@ -389,7 +387,6 @@
<el-tab-pane label="夹层半成品" name="5">
<el-card style="margin-top: 2px">
<el-table
:data="wproductList3.results"
border
fit
@ -416,16 +413,17 @@
<el-table-column label="子计划编号">
<template slot-scope="scope">{{ scope.row.subproduction_plan_.number }}</template>
</el-table-column>
<el-table-column label="所在子工序" :filters="[{ text: '切割', value: '切割' },{ text: '磨边', value: '磨边' },
{ text: '清洗', value: '清洗' }, { text: '热弯成型', value: '热弯成型' },{ text: '化学钢化', value: '化学钢化' },
{ text: '镀膜', value: '镀膜' }, { text: '断膜', value: '断膜' },{ text: '汇流条制备', value: '汇流条制备' },
{ text: '夹层', value: '夹层' }, { text: '包边', value: '包边' }]" :filter-method="filterTag">
<el-table-column
label="所在子工序"
:filters="filtersList"
:filter-method="filterTag"
>
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="scope.row.test===null"
v-if="scope.row.test===null&&checkPermission(['wp_test_init'])"
@click="handleInspection(scope,'3')"
>检验
</el-link>
@ -458,40 +456,6 @@
>
</el-option>
</el-select>
<!-- &lt;!&ndash;第一次操作时的展示&ndash;&gt;
<el-dialog
width="60%"
:title="formName"
:visible.sync="innerVisible"
append-to-body
>
<customForm
:results="fieldList"
:hasPicture="hasPicture"
:formID="recordform"
:wproduct="wproduct"
:recordId="recordId"
@recordSubmit="recordSubmit"
@recordSave="recordSave"
/>
</el-dialog>
&lt;!&ndash;复检检验表单&ndash;&gt;
<el-dialog
width="60%"
:title="formName"
:visible.sync="limitedReview"
append-to-body
>
<reviewForm
:results="fieldList"
:originList="originList"
:formID="recordform"
:hasPicture="hasPicture"
:wproduct="wproduct"
:origintest="origintest"
@formFunc="formFunc"
/>
</el-dialog>-->
<div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false">
@ -602,18 +566,22 @@
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
v-if="!scope.row.is_submited"
v-if="checkPermission(['wp_test_init'])&&!scope.row.is_submited"
@click="handleInspectionRecord(scope)"
>检验
>
检验
</el-link>
<el-link
v-else
v-if="scope.row.is_submited"
@click="handleRecordDetail(scope)"
>查看
>
查看
</el-link>
<el-link
v-if="checkPermission(['wp_test_init'])"
@click="delTestRecord(scope)"
>删除
>
删除
</el-link>
</template>
</el-table-column>
@ -924,6 +892,10 @@
},
WarehouseData: "",
formName: '项目检查表',
filtersList: [{text: '切割', value: '切割'}, {text: '磨边', value: '磨边'},
{text: '清洗', value: '清洗'}, {text: '热弯成型', value: '热弯成型'}, {text: '化学钢化', value: '化学钢化'},
{text: '镀膜', value: '镀膜'}, {text: '断膜', value: '断膜'}, {text: '汇流条制备', value: '汇流条制备'},
{text: '夹层', value: '夹层'}, {text: '包边', value: '包边'}]
};
},
computed: {},
@ -952,7 +924,6 @@
} else if (tab.name == 5) {
this.getList3();
}
},
//待检半成品列表
getList() {
@ -965,37 +936,38 @@
this.listLoading = false;
});
},
handleFilter1() {
this.listQuery.page = 1;
this.getList();
},
resetFilter1() {
resetFilter1() {
this.listQuery = {
page: 1,
page_size: 20,
};
this.getList();
},
//待检半成品报废
handleScrapbcp(scope) {
this.dialogFormVisiblebcp = true;
this.bcpbf = scope.row.id;
},
//确定报废半成品
scrapesubmit() {
console.log(this.formbcp);
// console.log(this.formbcp);
scrap(this.bcpbf, this.formbcp).then((response) => {
if (response.code >= 200) {
this.$message.success("该半成品已报废!");
this.dialogFormVisiblebcp = false;
this.getList();
}
});
},
//复检半成品列表
getList2() {
this.listQuery2.act_state = 6;
@ -1005,18 +977,20 @@
}
});
},
handleFilter2() {
this.listQuery2.page = 1;
this.getList2();
},
resetFilter2() {
resetFilter2() {
this.listQuery2 = {
page: 1,
page_size: 20,
};
this.getList2();
},
//已合格半成品
getList1() {
this.listQuery1.act_state = 30;
@ -1025,21 +999,22 @@
if (response.data) {
this.wproductList1 = response.data;
}
});
},
handleFilter3() {
this.listQuery1.page = 1;
this.getList1();
},
resetFilter3() {
resetFilter3() {
this.listQuery1 = {
page: 1,
page_size: 20,
};
this.getList1();
},
//不合格半成品
getList4() {
this.listQuery4.act_state = 50;
@ -1048,21 +1023,22 @@
if (response.data) {
this.wproductList4 = response.data;
}
});
},
handleFilter4() {
this.listQuery4.page = 1;
this.getList4();
},
resetFilter4() {
resetFilter4() {
this.listQuery4 = {
page: 1,
page_size: 20,
};
this.getList4();
},
//不合格半成品报废
handleScrap(scope) {
this.$confirm("确认该半成品报废?", "警告", {
@ -1076,9 +1052,10 @@
this.$message.success("该半成品已报废!");
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
//不合格产品重审展示
handleRetrial(scope) {
let that = this;
@ -1111,13 +1088,13 @@
if (that.customfieldList[i].label === "deptSelect") {
that.customfieldList[i].field_choice = that.orgList;
}
}
}
});
that.limitedRetrial = true;
})
},
//不合格产品重审提交
retrialSubmit() {
let that = this;
@ -1137,10 +1114,12 @@
}
});
},
//筛选
filterTag(value, row) {
return row.step_.name === value;
},
//夹层半成品列表
getList3() {
this.listQuery3.act_state = 26;
@ -1150,11 +1129,13 @@
}
});
},
//半成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists();//仓库
},
//批量入库
putins() {
let _this = this;
@ -1174,6 +1155,7 @@
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => {
@ -1182,6 +1164,7 @@
}
});
},
//点击检验:如果有一个直接进入如果有多个表再进行选择
handleInspection(scope, index) {
//调该物料对应的检查表
@ -1211,6 +1194,7 @@
}
});
},
//选择物料检查表
recordformChange() {
let that = this;
@ -1219,6 +1203,7 @@
});
that.formName = arr[0].name;
},
//检验记录
checkRecord(scope, index) {
let that = this;
@ -1233,6 +1218,7 @@
}
})
},
//点击记录里的检验
handleInspectionRecord(scope) {
let that = this;
@ -1282,7 +1268,6 @@
if (res.data) {
that.hasPicture = false;
let fieldList = res.data.record_data;
that.origintest = res.data.origin_test;
that.recordform = res.data.origin_test_.form;
let originList = res.data.origin_test_.record_data;
@ -1311,6 +1296,7 @@
})
}
},
//点击记录里的查看
handleRecordDetail(scope) {
let that = this;
@ -1325,6 +1311,7 @@
}
})
},
//半产品复检
handleReview() {
let that = this;
@ -1349,8 +1336,6 @@
}
that.fieldList.push(obj)
}
/*that.fieldList = [...fieldList];
that.originList = [...originList];*/
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
@ -1377,7 +1362,6 @@
that.formName = res.data.form_.name;
let fieldList = res.data.record_data;
that.fieldList = [...fieldList];
debugger;
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
@ -1403,6 +1387,7 @@
this.getWarehouseLists();//仓库
this.id = scope.row.id;//半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
@ -1412,6 +1397,7 @@
}
});
},
delTestRecord(scope) {
let that = this;
this.$confirm("确认删除?", "警告", {
@ -1434,9 +1420,10 @@
});
})
.catch((err) => {
console.error(err);
this.$message.error(err);
});
},
//更新检验记录列表
refreshRecord() {
let that = this;
@ -1448,6 +1435,7 @@
}
})
},
//保存检查项目
recordSave(value) {
let that = this;
@ -1468,9 +1456,10 @@
this.$message.error(res.msg)
}
}).catch((err) => {
console.error(err);
this.$message.error(err);
});
},
//记录提交检查项目
recordSubmit(value) {
let that = this;
@ -1496,9 +1485,10 @@
this.$message.error(res.msg)
}
}).catch((err) => {
console.error(err);
this.$message.error(err);
});
},
//第一次保存提交检查项目
recordCancel() {
this.recordVisible = false;
@ -1508,9 +1498,6 @@
this.getList1();
this.getList3();
},
pageRefresh() {
this.reload()
},
},
mounted() {
getUserList({page: 0}).then(response => {

View File

@ -1,186 +1,185 @@
<template>
<div class="app-container">
<el-card class="box-card">
<el-tabs @tab-click="handleClick" type="border-card">
<el-tab-pane
:key="item.name"
v-for="item in processOption"
:label="item.name"
:name="item.id"
:closable="item.close"
<el-tabs
type="border-card"
@tab-click="handleClick"
>
<el-table
:data="operationList.results"
border
fit
stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}"
>
<el-table-column type="index" width="50" />
<el-table-column label="子工序工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column label="是否提交">
<template slot-scope="scope">
<el-span v-if="scope.row.is_submited"></el-span>
<el-span v-else></el-span></template
<el-tab-pane
v-for="item in processOption"
:key="item.name"
:label="item.name"
:name="item.id"
:closable="item.close"
>
<el-table
:data="operationList.results"
border
fit
stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 50}"
>
</el-table-column>
<el-table-column label="创建人">
<template slot-scope="scope">{{
scope.row.create_by_.username
}}</template>
</el-table-column>
<el-table-column label="过程记录表">
<template slot-scope="scope" v-if="scope.row.record_">
<el-tag v-for="item in scope.row.record_"
:key="item.id"
:label="item.name"
:value="item.id">{{item.name}}</el-tag>
</template>
</el-table-column>
<el-table-column label="产品数量">
<template slot-scope="scope" >
{{ scope.row.count_work }}
</template>
</el-table-column>
<el-table-column label="生产设备">
<template slot-scope="scope" v-if="scope.row.equip_">
<el-tag v-for="item in scope.row.equip_"
:key="item.id"
:label="item.number"
:value="item.id">{{item.number}}</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.is_submited"
type="primary"
@click="handleoperation(scope)"
>前往查看</el-link>
<el-table-column type="index" width="50"/>
<el-table-column label="子工序工序">
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
</el-table-column>
<el-table-column label="是否提交">
<template slot-scope="scope">
<el-span v-if="scope.row.is_submited"></el-span>
<el-span v-else></el-span>
</template>
</el-table-column>
<el-table-column label="创建人">
<template slot-scope="scope">
{{scope.row.create_by_.username}}
</template>
</el-table-column>
<el-table-column label="过程记录表">
<template v-if="scope.row.record_" slot-scope="scope">
<el-tag
v-for="item in scope.row.record_"
:key="item.id"
:label="item.name"
:value="item.id"
>
{{item.name}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="产品数量">
<template slot-scope="scope">
{{ scope.row.count_work }}
</template>
</el-table-column>
<el-table-column label="生产设备">
<template slot-scope="scope" v-if="scope.row.equip_">
<el-tag v-for="item in scope.row.equip_"
:key="item.id"
:label="item.number"
:value="item.id">{{item.number}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope">
<el-link
v-else
type="primary"
@click="handleoperation(scope)"
>前往操作</el-link>
<el-link
v-if="checkPermission(['warehouse_update'])"
type="danger"
@click="handleDelete(scope)"
>删除</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="operationList.count > 0"
:total="operationList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
v-if="checkPermission(['operation_create'])&&scope.row.is_submited"
type="primary"
@click="handleoperation(scope)"
>
前往查看
</el-link>
<el-link
v-if="checkPermission(['operation_create'])&&!scope.row.is_submited"
type="primary"
@click="handleoperation(scope)"
>
前往操作
</el-link>
<el-link
v-if="checkPermission(['operation_delete'])"
type="danger"
@click="handleDelete(scope)"
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="operationList.count > 0"
:total="operationList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import { getoperationList, deleteOperation } from "@/api/wpm";
import checkPermission from "@/utils/permission";
<script>
import {getoperationList, deleteOperation} from "@/api/wpm";
import checkPermission from "@/utils/permission";
import { getProcessList, getStepLists } from "@/api/mtm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import {getProcessList, getStepLists} from "@/api/mtm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
export default {
components: { Pagination },
data() {
return {
operationList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
processOption: "",
};
},
computed: {},
watch: {},
created() {
this.id = this.$route.params.id;
this.getProcessList()
},
methods: {
checkPermission,
handleoperation(scope)
{
this.$router.push({name: "operationdo", params: { id: scope.row.id}, })
},
//大工序工序渲染
getProcessList() {
getProcessList({ page: 0 }).then((response) => {
if (response.data) {
this.processOption = response.data;
}
});
export default {
components: {Pagination},
data() {
return {
operationList: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
processOption: "",
};
},
getList(){
getoperationList(this.listQuery).then((response) => {
if (response.data) {
this.operationList = response.data;
}
});
},
computed: {},
watch: {},
created() {
this.id = this.$route.params.id;
this.getProcessList()
},
methods: {
checkPermission,
handleoperation(scope) {
this.$router.push({name: "operationdo", params: {id: scope.row.id},})
},
//大工序工序渲染
getProcessList() {
getProcessList({page: 0}).then((response) => {
if (response.data) {
this.processOption = response.data;
}
});
},
getList() {
getoperationList(this.listQuery).then((response) => {
if (response.data) {
this.operationList = response.data;
}
});
},
//选项卡切换
handleClick(tab) {
this.process = tab.name;
this.listQuery.step__process = tab.name;
this.getList();
},
handleClick(tab) {
this.process = tab.name;
this.listQuery.step__process = tab.name;
this.getList();
//操作记录删除
handleDelete(scope) {
this.$confirm("确认该操作删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteOperation(scope.row.id);
this.getList();
this.$message.success("成功");
},
//操作记录删除
handleDelete(scope) {
this.$confirm("确认该操作删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.catch((err) => {
console.error(err);
});
},
.then(async () => {
await deleteOperation(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
this.$message.error(err);
});
},
},
};
</script>
},
};
</script>

View File

@ -12,11 +12,11 @@
highlight-current-row
max-height="600"
>
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="成品名称">
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
<template slot-scope="scope">
{{scope.row.material_.name}}
</template>
</el-table-column>
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
@ -33,17 +33,16 @@
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="
checkPermission(['warehouse_update']) &&
scope.row.test === null
"
v-if="checkPermission(['wp_test_init']) &&scope.row.test === null"
@click="handleInspection(scope)"
>检验
>
检验
</el-link>
<el-link
v-if="scope.row.test !== null"
@click="checkRecord(scope)"
>检验记录
>
检验记录
</el-link>
</template>
</el-table-column>
@ -60,26 +59,25 @@
<el-tab-pane label="已合格成品">
<el-card style="margin-top: 2px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
>批量入库
>批量入库
</el-button>
<el-table
ref="multipleTable"
v-loading="listLoading"
:data="wproductList1.results"
ref="multipleTable"
border
fit
stripe
highlight-current-row
max-height="600"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/>
<el-table-column label="成品名称">
<template slot-scope="scope">{{
scope.row.material_.name
}}</template>
<template slot-scope="scope">
{{scope.row.material_.name}}
</template>
</el-table-column>
<el-table-column label="成品编号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
@ -88,7 +86,7 @@
{{ actstate_[scope.row.act_state] }}
</template>
</el-table-column>
<el-table-column label="指派订单">
<el-table-column label="指派订单">
<template slot-scope="scope" v-if="scope.row.to_order_">
{{scope.row.to_order_.number }}
</template>
@ -98,7 +96,7 @@
{{scope.row.to_order_.customer_.name }}
</template>
</el-table-column>
<el-table-column label="合同">
<el-table-column label="合同">
<template slot-scope="scope" v-if="scope.row.to_order_">
{{scope.row.to_order_.contract_.name }}
</template>
@ -106,9 +104,10 @@
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
v-if="checkPermission(['wp_putins'])"
@click="handlePutin(scope)"
>入库
>
入库
</el-link>
</template>
</el-table-column>
@ -143,12 +142,14 @@
>
</el-option>
</el-select>
<div slot="footer" class="dialog-footer">
<el-button @click="outerVisible = false"> </el-button>
<el-button type="primary" @click="submitrecordform()"
>填写检查项目</el-button
<el-button @click="outerVisible = false"> </el-button>
<el-button
type="primary"
@click="submitrecordform()"
>
填写检查项目
</el-button>
</div>
</el-dialog>
<!--检查表显示-->
@ -178,14 +179,14 @@
:visible.sync="limitedCheckRecord"
>
<el-table :data="recordList" border height="400">
<el-table-column type="index" width="50" />
<el-table-column type="index" width="50"/>
<el-table-column label="表单名称">
<template slot-scope="scope">{{ scope.row.form_.name }}</template>
</el-table-column>
<el-table-column label="检查类型">
<template slot-scope="scope">{{
checkTypes[scope.row.type]
}}</template>
<template slot-scope="scope">
{{checkTypes[scope.row.type]}}
</template>
</el-table-column>
<el-table-column label="是否提交">
<template slot-scope="scope">
@ -196,12 +197,18 @@
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link
v-if="!scope.row.is_submited"
v-if="checkPermission(['wp_test_init'])&&!scope.row.is_submited"
@click="handleInspectionRecord(scope)"
>检验
>
检验
</el-link>
<el-link v-else @click="handleRecordDetail(scope)">查看 </el-link>
<el-link @click="delTestRecord(scope)">删除 </el-link>
<el-link
v-if="scope.row.is_submited"
@click="handleRecordDetail(scope)"
>
查看
</el-link>
<el-link @click="delTestRecord(scope)">删除</el-link>
</template>
</el-table-column>
</el-table>
@ -218,8 +225,8 @@
<el-form :model="form">
<el-form-item label="仓库">
<el-select
style="width: 100%"
v-model="form.warehouse"
style="width: 100%"
placeholder="请选择仓库"
>
<el-option
@ -248,8 +255,8 @@
<el-form :model="form">
<el-form-item label="仓库">
<el-select
style="width: 100%"
v-model="form.warehouse"
style="width: 100%"
placeholder="请选择仓库"
>
<el-option
@ -270,266 +277,339 @@
<el-button type="primary" @click="putins"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getOrderList } from "@/api/sam";
import checkPermission from "@/utils/permission";
import { getWarehouseList } from "@/api/inm";
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import customForm from "@/components/customForm/index";
import {
getwproductList,
wproductTest,
wproductPutin,
createputins,
testInit,
toorder,
} from "@/api/wpm";
import {
getTestRecord,
getTestRecordItem,
putTestRecordItem,
delTestRecordItem,
subTestRecordItem,
} from "@/api/qm";
const defaultetestitem = {};
export default {
components: { Pagination, customForm },
data() {
return {
testitem: defaultetestitem,
form: { remark: "", warehouse: "" },
// import {getOrderList} from "@/api/sam";
import checkPermission from "@/utils/permission";
import {getWarehouseList} from "@/api/inm";
import { getrecordformList, getrffieldList} from "@/api/mtm";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import customForm from "@/components/customForm/index";
import {
getwproductList,
wproductTest,
wproductPutin,
createputins,
testInit,
} from "@/api/wpm";
import {
getTestRecord,
getTestRecordItem,
putTestRecordItem,
delTestRecordItem,
subTestRecordItem,
} from "@/api/qm";
const defaultetestitem = {};
export default {
components: {Pagination, customForm},
data() {
return {
testitem: defaultetestitem,
form: {remark: "", warehouse: ""},
form1: {},
wproductList: {
count: 0,
},
wproductList1: {
count: 0,
},
wproductList2: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
actstate_: {
6: "待复检",
10: "生产中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
},
checkTypes: {
10: "子工序检验",
20: "工序检验",
30: "工序复检",
36: "夹层检验",
40: "成品检验",
},
choice: [
{
value: true,
label: "合格",
wproductList: {
count: 0,
},
{
value: false,
label: "不合格",
wproductList1: {
count: 0,
},
],
options: [],
listLoading: true,
wproduct: null,
recordId: null,
fieldList: null,
is_testok: "true",
field: [],
recordList: [],
recordformList: [],
recordform: null,
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
hasPicture: false,
outerVisible: false,
innerVisible: false,
dialogFormVisible: false,
dialogFormVisibles: false,
limitedCheckRecord: false,
testrecord: {},
formName: "检验表",
WarehouseData: "",
};
},
computed: {},
watch: {},
created() {
this.getList();
wproductList2: {
count: 0,
},
listQuery: {
page: 1,
page_size: 20,
},
listQuery1: {
page: 1,
page_size: 20,
},
listQuery2: {
page: 1,
page_size: 20,
},
actstate_: {
6: "待复检",
10: "生产中",
20: "待检验",
30: "已合格",
40: "库存中",
50: "不合格",
60: "待成品检验",
},
checkTypes: {
10: "子工序检验",
20: "工序检验",
30: "工序复检",
36: "夹层检验",
40: "成品检验",
},
choice: [
{value: true, label: "合格"},
{value: false, label: "不合格"},
],
options: [],
listLoading: true,
wproduct: null,
recordId: null,
fieldList: null,
is_testok: "true",
field: [],
recordList: [],
recordformList: [],
recordform: null,
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
hasPicture: false,
outerVisible: false,
innerVisible: false,
dialogFormVisible: false,
dialogFormVisibles: false,
limitedCheckRecord: false,
testrecord: {},
formName: "检验表",
WarehouseData: "",
this.getList1();
// this.getLists();
},
methods: {
checkPermission,
//待检成品列表
getList() {
this.listLoading = true;
this.listQuery.act_state = 60;
this.listQuery.material__type = 1;
getwproductList(this.listQuery).then((response) => {
if (response.data) {
this.wproductList = response.data;
}
this.listLoading = false;
});
};
},
computed: {},
watch: {},
created() {
this.getList();
//已合格成品
getList1() {
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
this.getList1();
// this.getLists();
},
//成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists(); //仓库
},
//批量入库
putins() {
let _this = this;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
});
console.log(_this.mutipID);
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({ page: 0 }).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok, //单项检查结果
});
});
console.log(this.recordform);
this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表
this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
}
});
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
//点击table中的检验
handleInspection(scope) {
let that = this;
//调该物料对应的检查表
this.wproduct = scope.row.id; //成品ID
this.listQueryrecordform.material = scope.row.material; //
this.listQueryrecordform.type = 40;
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if (response.data.length === 1) {
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform();
} else {
//弹出列表选择框
this.outerVisible = true;
methods: {
checkPermission,
//待检成品列表
getList() {
this.listLoading = true;
this.listQuery.act_state = 60;
this.listQuery.material__type = 1;
getwproductList(this.listQuery).then((response) => {
if (response.data) {
this.wproductList = response.data;
}
}
});
},
//根据选择的表渲染检查项目
submitrecordform() {
let that = this;
if (this.recordform != "") {
testInit({ wproduct: that.wproduct, form: that.recordform }).then(
this.listLoading = false;
});
},
//已合格成品
getList1() {
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 1;
getwproductList(this.listQuery1).then((response) => {
if (response.data) {
this.wproductList1 = response.data;
}
});
},
//成品批量入库
handleCreate() {
this.dialogFormVisibles = true;
this.getWarehouseLists(); //仓库
},
//批量入库
putins() {
let _this = this;
_this.mutipID = [];
this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID.push(item.id);
});
createputins({
warehouse: this.form.warehouse,
wproducts: _this.mutipID,
remark: this.form.remark,
}).then((res) => {
if (res.code >= 200) {
this.$message.success("批量入库成功!");
this.dialogFormVisibles = false;
this.getList1();
}
});
},
//仓库列表
getWarehouseLists() {
getWarehouseList({page: 0}).then((response) => {
if (response.data) {
this.WarehouseData = response.data;
}
});
},
//提交检查项目
submitfield() {
let _this = this;
_this.field = []; //检查项目
this.fieldList.forEach((item) => {
_this.field.push({
form_field: item.id,
field_value: item.sort,
is_testok: item.is_testok, //单项检查结果
});
});
this.testrecord.form = this.recordform; //检查表
this.testrecord.record_data = _this.field; //检查项列表
this.testrecord.is_testok = this.is_testok; //检查表检查结果
this.testrecord.wproduct = this.wproduct; //半成品ID
wproductTest(this.testrecord).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
}
});
},
//半成品入库
handlePutin(scope) {
this.dialogFormVisible = true;
this.getWarehouseLists(); //仓库
this.id = scope.row.id; //半成品id
},
putin() {
wproductPutin(this.id, this.form).then((res) => {
if (res.code >= 200) {
this.$message.success("入库成功!");
this.dialogFormVisible = false;
this.getList1();
}
});
},
//点击table中的检验
handleInspection(scope) {
let that = this;
//调该物料对应的检查表
this.wproduct = scope.row.id; //成品ID
this.listQueryrecordform.material = scope.row.material; //
this.listQueryrecordform.type = 40;
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if (response.data.length === 1) {
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform();
} else {
//弹出列表选择框
this.outerVisible = true;
}
}
});
},
//根据选择的表渲染检查项目
submitrecordform() {
let that = this;
if (this.recordform != "") {
testInit({wproduct: that.wproduct, form: that.recordform}).then(
(response) => {
if (response.data) {
that.hasPicture = false;
that.recordId = response.data.id;
getTestRecordItem(response.data.id).then((res) => {
that.formName = res.data.form_.name;
let fieldList = res.data.record_data;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
that.$nextTick(() => {
that.innerVisible = true;
});
});
}
}
);
} else this.$message.error("请选择检查表!");
},
//选择物料检查表
recordformChange() {
let that = this;
let arr = this.recordformList.filter((item) => {
return item.id === that.recordform;
});
that.formName = arr[0].name;
},
//更新检验记录列表
refreshRecord() {
let that = this;
getTestRecord({wproduct: that.wproduct, page: 0}).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//检验记录
checkRecord(scope) {
let that = this;
that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true;
getTestRecord({wproduct: scope.row.id, page: 0}).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//点击记录里的检验
handleInspectionRecord(scope) {
let that = this;
that.innerVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then(
(response) => {
if (response.data) {
that.hasPicture = false;
that.recordId = response.data.id;
getTestRecordItem(response.data.id).then((res) => {
that.formName = res.data.form_.name;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
for (let i = 0; i < that.fieldList.length; i++) {
let obj = that.fieldList[i];
obj.is_testok = null;
for (let j = 0; j < fieldList.length; j++) {
if (that.fieldList[i].field_key === fieldList[j].field_key) {
obj.id = parseInt(fieldList[j].id);
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj);
}
that.fieldList = arr;
that.$nextTick(() => {
that.innerVisible = true;
});
@ -537,162 +617,90 @@ export default {
}
}
);
} else this.$message.error("请选择检查表!");
},
//选择物料检查表
recordformChange() {
let that = this;
let arr = this.recordformList.filter((item) => {
return item.id === that.recordform;
});
that.formName = arr[0].name;
},
//更新检验记录列表
refreshRecord() {
let that = this;
getTestRecord({ wproduct: that.wproduct, page: 0 }).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//检验记录
checkRecord(scope) {
let that = this;
that.wproduct = scope.row.id; //半成品ID
that.limitedCheckRecord = true;
getTestRecord({ wproduct: scope.row.id, page: 0 }).then((res) => {
if (res.code == 200) {
that.recordList = res.data;
} else {
this.$message.error(res.msg);
}
});
},
//点击记录里的检验
handleInspectionRecord(scope) {
let that = this;
that.innerVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({ form: this.recordform, page: 1, page_size: 100 }).then(
(response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter((item) => {
return item.field_type === "draw";
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data;
for (let i = 0; i < that.fieldList.length; i++) {
let obj = that.fieldList[i];
obj.is_testok = null;
for (let j = 0; j < fieldList.length; j++) {
if (that.fieldList[i].field_key === fieldList[j].field_key) {
obj.id = parseInt(fieldList[j].id);
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj);
},
delTestRecord(scope) {
let that = this;
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await delTestRecordItem(scope.row.id).then((res) => {
if (res.code >= 200) {
that.$message.success("成功");
that.refreshRecord();
this.getList();
this.getList1();
} else {
this.$message.error(res.msg);
}
that.fieldList = arr;
that.$nextTick(() => {
that.innerVisible = true;
});
});
}
}
);
},
delTestRecord(scope) {
let that = this;
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await delTestRecordItem(scope.row.id).then((res) => {
})
.catch((err) => {
this.$message.error(err);
});
},
//保存检查项目
recordSave(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
that.$message.success("成功");
that.innerVisible = false;
that.limitedReview = false;
that.getList();
that.getList1();
that.refreshRecord();
this.getList();
this.getList1();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
})
.catch((err) => {
console.error(err);
});
},
//记录提交检查项目
recordSubmit(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.limitedCheckRecord = false;
this.getList();
this.getList1();
that.refreshRecord();
}
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
},
//第一次保存提交检查项目
recordCancel() {
this.outerVisible = false;
this.innerVisible = false;
},
},
//保存检查项目
recordSave(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.getList();
that.getList1();
that.refreshRecord();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.error(err);
});
},
//记录提交检查项目
recordSubmit(value) {
let that = this;
let id = value.id;
let params = {};
params.record_data = value.record_data;
params.is_testok = value.is_testok;
putTestRecordItem(id, params)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.limitedCheckRecord = false;
this.getList();
this.getList1();
that.refreshRecord();
}
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.error(err);
});
},
//第一次保存提交检查项目
recordCancel() {
this.outerVisible = false;
this.innerVisible = false;
},
},
};
};
</script>

View File

@ -2,8 +2,8 @@
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
<el-tab-pane
:key="item.name"
v-for="item in processOption"
:key="item.name"
:label="item.name"
:name="item.id"
:closable="item.close"
@ -18,8 +18,7 @@
@current-change="handleCurrentChange"
>
<el-table-column type="index" width="50"/>
<el-table-column label="子计划编号" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
<el-table-column label="子计划编号" prop="number" min-width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column label="产品名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
@ -58,11 +57,9 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="开工时间" width="100">
<template slot-scope="scope">{{ scope.row.start_date }}</template>
<el-table-column label="开工时间" prop="start_date" width="100">
</el-table-column>
<el-table-column label="完工时间" width="100">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
<el-table-column label="完工时间" prop="end_date" width="100">
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
@ -88,20 +85,21 @@
>
<template slot-scope="scope">
<el-link
v-if="checkPermission(['wmaterial_pick'])&&!scope.row.is_picked"
type="success"
v-if="scope.row.is_picked == false"
@click="handleNeed(scope)"
>
领料
</el-link>
<el-link
v-if="checkPermission(['wmaterial_pick'])&&scope.row.is_picked"
type="success"
v-if="scope.row.is_picked"
@click="handleNeed(scope)"
>
继续领料
</el-link>
<el-link
v-if="checkPermission(['wmaterial_pick'])"
type="primary"
@click="handlepick(scope)"
>
@ -124,10 +122,11 @@
<span>半成品</span>
</div>
<el-button
v-for="item in steps"
v-show="checkPermission(['wmaterial_operation'])"
:key="item.number"
type="primary"
style="margin-left: 2px"
v-for="item in steps"
:key="item.number"
:label="item.name"
:value="item.number"
@click="handlework(item)"
@ -135,10 +134,11 @@
{{ item.name }}
</el-button>
<el-button
type="primary"
@click="handleScrapbcp()"
v-if="checkPermission(['wmaterial_scrap'])"
id="scrap"
type="primary"
style="float: right; display: none"
@click="handleScrapbcp()"
>
报废
</el-button>
@ -167,10 +167,7 @@
{{scope.row.subproduction_plan_.number}}
</template>
</el-table-column>
<el-table-column label="玻璃编号" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.number }}
</template>
<el-table-column label="玻璃编号" prop="number" width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column label="玻璃状态" width="100" show-overflow-tooltip>
<template slot-scope="scope">
@ -192,10 +189,7 @@
{{ ng_sign_[scope.row.ng_sign] }}
</template>
</el-table-column>
<el-table-column label="更新时间" width="160">
<template slot-scope="scope">
{{scope.row.update_time}}
</template>
<el-table-column label="更新时间" prop="update_time" width="160">
</el-table-column>
</el-table>
</el-card>
@ -229,11 +223,9 @@
{{scope.row.material_.unit}}
</template>
</el-table-column>
<el-table-column label="物料批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
<el-table-column prop="batch" label="物料批次">
</el-table-column>
<el-table-column label="物料数量">
<template slot-scope="scope">{{ scope.row.count }}</template>
<el-table-column prop="count" label="物料数量">
</el-table-column>
</el-table>
</el-card>
@ -249,8 +241,8 @@
<el-form :model="formbcp">
<el-form-item label="甩片原因">
<el-select
style="width: 80%"
v-model="formbcp.scrap_reason"
style="width: 80%"
placeholder="请甩片原因"
>
<el-option
@ -943,7 +935,13 @@
//车间物料表
this.getwmaterialLists();
// 半成品表
this.getwproductLists();
getwproductList({page:0,tag:'no_scrap'}).then((response) => {
if (response.data) {
this.wproductData = response.data;
//console.log( this.wproductData)
}
});
},
//大工序下子工序产出的半成品
@ -1017,6 +1015,14 @@
this.dialogVisiblenw = false;
this.$message.success("领料成功!");
this.listQuery.process = this.process;
getsubplanList(this.listQuery).then((response) => {
if (response.data) {
this.subproductionplanList = response.data;
}
});
//车间物料表
this.getwmaterialLists();
// 半成品表

View File

@ -17,11 +17,13 @@ class Equipment(CommonAModel):
EQUIP_STATE_LIMIT = 20
EQUIP_STATE_FIX = 30
EQUIP_STATE_DISABLE = 40
EQUIP_STATE_scrap = 50
state_choices = (
(EQUIP_STATE_OK, '完好'),
(EQUIP_STATE_LIMIT, '限用'),
(EQUIP_STATE_FIX, '在修'),
(EQUIP_STATE_DISABLE, '禁用')
(EQUIP_STATE_DISABLE, '禁用'),
(EQUIP_STATE_scrap, '报废')
)
state2_choices = (