Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
77a081c678
|
@ -107,7 +107,6 @@ export const asyncRoutes = [
|
||||||
name: 'material',
|
name: 'material',
|
||||||
component: () => import('@/views/mtm/material'),
|
component: () => import('@/views/mtm/material'),
|
||||||
meta: { title: '物料清单', icon: 'material', perms: ['mtm_material'] }
|
meta: { title: '物料清单', icon: 'material', perms: ['mtm_material'] }
|
||||||
|
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
|
@ -151,7 +150,19 @@ export const asyncRoutes = [
|
||||||
name: 'productprocess',
|
name: 'productprocess',
|
||||||
component: () => import('@/views/mtm/productprocess'),
|
component: () => import('@/views/mtm/productprocess'),
|
||||||
meta: { title: '产品管理', icon: 'product', perms: ['mtm_productprocess'] }
|
meta: { title: '产品管理', icon: 'product', perms: ['mtm_productprocess'] }
|
||||||
},
|
}
|
||||||
|
,{
|
||||||
|
path: 'productList',
|
||||||
|
name: 'productList',
|
||||||
|
component: () => import('@/views/mtm/productList'),
|
||||||
|
meta: { title: '成品列表', icon: 'material', perms: ['mtm_material'] }
|
||||||
|
}
|
||||||
|
,{
|
||||||
|
path: 'wproductList',
|
||||||
|
name: 'wproductList',
|
||||||
|
component: () => import('@/views/mtm/wproductList'),
|
||||||
|
meta: { title: '半成品列表', icon: 'material', perms: ['mtm_material'] }
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,201 +31,166 @@
|
||||||
return {
|
return {
|
||||||
options: {},
|
options: {},
|
||||||
cdata: {
|
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"
|
|
||||||
],
|
|
||||||
planData: [
|
|
||||||
18092,
|
|
||||||
20728,
|
|
||||||
24045,
|
|
||||||
28348,
|
|
||||||
32808,
|
|
||||||
36097,
|
|
||||||
39867,
|
|
||||||
18092,
|
|
||||||
20728,
|
|
||||||
24045,
|
|
||||||
28348,
|
|
||||||
32808,
|
|
||||||
36097,
|
|
||||||
39867,
|
|
||||||
44715,
|
|
||||||
],
|
|
||||||
barData: [
|
|
||||||
9600,
|
|
||||||
19000,
|
|
||||||
19500,
|
|
||||||
20500,
|
|
||||||
19500,
|
|
||||||
28500,
|
|
||||||
31900,
|
|
||||||
12500,
|
|
||||||
14000,
|
|
||||||
21500,
|
|
||||||
23200,
|
|
||||||
24450,
|
|
||||||
25250,
|
|
||||||
33300,
|
|
||||||
40715
|
|
||||||
],
|
|
||||||
rateData: []
|
rateData: []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
props:{
|
||||||
this.setData();
|
category:{
|
||||||
|
type:Array,
|
||||||
|
default:()=>{
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
planData:{
|
||||||
|
type:Array,
|
||||||
|
default:()=>{
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
realData:{
|
||||||
|
type:Array,
|
||||||
|
default:()=>{
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
mounted() {
|
||||||
cdata: {
|
let that=this;
|
||||||
handler(newData) {
|
this.setData();
|
||||||
this.options = {
|
this.options = {
|
||||||
/*tooltip: {
|
/*tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
backgroundColor: "rgba(255,255,255,0.1)",
|
backgroundColor: "rgba(255,255,255,0.1)",
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
type: "shadow",
|
type: "shadow",
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
backgroundColor: "#7B7DDC"
|
backgroundColor: "#7B7DDC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis', //触发类型;轴触发,axis则鼠标hover到一条柱状图显示全部数据,item则鼠标hover到折线点显示相应数据,
|
trigger: 'axis', //触发类型;轴触发,axis则鼠标hover到一条柱状图显示全部数据,item则鼠标hover到折线点显示相应数据,
|
||||||
axisPointer: { //坐标轴指示器,坐标轴触发有效,
|
axisPointer: { //坐标轴指示器,坐标轴触发有效,
|
||||||
type: 'cross', //默认为line,line直线,cross十字准星,shadow阴影
|
type: 'cross', //默认为line,line直线,cross十字准星,shadow阴影
|
||||||
crossStyle: {
|
crossStyle: {
|
||||||
color: '#fff'
|
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: ["已完成", "计划完成"],
|
|
||||||
textStyle: {
|
|
||||||
color: "#B4B4B4"
|
|
||||||
},
|
|
||||||
top: "0%"
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
x: "8%",
|
|
||||||
width: "88%",
|
|
||||||
y: "4%"
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
data: newData.category,
|
|
||||||
axisLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: "#B4B4B4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisTick: {
|
|
||||||
show: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis:{
|
|
||||||
splitLine: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: "#B4B4B4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
formatter: "{value} "
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "已完成",
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 10,
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
barBorderRadius: 5,
|
|
||||||
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
||||||
{offset: 0, color: "#956FD4"},
|
|
||||||
{offset: 1, color: "#3EACE5"}
|
|
||||||
])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: newData.barData
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "计划完成",
|
|
||||||
type: "bar",
|
|
||||||
barGap: "-100%",
|
|
||||||
barWidth: 10,
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
barBorderRadius: 5,
|
|
||||||
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
||||||
{offset: 0, color: "rgba(156,107,211,0.8)"},
|
|
||||||
{offset: 0.2, color: "rgba(156,107,211,0.5)"},
|
|
||||||
{offset: 1, color: "rgba(156,107,211,0.2)"}
|
|
||||||
])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
z: -12,
|
|
||||||
data: newData.planData
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
/*tooltip: {
|
||||||
deep: true
|
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: [" 计划完成", " 已完成 "],
|
||||||
|
textStyle: {
|
||||||
|
color: "#B4B4B4"
|
||||||
|
},
|
||||||
|
top: "0%"
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
x: "8%",
|
||||||
|
width: "88%",
|
||||||
|
y: "4%"
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: that.category,
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#B4B4B4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis:{
|
||||||
|
splitLine: {
|
||||||
|
type:"dashed",
|
||||||
|
color: "#B4B4B4",
|
||||||
|
width:"1",
|
||||||
|
// show: true,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#B4B4B4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
formatter: "{value} "
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "已完成",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
barBorderRadius: 5,
|
||||||
|
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: "#956FD4"},
|
||||||
|
{offset: 1, color: "#3EACE5"}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: that.realData
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "计划完成",
|
||||||
|
type: "bar",
|
||||||
|
barGap: "-100%",
|
||||||
|
barWidth: 10,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
barBorderRadius: 5,
|
||||||
|
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: "rgba(156,107,211,0.8)"},
|
||||||
|
{offset: 0.2, color: "rgba(156,107,211,0.5)"},
|
||||||
|
{offset: 1, color: "rgba(156,107,211,0.2)"}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: -12,
|
||||||
|
data: that.planData
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 根据自己的业务情况修改
|
// 根据自己的业务情况修改
|
||||||
setData() {
|
setData() {
|
||||||
for (let i = 0; i < this.cdata.barData.length - 1; i++) {
|
/*for (let i = 0; i < this.cdata.realData.length - 1; i++) {
|
||||||
let rate = this.cdata.barData[i] / this.cdata.planData[i];
|
let rate = this.cdata.realData[i] / this.cdata.planData[i];
|
||||||
this.cdata.rateData.push(rate.toFixed(2));
|
this.cdata.rateData.push(rate.toFixed(2));
|
||||||
}
|
}*/
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,9 @@
|
||||||
<dv-border-box-13>
|
<dv-border-box-13>
|
||||||
<bottomLeft
|
<bottomLeft
|
||||||
v-if="limitedTwo"
|
v-if="limitedTwo"
|
||||||
|
:category="category"
|
||||||
|
:planData="planData"
|
||||||
|
:realData="realData"
|
||||||
/>
|
/>
|
||||||
</dv-border-box-13>
|
</dv-border-box-13>
|
||||||
</div>
|
</div>
|
||||||
|
@ -126,7 +129,7 @@
|
||||||
import bottomRight from './bottomRight'
|
import bottomRight from './bottomRight'
|
||||||
import {getPlanGantt} from "@/api/srm";
|
import {getPlanGantt} from "@/api/srm";
|
||||||
import {getProductionplanList} from "@/api/pm";
|
import {getProductionplanList} from "@/api/pm";
|
||||||
import {getProcessYield, productCount, getProcessNow, planCount, orderCount} from "@/api/srm";
|
import {getProcessYield, productCount, getProcessNow} from "@/api/srm";
|
||||||
import {getContractList, getOrderList} from "@/api/sam";
|
import {getContractList, getOrderList} from "@/api/sam";
|
||||||
import {getArticles} from "@/api/cms";
|
import {getArticles} from "@/api/cms";
|
||||||
|
|
||||||
|
@ -139,10 +142,11 @@
|
||||||
dateDay: null,
|
dateDay: null,
|
||||||
dateYear: null,
|
dateYear: null,
|
||||||
dateWeek: null,
|
dateWeek: null,
|
||||||
planGanttList: [],
|
|
||||||
numberShow: false,
|
numberShow: false,
|
||||||
processRate: false,
|
processRate: false,
|
||||||
listUser: false,
|
listUser: false,
|
||||||
|
listNews: false,
|
||||||
|
listProcess: false,
|
||||||
create_time_start: '',
|
create_time_start: '',
|
||||||
titleItem: [
|
titleItem: [
|
||||||
{
|
{
|
||||||
|
@ -428,7 +432,10 @@
|
||||||
// columnWidth: [50],
|
// columnWidth: [50],
|
||||||
align: ['center']
|
align: ['center']
|
||||||
},
|
},
|
||||||
weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||||
|
category:[],
|
||||||
|
planData:[],
|
||||||
|
realData:[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -480,16 +487,6 @@
|
||||||
this.dateWeek = this.weekday[new Date().getDay()]
|
this.dateWeek = this.weekday[new Date().getDay()]
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
getPageData() {
|
|
||||||
let that = this;
|
|
||||||
getPlanGantt({type: 'big_screen'}).then(res => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
this.planGanttList = res.data.results;
|
|
||||||
} else {
|
|
||||||
that.$message.error(res.msg);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
cancelLoading() {
|
cancelLoading() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
@ -676,6 +673,7 @@
|
||||||
//企业资讯
|
//企业资讯
|
||||||
getArticle() {
|
getArticle() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.listNews = false;
|
||||||
getArticles({type: 'big_screen', page: 0}).then((response) => {
|
getArticles({type: 'big_screen', page: 0}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
// this.configArticle = response.data;
|
// this.configArticle = response.data;
|
||||||
|
@ -694,11 +692,28 @@
|
||||||
data.push(obj)
|
data.push(obj)
|
||||||
});
|
});
|
||||||
that.configArticle.data = data;
|
that.configArticle.data = data;
|
||||||
|
that.listNews = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//任务完成进度
|
//任务完成进度
|
||||||
|
getPageData() {
|
||||||
|
let that = this;
|
||||||
|
that.listNews = false;
|
||||||
|
getPlanGantt({type: 'big_screen'}).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
let list = res.data.results;
|
||||||
|
list.forEach(item=>{
|
||||||
|
that.category.push(item.number);
|
||||||
|
that.planData.push(item.count);
|
||||||
|
that.realData.push(item.count_ok);
|
||||||
|
})
|
||||||
|
that.listNews = true;
|
||||||
|
} else {
|
||||||
|
that.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -218,7 +218,7 @@
|
||||||
:height="cardTabelHeight"
|
:height="cardTabelHeight"
|
||||||
style="border-top: 1px solid #f5f5f5;"
|
style="border-top: 1px solid #f5f5f5;"
|
||||||
>
|
>
|
||||||
<el-table-column label="id" prop="id" width="50">
|
<el-table-column type="index" width="50">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="人员名称" prop="name" show-overflow-tooltip>
|
<el-table-column label="人员名称" prop="name" show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -233,7 +233,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="部门" prop="dept_">
|
<el-table-column label="部门" prop="dept_">
|
||||||
<template slot-scope="scope">{{scope.row.dept_.name}}</template>
|
<template slot-scope="scope" v-if="scope.row.dept_">{{scope.row.dept_.name}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -585,7 +585,7 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
that.listLoadingUser = true;
|
that.listLoadingUser = true;
|
||||||
that.userPage = 1;
|
that.userPage = 1;
|
||||||
getEmployee({page: that.userPage, page_size: that.userPageSize}).then((response) => {
|
getEmployee({page: that.userPage, page_size: that.userPageSize,show_atwork:true}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
that.userList = response.data.results;
|
that.userList = response.data.results;
|
||||||
that.userTotal = response.data.count;
|
that.userTotal = response.data.count;
|
||||||
|
@ -602,6 +602,7 @@
|
||||||
that.userPage = val;
|
that.userPage = val;
|
||||||
getEmployee({
|
getEmployee({
|
||||||
page: val,
|
page: val,
|
||||||
|
show_atwork:true,
|
||||||
page_size: that.userPageSize,
|
page_size: that.userPageSize,
|
||||||
fields: 'id,name,dept_name,is_atwork'
|
fields: 'id,name,dept_name,is_atwork'
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="handlecgxCreate"
|
@click="handlecgxCreate"
|
||||||
>新增采购项入库</el-button
|
|
||||||
>
|
>
|
||||||
|
新增采购项入库
|
||||||
|
</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="fifodetailList.results"
|
:data="fifodetailList.results"
|
||||||
|
@ -18,7 +19,7 @@
|
||||||
height="100"
|
height="100"
|
||||||
v-el-height-adaptive-table="{ bottomOffset: 42 }"
|
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="物料名称">
|
<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>
|
||||||
|
@ -27,19 +28,14 @@
|
||||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料编号">
|
<el-table-column label="物料编号">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{scope.row.material_.number}}</template>
|
||||||
scope.row.material_.number
|
|
||||||
}}</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料单位">
|
<el-table-column label="物料单位">
|
||||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料型号">
|
<el-table-column label="物料型号">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{scope.row.material_.specification}}</template>
|
||||||
scope.row.material_.specification
|
|
||||||
}}</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="出入库数量">
|
<el-table-column label="出入库数量">
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -70,24 +66,25 @@
|
||||||
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||||
item.name
|
item.name
|
||||||
}}</el-link>
|
}}
|
||||||
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
v-if="this.$route.params.pu_order != null"
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="220px"
|
width="220px"
|
||||||
v-if="this.$route.params.pu_order != null"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
|
v-if="scope.row.need_test"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleMaterial(scope)"
|
@click="handleMaterial(scope)"
|
||||||
v-if="scope.row.need_test"
|
|
||||||
>复验</el-link
|
|
||||||
>
|
>
|
||||||
|
复验
|
||||||
|
</el-link>
|
||||||
<el-link type="primary" @click="handleEdit(scope)">上传</el-link>
|
<el-link type="primary" @click="handleEdit(scope)">上传</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -113,8 +110,8 @@
|
||||||
:rules="rule1"
|
:rules="rule1"
|
||||||
>
|
>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12"
|
<el-col :span="12">
|
||||||
><div class="grid-content bg-purple">
|
<div class="grid-content bg-purple">
|
||||||
<el-form-item label="采购订单项目" :prop="pu_order_item">
|
<el-form-item label="采购订单项目" :prop="pu_order_item">
|
||||||
<el-select v-model="inpur.pu_order_item" @change="showmessage">
|
<el-select v-model="inpur.pu_order_item" @change="showmessage">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -125,39 +122,42 @@
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item></div
|
</el-form-item>
|
||||||
></el-col>
|
</div>
|
||||||
<el-col :span="12"
|
</el-col>
|
||||||
><div class="grid-content bg-purple">
|
<el-col :span="12">
|
||||||
|
<div class="grid-content bg-purple">
|
||||||
<el-form-item label="采购数量">
|
<el-form-item label="采购数量">
|
||||||
<el-input v-model="puorderItemdetial.count" :disabled="true">
|
<el-input v-model="puorderItemdetial.count" :disabled="true">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item></div
|
</el-form-item>
|
||||||
></el-col>
|
</div>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12"
|
<el-col :span="12">
|
||||||
><div class="grid-content bg-purple">
|
<div class="grid-content bg-purple">
|
||||||
<el-form-item label="到货时间">
|
<el-form-item label="到货时间">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="puorderItemdetial.delivery_date"
|
v-model="puorderItemdetial.delivery_date"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item></div
|
</el-form-item>
|
||||||
></el-col>
|
</div>
|
||||||
<el-col :span="12"
|
</el-col>
|
||||||
><div class="grid-content bg-purple">
|
<el-col :span="12">
|
||||||
|
<div class="grid-content bg-purple">
|
||||||
<el-form-item label="到货数量">
|
<el-form-item label="到货数量">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="puorderItemdetial.delivered_count"
|
v-model="puorderItemdetial.delivered_count"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item></div
|
</el-form-item>
|
||||||
></el-col>
|
</div>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form-item label="仓库" :prop="warehouse">
|
<el-form-item label="仓库" :prop="warehouse">
|
||||||
<el-select v-model="inpur.warehouse">
|
<el-select v-model="inpur.warehouse">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -188,14 +188,13 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<el-button type="danger" @click="dialogVisibles = false"
|
<el-button type="danger" @click="dialogVisibles = false"
|
||||||
>取消</el-button
|
>取消
|
||||||
>
|
</el-button>
|
||||||
<el-button type="primary" @click="confirminpur('Form1')"
|
<el-button type="primary" @click="confirminpur('Form1')"
|
||||||
>确认</el-button
|
>确认
|
||||||
>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
|
@ -210,7 +209,6 @@
|
||||||
<el-form-item label="是否需要复验" prop="need_test">
|
<el-form-item label="是否需要复验" prop="need_test">
|
||||||
<el-switch v-model="FIFOItem.need_test"></el-switch>
|
<el-switch v-model="FIFOItem.need_test"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="文件列表">
|
<el-form-item label="文件列表">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="upload"
|
ref="upload"
|
||||||
|
@ -239,7 +237,8 @@
|
||||||
></i>
|
></i>
|
||||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||||
item.name
|
item.name
|
||||||
}}</el-link>
|
}}
|
||||||
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
|
@ -275,16 +274,16 @@
|
||||||
v-if="item.field_type === 'string'"
|
v-if="item.field_type === 'string'"
|
||||||
:label="item.field_name"
|
:label="item.field_name"
|
||||||
>
|
>
|
||||||
<el-input placeholder="请输入" v-model="item.sort" />
|
<el-input placeholder="请输入" v-model="item.sort"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-else-if="item.field_type === 'int'"
|
v-else-if="item.field_type === 'int'"
|
||||||
:label="item.field_name"
|
:label="item.field_name"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
|
v-model="item.sort"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
v-model="item.sort"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -292,9 +291,9 @@
|
||||||
:label="item.field_name"
|
:label="item.field_name"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
|
v-model="item.sort"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
v-model="item.sort"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -371,270 +370,272 @@
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="innerVisible = false">取 消</el-button>
|
<el-button @click="innerVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitfield"
|
<el-button type="primary" @click="submitfield">
|
||||||
>提交检查项目</el-button
|
提交检查项目
|
||||||
>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="outerVisible = false">取 消</el-button>
|
<el-button @click="outerVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitrecordform"
|
<el-button type="primary" @click="submitrecordform">
|
||||||
>填写检查项目</el-button
|
填写检查项目
|
||||||
>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getfifodetailList,
|
getfifodetailList,
|
||||||
itemfiles,
|
itemfiles,
|
||||||
createfifoitem,
|
createfifoitem,
|
||||||
getWarehouseList,
|
getWarehouseList,
|
||||||
} from "@/api/inm";
|
} from "@/api/inm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import { getPuorderItemList, getpuorder } from "@/api/pum";
|
import {getPuorderItemList, getpuorder} from "@/api/pum";
|
||||||
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
||||||
import { createTestrecord } from "@/api/inm";
|
import {createTestrecord} from "@/api/inm";
|
||||||
|
|
||||||
import { upUrl, upHeaders } from "@/api/file";
|
import {upUrl, upHeaders} from "@/api/file";
|
||||||
import { genTree } from "@/utils";
|
import {genTree} from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
const defaultfile = {
|
const defaultfile = {
|
||||||
files: [],
|
files: [],
|
||||||
need_test: false,
|
need_test: false,
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: {Pagination},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
InventoryList: {
|
InventoryList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
fifodetailList: {
|
fifodetailList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
inpur: {},
|
inpur: {},
|
||||||
dialogVisibles: false,
|
dialogVisibles: false,
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList: [],
|
fileList: [],
|
||||||
FIFOItem: defaultfile,
|
FIFOItem: defaultfile,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
fieldList: {
|
fieldList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
warehouseData: [],
|
warehouseData: [],
|
||||||
is_testok: "true",
|
is_testok: "true",
|
||||||
field: [],
|
field: [],
|
||||||
recordformList: [],
|
recordformList: [],
|
||||||
recordform: "",
|
recordform: "",
|
||||||
fifo_detail: "",
|
fifo_detail: "",
|
||||||
listQueryrecordform: {
|
listQueryrecordform: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
fileData: {},
|
fileData: {},
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
innerVisible: false,
|
innerVisible: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogVisibles: false,
|
dialogVisibles: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
testrecord: {},
|
testrecord: {},
|
||||||
puorderItemdetial: [],
|
puorderItemdetial: [],
|
||||||
puorderTtemoptions: [],
|
puorderTtemoptions: [],
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
},
|
},
|
||||||
fileList: [],
|
fileList: [],
|
||||||
item: "",
|
item: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {
|
||||||
methods: {
|
},
|
||||||
checkPermission,
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
|
||||||
this.listQuery.fifo = this.$route.params.id;
|
this.listQuery.fifo = this.$route.params.id;
|
||||||
getfifodetailList(this.listQuery).then((response) => {
|
getfifodetailList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
|
||||||
this.fifodetailList = response.data;
|
|
||||||
}
|
|
||||||
this.listLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
showmessage(value) {
|
|
||||||
getpuorder(value).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.puorderItemdetial = response.data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//采购订单项入库
|
|
||||||
|
|
||||||
confirminpur() {
|
|
||||||
console.log(this.inpur);
|
|
||||||
this.inpur.material = this.puorderItemdetial.material_.id; //物料类型
|
|
||||||
this.inpur.fifo = this.$route.params.id; //出入库记录
|
|
||||||
createfifoitem(this.inpur).then((res) => {
|
|
||||||
if (res.code >= 200) {
|
|
||||||
this.getList();
|
|
||||||
this.dialogVisibles = false;
|
|
||||||
this.$message.success("成功");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handlecgxCreate() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs["Form1"].clearValidate();
|
|
||||||
});
|
|
||||||
if (this.$route.params.pu_order != null) {
|
|
||||||
this.dialogVisibles = true;
|
|
||||||
this.getpuorderitemList();
|
|
||||||
this.getlists();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//仓库
|
|
||||||
getlists() {
|
|
||||||
getWarehouseList({ page: 0 }).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.warehouseData = genTree(response.data);
|
|
||||||
}
|
|
||||||
this.listLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//采购顶单项列表
|
|
||||||
getpuorderitemList() {
|
|
||||||
getPuorderItemList({
|
|
||||||
pu_order: this.$route.params.pu_order,
|
|
||||||
page: 0,
|
|
||||||
}).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.puorderTtemoptions = response.data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleUpSuccess(res, file, filelist) {
|
|
||||||
this.fileList.push({
|
|
||||||
id: res.data.id,
|
|
||||||
name: res.data.name,
|
|
||||||
path: res.data.path,
|
|
||||||
});
|
|
||||||
this.handleRemove(file);
|
|
||||||
},
|
|
||||||
handleRemove(file) {
|
|
||||||
// 实现删除文件
|
|
||||||
let fileList = this.$refs.upload.uploadFiles;
|
|
||||||
let index = fileList.findIndex((fileItem) => {
|
|
||||||
return fileItem.uid === file.uid;
|
|
||||||
});
|
|
||||||
fileList.splice(index, 1);
|
|
||||||
},
|
|
||||||
beforeUpload(file) {
|
|
||||||
const isLt2M = file.size / 1024 / 1024 < 50;
|
|
||||||
if (!isLt2M) {
|
|
||||||
this.$message.error("单文件不能超过50MB!");
|
|
||||||
}
|
|
||||||
return isLt2M;
|
|
||||||
},
|
|
||||||
deleteFile(index) {
|
|
||||||
this.$confirm("确定删除该文件, 是否继续?", { type: "error" })
|
|
||||||
.then(() => {
|
|
||||||
this.fileList.splice(index, 1);
|
|
||||||
})
|
|
||||||
.catch((e) => {});
|
|
||||||
},
|
|
||||||
yeschange(val) {
|
|
||||||
if (!val) {
|
|
||||||
this.fileList = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleEdit(scope) {
|
|
||||||
this.FIFOItem = Object.assign({}, scope.row); // copy obj
|
|
||||||
(this.fileList = []), (this.dialogVisible = true);
|
|
||||||
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
|
|
||||||
this.fileList.push({
|
|
||||||
id: this.FIFOItem.files_[i].id,
|
|
||||||
name: this.FIFOItem.files_[i].name,
|
|
||||||
path: this.FIFOItem.files_[i].path,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
confirm() {
|
|
||||||
var files = [];
|
|
||||||
for (var i = 0; i < this.fileList.length; i++) {
|
|
||||||
files.push(this.fileList[i].id);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fileData.files = files;
|
|
||||||
this.fileData.need_test = this.FIFOItem.need_test;
|
|
||||||
console.log(this.fileData);
|
|
||||||
itemfiles(this.FIFOItem.id, this.fileData).then((res) => {
|
|
||||||
if (res.code >= 200) {
|
|
||||||
this.getList();
|
|
||||||
this.dialogVisible = false;
|
|
||||||
this.$message.success("成功");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleMaterial(scope) {
|
|
||||||
//调该物料对应的检查表
|
|
||||||
this.outerVisible = true;
|
|
||||||
this.fifo_detail = scope.row.id;
|
|
||||||
this.listQueryrecordform.material = scope.row.material;
|
|
||||||
this.listQueryrecordform.type = 2;
|
|
||||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.recordformList = response.data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//根据选择的表,渲染检查项目
|
|
||||||
submitrecordform() {
|
|
||||||
if (this.recordform != "") {
|
|
||||||
getrffieldList({ form: this.recordform, page: 0 }).then((response) => {
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fieldList = response.data;
|
this.fifodetailList = response.data;
|
||||||
this.innerVisible = true;
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showmessage(value) {
|
||||||
|
getpuorder(value).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.puorderItemdetial = response.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else this.$message.error("请选择检查表!");
|
},
|
||||||
},
|
//采购订单项入库
|
||||||
//提交检查项目
|
|
||||||
submitfield() {
|
confirminpur() {
|
||||||
let _this = this;
|
console.log(this.inpur);
|
||||||
_this.field = []; //检查项目
|
this.inpur.material = this.puorderItemdetial.material_.id; //物料类型
|
||||||
this.fieldList.forEach((item) => {
|
this.inpur.fifo = this.$route.params.id; //出入库记录
|
||||||
_this.field.push({
|
createfifoitem(this.inpur).then((res) => {
|
||||||
form_field: item.id,
|
if (res.code >= 200) {
|
||||||
field_value: item.sort,
|
this.getList();
|
||||||
|
this.dialogVisibles = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
handlecgxCreate() {
|
||||||
console.log(this.recordform);
|
this.$nextTick(() => {
|
||||||
this.testrecord.form = this.recordform;
|
this.$refs["Form1"].clearValidate();
|
||||||
this.testrecord.record_data = _this.field;
|
});
|
||||||
this.testrecord.fifo_item = this.fifo_detail;
|
if (this.$route.params.pu_order != null) {
|
||||||
|
this.dialogVisibles = true;
|
||||||
this.testrecord.is_testok = this.is_testok;
|
this.getpuorderitemList();
|
||||||
createTestrecord(this.testrecord).then((res) => {
|
this.getlists();
|
||||||
if (res.code >= 200) {
|
|
||||||
this.innerVisible = false;
|
|
||||||
this.outerVisible = false;
|
|
||||||
this.getList();
|
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
//仓库
|
||||||
|
getlists() {
|
||||||
|
getWarehouseList({page: 0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.warehouseData = genTree(response.data);
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//采购顶单项列表
|
||||||
|
getpuorderitemList() {
|
||||||
|
getPuorderItemList({
|
||||||
|
pu_order: this.$route.params.pu_order,
|
||||||
|
page: 0,
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.puorderTtemoptions = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleUpSuccess(res, file, filelist) {
|
||||||
|
this.fileList.push({
|
||||||
|
id: res.data.id,
|
||||||
|
name: res.data.name,
|
||||||
|
path: res.data.path,
|
||||||
|
});
|
||||||
|
this.handleRemove(file);
|
||||||
|
},
|
||||||
|
handleRemove(file) {
|
||||||
|
// 实现删除文件
|
||||||
|
let fileList = this.$refs.upload.uploadFiles;
|
||||||
|
let index = fileList.findIndex((fileItem) => {
|
||||||
|
return fileItem.uid === file.uid;
|
||||||
|
});
|
||||||
|
fileList.splice(index, 1);
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
const isLt2M = file.size / 1024 / 1024 < 50;
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.$message.error("单文件不能超过50MB!");
|
||||||
|
}
|
||||||
|
return isLt2M;
|
||||||
|
},
|
||||||
|
deleteFile(index) {
|
||||||
|
this.$confirm("确定删除该文件, 是否继续?", {type: "error"})
|
||||||
|
.then(() => {
|
||||||
|
this.fileList.splice(index, 1);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
yeschange(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.fileList = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.FIFOItem = Object.assign({}, scope.row); // copy obj
|
||||||
|
(this.fileList = []), (this.dialogVisible = true);
|
||||||
|
for (var i = 0; i < this.FIFOItem.files_.length; i++) {
|
||||||
|
this.fileList.push({
|
||||||
|
id: this.FIFOItem.files_[i].id,
|
||||||
|
name: this.FIFOItem.files_[i].name,
|
||||||
|
path: this.FIFOItem.files_[i].path,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
var files = [];
|
||||||
|
for (var i = 0; i < this.fileList.length; i++) {
|
||||||
|
files.push(this.fileList[i].id);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fileData.files = files;
|
||||||
|
this.fileData.need_test = this.FIFOItem.need_test;
|
||||||
|
console.log(this.fileData);
|
||||||
|
itemfiles(this.FIFOItem.id, this.fileData).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleMaterial(scope) {
|
||||||
|
//调该物料对应的检查表
|
||||||
|
this.outerVisible = true;
|
||||||
|
this.fifo_detail = scope.row.id;
|
||||||
|
this.listQueryrecordform.material = scope.row.material;
|
||||||
|
this.listQueryrecordform.type = 30;
|
||||||
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.recordformList = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//根据选择的表,渲染检查项目
|
||||||
|
submitrecordform() {
|
||||||
|
if (this.recordform != "") {
|
||||||
|
getrffieldList({form: this.recordform, page: 0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.fieldList = response.data;
|
||||||
|
this.innerVisible = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else this.$message.error("请选择检查表!");
|
||||||
|
},
|
||||||
|
//提交检查项目
|
||||||
|
submitfield() {
|
||||||
|
let _this = this;
|
||||||
|
_this.field = []; //检查项目
|
||||||
|
this.fieldList.forEach((item) => {
|
||||||
|
_this.field.push({
|
||||||
|
form_field: item.id,
|
||||||
|
field_value: item.sort,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(this.recordform);
|
||||||
|
this.testrecord.form = this.recordform;
|
||||||
|
this.testrecord.record_data = _this.field;
|
||||||
|
this.testrecord.fifo_item = this.fifo_detail;
|
||||||
|
|
||||||
|
this.testrecord.is_testok = this.is_testok;
|
||||||
|
createTestrecord(this.testrecord).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.innerVisible = false;
|
||||||
|
this.outerVisible = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
||||||
<el-tab-pane label="成品" name="1"></el-tab-pane>
|
<!--<el-tab-pane label="成品" name="1"></el-tab-pane>
|
||||||
<el-tab-pane label="半成品" name="2"></el-tab-pane>
|
<el-tab-pane label="半成品" name="2"></el-tab-pane>-->
|
||||||
<el-tab-pane label="主要原料" name="3"></el-tab-pane>
|
<el-tab-pane label="主要原料" name="3"></el-tab-pane>
|
||||||
<el-tab-pane label="辅助材料" name="4"></el-tab-pane>
|
<el-tab-pane label="辅助材料" name="4"></el-tab-pane>
|
||||||
<el-tab-pane label="加工工具" name="5"></el-tab-pane>
|
<el-tab-pane label="加工工具" name="5"></el-tab-pane>
|
||||||
|
@ -210,22 +210,23 @@
|
||||||
},
|
},
|
||||||
processOptions: [],
|
processOptions: [],
|
||||||
options_: {
|
options_: {
|
||||||
|
// "1": '成品',
|
||||||
"1": '成品',
|
// "2": '半成品',
|
||||||
"2": '半成品',
|
|
||||||
"3": '主要原料',
|
"3": '主要原料',
|
||||||
"4": '辅助材料',
|
"4": '辅助材料',
|
||||||
"5": '加工工具',
|
"5": '加工工具',
|
||||||
"6": '辅助工装',
|
"6": '辅助工装',
|
||||||
|
|
||||||
},
|
},
|
||||||
options: [{
|
options: [
|
||||||
|
/*{
|
||||||
value: 1,
|
value: 1,
|
||||||
label: '成品'
|
label: '成品'
|
||||||
}, {
|
}, {
|
||||||
value: 2,
|
value: 2,
|
||||||
label: '半成品'
|
label: '半成品'
|
||||||
}, {
|
}, */
|
||||||
|
{
|
||||||
value: 3,
|
value: 3,
|
||||||
label: '主要原料'
|
label: '主要原料'
|
||||||
}, {
|
}, {
|
||||||
|
@ -258,10 +259,11 @@
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
listQuery: {
|
listQuery: {
|
||||||
|
type:3,
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
activeName: "",
|
activeName: "3",
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
|
|
|
@ -0,0 +1,351 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
v-if="checkPermission(['material_create'])"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleCreate"
|
||||||
|
>
|
||||||
|
新增成品
|
||||||
|
</el-button>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="成品名称/成品编号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
clearable
|
||||||
|
@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 style="margin-top: 2px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="materialList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
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> 成品</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="成品名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单片玻璃数量">
|
||||||
|
<template slot-scope="scope">{{ scope.row.piece_count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="计量单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.unit }}</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="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])&&scope.row.type!=5&&scope.row.type!=6"
|
||||||
|
type="primary"
|
||||||
|
@click="handlebind(scope)"
|
||||||
|
>
|
||||||
|
检查表
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
subproduction_delete
|
||||||
|
type="primary"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])"
|
||||||
|
type="primary"
|
||||||
|
@click="handledetail(scope)"
|
||||||
|
>
|
||||||
|
详情
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="materialList.count > 0"
|
||||||
|
:total="materialList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:title="dialogType === 'edit' ? '编辑成品' : '新增成品'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="material"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="成品名称" prop="name">
|
||||||
|
<el-input v-model="material.name" placeholder="成品名称"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="成品编号" prop="number">
|
||||||
|
<el-input v-model="material.number" placeholder="成品编号"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规格型号">
|
||||||
|
<el-input v-model="material.specification" placeholder="规格型号"/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="计量单位">
|
||||||
|
<el-select style="width: 100%" v-model="material.unit" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in unitoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单片玻璃数量" v-if="material.type==1">
|
||||||
|
<el-input v-model="material.piece_count" placeholder="单片玻璃数量"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安全库存数">
|
||||||
|
<el-input-number style="width: 100%;" v-model="material.count_safe" :step="1" :min="0" step-strictly
|
||||||
|
placeholder="安全库存数"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序">
|
||||||
|
<el-input-number style="width: 100%;" v-model="material.sort_str" :step="1" :min="0" step-strictly
|
||||||
|
placeholder="排序"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getMaterialList,
|
||||||
|
createMaterial,
|
||||||
|
updateMaterial,
|
||||||
|
deleteMaterial
|
||||||
|
} from "@/api/mtm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import Pagination from "@/components/Pagination";
|
||||||
|
|
||||||
|
const defaultmaterial = {
|
||||||
|
name: null,
|
||||||
|
number: null,
|
||||||
|
specification: null,
|
||||||
|
unit: null,
|
||||||
|
type: 1,
|
||||||
|
piece_count: null,
|
||||||
|
sort_str: null,
|
||||||
|
count_safe: 0,
|
||||||
|
processes: [],
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
name: "productList",
|
||||||
|
components: {Pagination},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
material: defaultmaterial,
|
||||||
|
materialList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
options_: {
|
||||||
|
|
||||||
|
"1": '成品',
|
||||||
|
"2": '半成品',
|
||||||
|
"3": '主要原料',
|
||||||
|
"4": '辅助材料',
|
||||||
|
"5": '加工工具',
|
||||||
|
"6": '辅助工装',
|
||||||
|
|
||||||
|
},
|
||||||
|
unitoptions: [
|
||||||
|
{
|
||||||
|
value: '块',
|
||||||
|
label: '块'
|
||||||
|
}, {
|
||||||
|
value: '套',
|
||||||
|
label: '套'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '个',
|
||||||
|
label: '个'
|
||||||
|
}, {
|
||||||
|
value: 'm2',
|
||||||
|
label: 'm2'
|
||||||
|
}, {
|
||||||
|
value: '瓶',
|
||||||
|
label: '瓶'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
listQuery: {
|
||||||
|
type: 1,
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
activeName: "",
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
|
number: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
// this.getProcessList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//成品详情
|
||||||
|
handledetail(scope) {
|
||||||
|
this.$router.push({name: "MaterialDetail", params: {id: scope.row.id, type: scope.row.type},})
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
let that = this;
|
||||||
|
that.listLoading = true;
|
||||||
|
getMaterialList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
that.materialList = response.data;
|
||||||
|
}
|
||||||
|
that.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//检查表
|
||||||
|
handlebind(scope) {
|
||||||
|
this.$router.push({name: "MaterialDO", params: {id: scope.row.id},})
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.activeName = "";
|
||||||
|
this.listQuery = {
|
||||||
|
type: 1,
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.material = Object.assign({}, defaultmaterial);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.material = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType = "edit";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
let that = this;
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteMaterial(scope.row.id);
|
||||||
|
that.getList();
|
||||||
|
that.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
that.$message.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async confirm(form) {
|
||||||
|
let that = this;
|
||||||
|
that.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
updateMaterial(this.material.id, this.material).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.getList();
|
||||||
|
that.dialogVisible = false;
|
||||||
|
that.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createMaterial(this.material).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.getList();
|
||||||
|
that.dialogVisible = false;
|
||||||
|
that.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,322 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
v-if="checkPermission(['material_create'])"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleCreate"
|
||||||
|
>
|
||||||
|
新增半成品
|
||||||
|
</el-button>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="半成品名称/半成品编号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
clearable
|
||||||
|
@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 style="margin-top: 2px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="materialList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
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> 半成品</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="半成品名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.specification }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="计量单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.unit }}</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="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])&&scope.row.type!=5&&scope.row.type!=6"
|
||||||
|
type="primary"
|
||||||
|
@click="handlebind(scope)"
|
||||||
|
>检查表
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
subproduction_delete
|
||||||
|
type="primary"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
>编辑
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_update'])"
|
||||||
|
type="primary"
|
||||||
|
@click="handledetail(scope)"
|
||||||
|
>详情
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['material_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="materialList.count > 0"
|
||||||
|
:total="materialList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:title="dialogType === 'edit' ? '编辑半成品' : '新增半成品'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="material"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="半成品名称" prop="name">
|
||||||
|
<el-input v-model="material.name" placeholder="半成品名称"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="半成品编号" prop="number">
|
||||||
|
<el-input v-model="material.number" placeholder="半成品编号"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规格型号">
|
||||||
|
<el-input v-model="material.specification" placeholder="规格型号"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计量单位">
|
||||||
|
<el-select style="width: 100%" v-model="material.unit" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in unitoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="安全库存数">
|
||||||
|
<el-input-number style="width: 100%;" v-model="material.count_safe" :step="1" :min="0" step-strictly placeholder="安全库存数"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序">
|
||||||
|
<el-input-number style="width: 100%;" v-model="material.sort_str" :step="1" :min="0" step-strictly placeholder="排序"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getMaterialList,
|
||||||
|
createMaterial,
|
||||||
|
updateMaterial,
|
||||||
|
deleteMaterial
|
||||||
|
} from "@/api/mtm";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import Pagination from "@/components/Pagination";
|
||||||
|
const defaultmaterial = {
|
||||||
|
name: null,
|
||||||
|
number: null,
|
||||||
|
specification: null,
|
||||||
|
unit: null,
|
||||||
|
type: 2,
|
||||||
|
piece_count: null,
|
||||||
|
sort_str: null,
|
||||||
|
count_safe: 0,
|
||||||
|
processes: [],
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
name: "wproductList",
|
||||||
|
components: {Pagination},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
material: defaultmaterial,
|
||||||
|
materialList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
unitoptions: [
|
||||||
|
{
|
||||||
|
value: '块',
|
||||||
|
label: '块'
|
||||||
|
}, {
|
||||||
|
value: '套',
|
||||||
|
label: '套'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '个',
|
||||||
|
label: '个'
|
||||||
|
}, {
|
||||||
|
value: 'm2',
|
||||||
|
label: 'm2'
|
||||||
|
}, {
|
||||||
|
value: '瓶',
|
||||||
|
label: '瓶'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
listQuery: {
|
||||||
|
type:2,
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
activeName: "",
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
|
number: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
// this.getProcessList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//半成品详情
|
||||||
|
handledetail(scope){
|
||||||
|
this.$router.push({name: "MaterialDetail", params: { id: scope.row.id,type: scope.row.type }, })
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getMaterialList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.materialList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//检查表
|
||||||
|
handlebind(scope) {
|
||||||
|
this.$router.push({name: "MaterialDO", params: {id: scope.row.id},})
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.activeName = "";
|
||||||
|
this.listQuery = {
|
||||||
|
type: 2,
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.material = Object.assign({}, defaultmaterial);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.material = 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 deleteMaterial(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) {
|
||||||
|
updateMaterial(this.material.id, this.material).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createMaterial(this.material).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,323 +1,392 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
||||||
<el-tab-pane label="总览" name="1" >
|
<el-tab-pane label="总览" name="1">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="fifodetailList1.results"
|
:data="fifodetailList1.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
height="620"
|
height="620"
|
||||||
v-el-height-adaptive-table="{bottomOffset: 40}"
|
v-el-height-adaptive-table="{bottomOffset: 40}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50"/>
|
||||||
<el-table-column label="物料批次">
|
<el-table-column label="物料批次">
|
||||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料名称">
|
<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>
|
||||||
<el-table-column label="规格型号">
|
<el-table-column label="规格型号">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope">{{scope.row.material_.specification}}</template>
|
||||||
scope.row.material_.specification
|
</el-table-column>
|
||||||
}}</template>
|
<el-table-column label="物料单位">
|
||||||
</el-table-column>
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
<el-table-column label="物料单位">
|
</el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
<el-table-column label="总数量">
|
||||||
</el-table-column>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
<el-table-column label="总数量">
|
</el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
<!--<el-table-column label="检查状态">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="检查状态">
|
<el-tag v-if="scope.row.is_tested == false">未检查</el-tag>
|
||||||
<template slot-scope="scope">
|
<el-tag v-else>已检查</el-tag>
|
||||||
<el-tag v-if="scope.row.is_tested == false">未检查</el-tag>
|
</template>
|
||||||
<el-tag v-else>已检查</el-tag>
|
</el-table-column>-->
|
||||||
</template>
|
<el-table-column label="检查是否合格">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="检查是否合格">
|
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
||||||
<template slot-scope="scope" v-if="scope.row.is_tested == true">
|
<el-tag v-else>合格</el-tag>
|
||||||
<el-tag v-if="scope.row.is_testok == false">不合格</el-tag>
|
</template>
|
||||||
<el-tag v-else>合格</el-tag>
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="是否需要复验">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="创建时间">
|
<el-tag v-if="scope.row.need_test">是</el-tag>
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
<el-tag v-else>否</el-tag>
|
||||||
</el-table-column>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
<el-table-column label="文件">
|
||||||
<pagination
|
<template slot-scope="scope" v-if="scope.row.files">
|
||||||
v-show="fifodetailList1.count > 0"
|
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||||
:total="fifodetailList1.count"
|
<el-link :href="item.path" target="_blank" type="primary">{{item.name}}</el-link>
|
||||||
:page.sync="listQuery1.page"
|
</div>
|
||||||
:limit.sync="listQuery1.page_size"
|
</template>
|
||||||
@pagination="getList1"
|
</el-table-column>
|
||||||
/>
|
<el-table-column label="创建时间">
|
||||||
|
<template slot-scope="scope">{{scope.row.create_time}}</template>
|
||||||
</el-tab-pane>
|
</el-table-column>
|
||||||
<el-tab-pane label="待检物料" name="2">
|
<el-table-column
|
||||||
<el-table
|
align="center"
|
||||||
v-loading="listLoading"
|
label="操作"
|
||||||
:data="fifodetailList2.results"
|
>
|
||||||
border
|
<template slot-scope="scope">
|
||||||
fit
|
<el-link
|
||||||
stripe
|
type="primary"
|
||||||
highlight-current-row
|
@click="handleRecord(scope)"
|
||||||
height="620"
|
>
|
||||||
v-el-height-adaptive-table="{bottomOffset: 40}"
|
复验记录
|
||||||
>
|
</el-link>
|
||||||
<el-table-column type="index" width="50" />
|
</template>
|
||||||
<el-table-column label="物料批次">
|
</el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
</el-table>
|
||||||
</el-table-column>
|
<pagination
|
||||||
<el-table-column label="物料名称">
|
v-show="fifodetailList1.count > 0"
|
||||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
:total="fifodetailList1.count"
|
||||||
</el-table-column>
|
:page.sync="listQuery1.page"
|
||||||
<el-table-column label="规格型号">
|
:limit.sync="listQuery1.page_size"
|
||||||
<template slot-scope="scope">{{
|
@pagination="getList1"
|
||||||
scope.row.material_.specification
|
/>
|
||||||
}}</template>
|
</el-tab-pane>
|
||||||
</el-table-column>
|
<el-tab-pane label="待检物料" name="2">
|
||||||
<el-table-column label="物料单位">
|
<el-table
|
||||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
v-loading="listLoading"
|
||||||
</el-table-column>
|
:data="fifodetailList2.results"
|
||||||
<el-table-column label="总数量">
|
border
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
fit
|
||||||
</el-table-column>
|
stripe
|
||||||
|
highlight-current-row
|
||||||
<el-table-column label="创建时间">
|
height="620"
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
v-el-height-adaptive-table="{bottomOffset: 40}"
|
||||||
</el-table-column>
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
</el-table>
|
<el-table-column label="物料批次">
|
||||||
<pagination
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
v-show="fifodetailList2.count > 0"
|
</el-table-column>
|
||||||
:total="fifodetailList2.count"
|
<el-table-column label="物料名称">
|
||||||
:page.sync="listQuery2.page"
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
:limit.sync="listQuery2.page_size"
|
</el-table-column>
|
||||||
@pagination="getList2"
|
<el-table-column label="规格型号">
|
||||||
/>
|
<template slot-scope="scope">{{scope.row.material_.specification}}</template>
|
||||||
</el-tab-pane>
|
</el-table-column>
|
||||||
<el-tab-pane label="合格物料" name="3">
|
<el-table-column label="物料单位">
|
||||||
<el-table
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
v-loading="listLoading"
|
</el-table-column>
|
||||||
:data="fifodetailList3.results"
|
<el-table-column label="总数量">
|
||||||
border
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
fit
|
</el-table-column>
|
||||||
stripe
|
<el-table-column label="创建时间">
|
||||||
highlight-current-row
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
height="620"
|
</el-table-column>
|
||||||
v-el-height-adaptive-table="{bottomOffset: 40}"
|
</el-table>
|
||||||
>
|
<pagination
|
||||||
<el-table-column type="index" width="50" />
|
v-show="fifodetailList2.count > 0"
|
||||||
<el-table-column label="物料批次">
|
:total="fifodetailList2.count"
|
||||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
:page.sync="listQuery2.page"
|
||||||
</el-table-column>
|
:limit.sync="listQuery2.page_size"
|
||||||
<el-table-column label="物料名称">
|
@pagination="getList2"
|
||||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
/>
|
||||||
</el-table-column>
|
</el-tab-pane>
|
||||||
<el-table-column label="规格型号">
|
<el-tab-pane label="合格物料" name="3">
|
||||||
<template slot-scope="scope">{{
|
<el-table
|
||||||
scope.row.material_.specification
|
v-loading="listLoading"
|
||||||
}}</template>
|
:data="fifodetailList3.results"
|
||||||
</el-table-column>
|
border
|
||||||
<el-table-column label="物料单位">
|
fit
|
||||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
stripe
|
||||||
</el-table-column>
|
highlight-current-row
|
||||||
<el-table-column label="仓库">
|
height="620"
|
||||||
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
v-el-height-adaptive-table="{bottomOffset: 40}"
|
||||||
</el-table-column>
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
<el-table-column label="入库数量">
|
<el-table-column label="物料批次">
|
||||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="物料名称">
|
||||||
<el-table-column label="创建时间">
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="规格型号">
|
||||||
|
<template slot-scope="scope">{{scope.row.material_.specification}}</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
<pagination
|
<el-table-column label="物料单位">
|
||||||
v-show="fifodetailList3.count > 0"
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
:total="fifodetailList3.count"
|
</el-table-column>
|
||||||
:page.sync="listQuery3.page"
|
<el-table-column label="仓库">
|
||||||
:limit.sync="listQuery3.page_size"
|
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||||
@pagination="getList3"
|
</el-table-column>
|
||||||
/>
|
<el-table-column label="入库数量">
|
||||||
</el-tab-pane>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
<el-tab-pane label="不合格物料" name="4">
|
</el-table-column>
|
||||||
<el-table
|
<el-table-column label="是否需要复验">
|
||||||
v-loading="listLoading"
|
<template slot-scope="scope">
|
||||||
:data="fifodetailList4.results"
|
<el-tag v-if="scope.row.need_test">是</el-tag>
|
||||||
border
|
<el-tag v-else>否</el-tag>
|
||||||
fit
|
</template>
|
||||||
stripe
|
</el-table-column>
|
||||||
highlight-current-row
|
<el-table-column label="文件">
|
||||||
height="620"
|
<template slot-scope="scope" v-if="scope.row.files">
|
||||||
v-el-height-adaptive-table="{bottomOffset: 40}"
|
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||||
>
|
<el-link :href="item.path" target="_blank" type="primary">{{item.name}}</el-link>
|
||||||
<el-table-column type="index" width="50" />
|
</div>
|
||||||
<el-table-column label="物料批次">
|
</template>
|
||||||
<template slot-scope="scope">{{ scope.row.batch }}</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="创建时间">
|
||||||
<el-table-column label="物料名称">
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column
|
||||||
<el-table-column label="规格型号">
|
align="center"
|
||||||
<template slot-scope="scope">{{
|
label="操作"
|
||||||
scope.row.material_.specification
|
>
|
||||||
}}</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-link
|
||||||
<el-table-column label="物料单位">
|
v-if="scope.row.need_test"
|
||||||
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
type="primary"
|
||||||
</el-table-column>
|
@click="handleRecord(scope)"
|
||||||
|
>
|
||||||
<el-table-column label="创建时间">
|
复验记录
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
</el-link>
|
||||||
</el-table-column>
|
<el-link
|
||||||
|
v-else
|
||||||
</el-table>
|
type="info"
|
||||||
<pagination
|
:disabled="!scope.row.need_test"
|
||||||
v-show="fifodetailList4.count > 0"
|
@click="handleRecord(scope)"
|
||||||
:total="fifodetailList4.count"
|
>
|
||||||
:page.sync="listQuery4.page"
|
复验记录
|
||||||
:limit.sync="listQuery4.page_size"
|
</el-link>
|
||||||
@pagination="getList4"
|
</template>
|
||||||
/>
|
</el-table-column>
|
||||||
</el-tab-pane>
|
</el-table>
|
||||||
</el-tabs>
|
<pagination
|
||||||
|
v-show="fifodetailList3.count > 0"
|
||||||
|
:total="fifodetailList3.count"
|
||||||
|
:page.sync="listQuery3.page"
|
||||||
|
:limit.sync="listQuery3.page_size"
|
||||||
|
@pagination="getList3"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="不合格物料" name="4">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="fifodetailList4.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
height="620"
|
||||||
|
v-el-height-adaptive-table="{bottomOffset: 40}"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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.material_.specification}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料单位">
|
||||||
|
<template slot-scope="scope">{{ scope.row.material_.unit }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.files">
|
||||||
|
<div v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||||
|
<el-link :href="item.file" target="_blank" type="primary">{{item.name}}</el-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否需要复验">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.need_test">是</el-tag>
|
||||||
|
<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>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.need_test"
|
||||||
|
type="primary"
|
||||||
|
@click="handleRecord(scope)"
|
||||||
|
>
|
||||||
|
复验记录
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
type="info"
|
||||||
|
:disabled="!scope.row.need_test"
|
||||||
|
@click="handleRecord(scope)"
|
||||||
|
>
|
||||||
|
复验记录
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="fifodetailList4.count > 0"
|
||||||
|
:total="fifodetailList4.count"
|
||||||
|
:page.sync="listQuery4.page"
|
||||||
|
:limit.sync="listQuery4.page_size"
|
||||||
|
@pagination="getList4"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getfifodetailList } from "@/api/inm";
|
import {getfifodetailList} from "@/api/inm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import { createTestrecord } from "@/api/inm";
|
import {createTestrecord} from "@/api/inm";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: {Pagination},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
InventoryList: {
|
InventoryList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
fifodetailList1: {
|
fifodetailList1: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
listQuery1: {
|
listQuery1: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
listQuery2: {
|
listQuery2: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
listQuery3: {
|
listQuery3: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
listQuery4: {
|
listQuery4: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
is_testok: "true",
|
is_testok: "true",
|
||||||
fifodetailList2:{
|
fifodetailList2: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
fifodetailList3:{
|
fifodetailList3: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
fifodetailList4:{
|
fifodetailList4: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
activeName:"1"
|
activeName: "1"
|
||||||
};
|
};
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
created() {
|
|
||||||
this.getList1();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
checkPermission,
|
|
||||||
|
|
||||||
getList1() {
|
|
||||||
this.listLoading = true;
|
|
||||||
|
|
||||||
this.listQuery1.fifo__type = 3;
|
|
||||||
getfifodetailList(this.listQuery1).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.fifodetailList1 = response.data;
|
|
||||||
}
|
|
||||||
this.listLoading = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//待检
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList1();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
|
getList1() {
|
||||||
|
this.listLoading = true;
|
||||||
|
|
||||||
|
this.listQuery1.fifo__type = 3;
|
||||||
|
getfifodetailList(this.listQuery1).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.fifodetailList1 = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//待检
|
||||||
getList2() {
|
getList2() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
this.listQuery2.fifo__type = 3;
|
this.listQuery2.fifo__type = 3;
|
||||||
this.listQuery2.is_tested = false;
|
this.listQuery2.is_tested = false;
|
||||||
getfifodetailList(this.listQuery2).then((response) => {
|
getfifodetailList(this.listQuery2).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fifodetailList2 = response.data;
|
this.fifodetailList2 = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//合格物料
|
//合格物料
|
||||||
getList3() {
|
getList3() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
this.listQuery3.fifo__type = 3;
|
this.listQuery3.fifo__type = 3;
|
||||||
this.listQuery3.is_testok = true;
|
this.listQuery3.is_testok = true;
|
||||||
getfifodetailList(this.listQuery3).then((response) => {
|
getfifodetailList(this.listQuery3).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fifodetailList3 = response.data;
|
this.fifodetailList3 = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//不合格物料
|
//不合格物料
|
||||||
getList4() {
|
getList4() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
this.listQuery4.fifo__type = 3;
|
this.listQuery4.fifo__type = 3;
|
||||||
this.listQuery4.is_testok = false;
|
this.listQuery4.is_testok = false;
|
||||||
this.listQuery4.is_tested = true;
|
this.listQuery4.is_tested = true;
|
||||||
getfifodetailList(this.listQuery4).then((response) => {
|
getfifodetailList(this.listQuery4).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fifodetailList4 = response.data;
|
this.fifodetailList4 = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//选项卡切换
|
//选项卡切换
|
||||||
handleClick(tab) {
|
handleClick(tab) {
|
||||||
|
if (tab.name == 1) {
|
||||||
|
|
||||||
if(tab.name==1)
|
|
||||||
{
|
|
||||||
this.getList1()
|
this.getList1()
|
||||||
}
|
} else if (tab.name == 2) {
|
||||||
else if(tab.name==2)
|
|
||||||
{
|
|
||||||
this.getList2()
|
this.getList2()
|
||||||
}
|
} else if (tab.name == 3) {
|
||||||
else if(tab.name==3)
|
|
||||||
{
|
|
||||||
this.getList3()
|
this.getList3()
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
this.getList4()
|
this.getList4()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
//检验记录
|
||||||
|
handleRecord(){
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,81 +1,87 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="iproductData2.results"
|
:data="iproductData2.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
max-height="700"
|
max-height="700"
|
||||||
height="100"
|
height="100"
|
||||||
v-el-height-adaptive-table="{bottomOffset: 42}"
|
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="成品编号" prop="number">
|
<el-table-column label="成品编号" prop="number">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="成品批次" prop="batch">
|
<el-table-column label="成品批次" prop="batch">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="成品名称">
|
<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>
|
||||||
<el-table-column label="所在仓库">
|
<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>
|
||||||
<el-table-column label="订单">
|
<el-table-column label="订单">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
|
<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>
|
</el-tag>
|
||||||
<span v-else></span>
|
<span v-else></span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="合同">
|
<el-table-column label="合同">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
|
<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-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
|
||||||
<span v-else></span>
|
<span v-else></span>-->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="客户">
|
<el-table-column label="监管协议号">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
|
<span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.watch_num}}</span>
|
||||||
<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
|
<!--<span v-else>{{scope.row.order_.contract_.watch_num}}</span>-->
|
||||||
<span v-else></span>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="客户">
|
||||||
<el-table-column label="军检">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
<span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
|
||||||
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
|
<!--<span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>-->
|
||||||
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
|
<!--<span v-else></span>-->
|
||||||
<span v-else></span>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="军检">
|
||||||
<el-table-column
|
<template slot-scope="scope">
|
||||||
align="center"
|
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
|
||||||
label="操作"
|
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
|
||||||
width="220px"
|
<span v-else></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
|
||||||
|
@click="handleMtest(scope)"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
军检
|
||||||
<el-link
|
</el-link>
|
||||||
v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
|
</template>
|
||||||
@click="handleMtest(scope)"
|
</el-table-column>
|
||||||
>
|
</el-table>
|
||||||
军检
|
<pagination
|
||||||
</el-link>
|
v-show="iproductData2.count > 0"
|
||||||
</template>
|
:total="iproductData2.count"
|
||||||
</el-table-column>
|
:page.sync="listQuery2.page"
|
||||||
</el-table>
|
:limit.sync="listQuery2.page_size"
|
||||||
<pagination
|
@pagination="getList2"
|
||||||
v-show="iproductData2.count > 0"
|
/>
|
||||||
:total="iproductData2.count"
|
|
||||||
:page.sync="listQuery2.page"
|
|
||||||
:limit.sync="listQuery2.page_size"
|
|
||||||
@pagination="getList2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
|
@ -115,7 +121,7 @@
|
||||||
components: {Pagination},
|
components: {Pagination},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
iproductData2: {
|
iproductData2: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
|
@ -137,10 +143,10 @@
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
|
|
||||||
getList2() {
|
getList2() {
|
||||||
this.listQuery2.material__type = 1;
|
this.listQuery2.material__type = 1;
|
||||||
this.listQuery2.to_order_need_mtest = true;
|
this.listQuery2.to_order_need_mtest = true;
|
||||||
getiproductList(this.listQuery2).then((response) => {
|
getiproductList(this.listQuery2).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.iproductData2 = response.data;
|
this.iproductData2 = response.data;
|
||||||
|
|
Loading…
Reference in New Issue