test&gantt
This commit is contained in:
parent
2b4bc1025b
commit
f34ecf8395
|
|
@ -57,4 +57,41 @@ export function deleteTestitem(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//检测记录
|
||||||
|
export function getTestRecord(query) {
|
||||||
|
return request({
|
||||||
|
url: '/qm/testrecord/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//检测记录
|
||||||
|
export function getTestRecordItem(id) {
|
||||||
|
return request({
|
||||||
|
url: `/qm/testrecord/${id}/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//检测记录更改保存
|
||||||
|
export function putTestRecordItem(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/qm/testrecord/${id}/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//检测记录删除
|
||||||
|
export function delTestRecordItem(id) {
|
||||||
|
return request({
|
||||||
|
url: `/qm/testrecord/${id}/`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//检测记录提交
|
||||||
|
export function subTestRecordItem(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/qm/testrecord/${id}/submit/`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
//生产进度表
|
||||||
|
export function getPlanGantt(data) {
|
||||||
|
return request({
|
||||||
|
url: '/srm/gantt/plan/',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -181,8 +181,8 @@ export function getrecordList(query) {
|
||||||
//操作提交自定义表
|
//操作提交自定义表
|
||||||
export function createRecord(id, data) {
|
export function createRecord(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/wpm/operation_record/${id}/submit/`,
|
url: `/wpm/operation_record/${id}/`,
|
||||||
method: 'post',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col
|
<el-col
|
||||||
v-for="(item, $index) in formData"
|
v-for="(item, $index) in formData"
|
||||||
v-show="filterBlock(item.parent,item.display_expression)"
|
v-show="filterBlock(item.parent,item.display_expression,$index,item.field_key)"
|
||||||
:key="$index"
|
:key="$index"
|
||||||
:span="12"
|
:span="12"
|
||||||
style="position: relative"
|
style="position: relative"
|
||||||
|
|
@ -123,7 +123,8 @@
|
||||||
<el-row v-show="hasPicture">
|
<el-row v-show="hasPicture">
|
||||||
<el-form-item label="图表">
|
<el-form-item label="图表">
|
||||||
<div>
|
<div>
|
||||||
<img id="canvasImg" :src="img" style="width:500px;height: 300px;display: none">
|
<!--<img id="canvasImg" :src="img" style="width:500px;height: 300px;display: none">-->
|
||||||
|
<img id="canvasImg" src="./../../assets/glass.png" style="width:500px;height: 300px;display: none">
|
||||||
<div style="position: relative;display: flex;flex-direction: column;
|
<div style="position: relative;display: flex;flex-direction: column;
|
||||||
border: 1px solid #DCDFE6;">
|
border: 1px solid #DCDFE6;">
|
||||||
<canvas id="canvas" width="500" height="300">
|
<canvas id="canvas" width="500" height="300">
|
||||||
|
|
@ -155,7 +156,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="dialog-footer" style="text-align: right">
|
<div class="dialog-footer" style="text-align: right">
|
||||||
<el-button @click="innerVisible = false">取 消</el-button>
|
<el-button @click="innerVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitfield">提交检查项目</el-button>
|
<el-button type="primary" @click="submitfield('1')">保存</el-button>
|
||||||
|
<el-button type="primary" @click="submitfield('2')">提交</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
@ -182,29 +184,49 @@
|
||||||
type:Number,
|
type:Number,
|
||||||
default:0
|
default:0
|
||||||
},
|
},
|
||||||
|
recordId: {
|
||||||
|
type:Number,
|
||||||
|
default:null
|
||||||
|
},
|
||||||
|
origin_test: {
|
||||||
|
type:Number,
|
||||||
|
default:null
|
||||||
|
},
|
||||||
hasPicture:{
|
hasPicture:{
|
||||||
type:Boolean,
|
type:Boolean,
|
||||||
default:false
|
default:false
|
||||||
|
},
|
||||||
|
recordItem:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
debugger;
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.checkForm = {};
|
||||||
this.form = this.formID;
|
this.form = this.formID;
|
||||||
let formData=this.results;
|
let formData=this.results;
|
||||||
that.wproductId=this.wproduct;
|
that.wproductId=this.wproduct;
|
||||||
formData.forEach(item => {
|
formData.forEach(item => {
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
obj = item;
|
obj = item;
|
||||||
obj.is_testok = null;//是否合格
|
|
||||||
that.formData.push(obj)
|
that.formData.push(obj)
|
||||||
});
|
});
|
||||||
that.formData=[...that.formData];
|
that.formData=[...formData];
|
||||||
|
debugger;
|
||||||
for(let i=0;i<this.results.length;i++){
|
for(let i=0;i<this.results.length;i++){
|
||||||
let key = this.results[i].field_key;
|
let key = this.results[i].field_key;
|
||||||
//checkForm接收表单数据的对象
|
//checkForm接收表单数据的对象
|
||||||
|
let valu = this.results[i].field_value;
|
||||||
|
if(valu!==null&&valu!==''&&valu!==undefined){
|
||||||
|
that.checkForm[key]=valu;
|
||||||
|
that.$set(that.checkForm,key,valu);
|
||||||
|
that.is_save = true;
|
||||||
|
}else{
|
||||||
that.checkForm[key]='';
|
that.checkForm[key]='';
|
||||||
that.$set(that.checkForm,key,'')
|
that.$set(that.checkForm,key,null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let listJudge = this.formData.filter(item => {
|
let listJudge = this.formData.filter(item => {
|
||||||
return item.need_judge === true;
|
return item.need_judge === true;
|
||||||
|
|
@ -217,9 +239,9 @@
|
||||||
let imag= this.formData.filter(item => {
|
let imag= this.formData.filter(item => {
|
||||||
return item.field_type === 'draw';
|
return item.field_type === 'draw';
|
||||||
});
|
});
|
||||||
that.img = new Image();
|
/* that.img = new Image();
|
||||||
that.img.crossOrigin = '';
|
that.img.crossOrigin = '';
|
||||||
that.img = 'http://47.95.0.242:2222'+imag[0].draw_template;
|
that.img = 'http://47.95.0.242:2222'+imag[0].draw_template;*/
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
that.canvasInit();
|
that.canvasInit();
|
||||||
},500);
|
},500);
|
||||||
|
|
@ -252,11 +274,12 @@
|
||||||
judgeList:[],//判定数组
|
judgeList:[],//判定数组
|
||||||
is_testok:true,
|
is_testok:true,
|
||||||
testokTrue:true,
|
testokTrue:true,
|
||||||
|
is_save:false,
|
||||||
testokFalse:false,
|
testokFalse:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
filterBlock(parent,rule){
|
filterBlock(parent,rule,index,field_key){
|
||||||
// debugger;
|
// debugger;
|
||||||
let that = this;
|
let that = this;
|
||||||
if(parent!==''&&parent!==null&&parent!==undefined){
|
if(parent!==''&&parent!==null&&parent!==undefined){
|
||||||
|
|
@ -305,6 +328,12 @@
|
||||||
rea = true;
|
rea = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(rea){
|
||||||
|
that.formData[index].is_hidden = false;
|
||||||
|
}else{
|
||||||
|
that.formData[index].is_hidden = true;
|
||||||
|
that.checkForm[field_key] = null;
|
||||||
|
}
|
||||||
return rea;
|
return rea;
|
||||||
}else{
|
}else{
|
||||||
let temp =rule.match(reg)[0];
|
let temp =rule.match(reg)[0];
|
||||||
|
|
@ -312,13 +341,21 @@
|
||||||
let a = rule.replace(key, 'yy');
|
let a = rule.replace(key, 'yy');
|
||||||
a = a.replace(key, 'yy');
|
a = a.replace(key, 'yy');
|
||||||
let yy = "'"+that.checkForm[key]+"'";
|
let yy = "'"+that.checkForm[key]+"'";
|
||||||
|
if(eval(eval(a))){
|
||||||
|
that.formData[index].is_hidden = false;
|
||||||
|
}else{
|
||||||
|
that.formData[index].is_hidden = true;
|
||||||
|
that.checkForm[field_key] = null;
|
||||||
|
}
|
||||||
return eval(eval(a));
|
return eval(eval(a));
|
||||||
// return eval("'"+y+"'"+str);
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
that.formData[index].is_hidden = true;
|
||||||
|
that.checkForm[field_key] = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
that.formData[index].is_hidden = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -638,7 +675,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//提交检查项目
|
//提交检查项目
|
||||||
submitfield() {
|
submitfield(isSubmit) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let drawArr = that.formData.filter(item=>{
|
let drawArr = that.formData.filter(item=>{
|
||||||
return item.field_type==='draw';
|
return item.field_type==='draw';
|
||||||
|
|
@ -657,29 +694,58 @@
|
||||||
if(res){
|
if(res){
|
||||||
let key = drawArr[0].field_key;
|
let key = drawArr[0].field_key;
|
||||||
that.imgUrl=res.data.file;
|
that.imgUrl=res.data.file;
|
||||||
that.checkForm[key] = that.imgUrl;
|
that.checkForm[key] = res.data.file;
|
||||||
that.fieldData();
|
that.fieldData(isSubmit);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
that.fieldData();
|
that.fieldData(isSubmit);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fieldData(){
|
fieldData(isSubmit){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.field = []; //检查项目
|
that.field = []; //检查项目
|
||||||
|
let submit = isSubmit=='1'?false:true;
|
||||||
|
if(that.recordItem){//有记录
|
||||||
that.formData.forEach((item) => {
|
that.formData.forEach((item) => {
|
||||||
|
if(!item.is_hidden){
|
||||||
|
that.field.push({
|
||||||
|
id: item.id,
|
||||||
|
field_value: that.checkForm[item.field_key],
|
||||||
|
is_testok: item.is_testok,//单项检查结果
|
||||||
|
is_hidden: item.is_hidden
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
that.testrecord.record_data = that.field;//检查项列表
|
||||||
|
that.testrecord.is_testok = that.is_testok;//检查表检查结果
|
||||||
|
that.testrecord.id = that.recordId;//记录id
|
||||||
|
if(submit){//提交
|
||||||
|
this.$emit('recordSubmit',that.testrecord);
|
||||||
|
}else {//保存
|
||||||
|
this.$emit('recordSave',that.testrecord);
|
||||||
|
}
|
||||||
|
}else{//第一次操作时
|
||||||
|
that.formData.forEach((item) => {
|
||||||
|
if(!item.is_hidden){
|
||||||
that.field.push({
|
that.field.push({
|
||||||
form_field: item.id,
|
form_field: item.id,
|
||||||
field_value: that.checkForm[item.field_key],
|
field_value: that.checkForm[item.field_key],
|
||||||
is_testok: item.is_testok//单项检查结果
|
is_testok: item.is_testok,//单项检查结果
|
||||||
|
is_hidden: item.is_hidden
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
that.testrecord.form = that.formID;//检查表
|
if(that.origin_test!==null){
|
||||||
|
that.testrecord.origin_test = that.origin_test;
|
||||||
|
}
|
||||||
that.testrecord.record_data = that.field;//检查项列表
|
that.testrecord.record_data = that.field;//检查项列表
|
||||||
that.testrecord.is_testok = that.is_testok;//检查表检查结果
|
that.testrecord.is_testok = that.is_testok;//检查表检查结果
|
||||||
|
that.testrecord.form = that.formID;//检查表
|
||||||
that.testrecord.wproduct = that.wproductId;//半成品ID
|
that.testrecord.wproduct = that.wproductId;//半成品ID
|
||||||
this.$emit('formFunc',that.testrecord);
|
that.testrecord.is_submited = submit;//提交状态false保存
|
||||||
|
this.$emit('formFunc',that.testrecord);//第一次保存或提交
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,13 @@ export const asyncRoutes = [
|
||||||
meta: { title: '甘特图', perms: ['vendor_manage'] },
|
meta: { title: '甘特图', perms: ['vendor_manage'] },
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'gantt1',
|
||||||
|
name: 'gantt1',
|
||||||
|
component: () => import('@/views/pm/gantt1'),
|
||||||
|
meta: { title: '甘特图', perms: ['vendor_manage'] },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
|
||||||
|
|
@ -19,36 +19,13 @@
|
||||||
@expand-change="handlerExpand"
|
@expand-change="handlerExpand"
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column label="名称">
|
||||||
v-for="col in columns"
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
:prop="col.prop"
|
</el-table-column>
|
||||||
:key="col.prop"
|
<el-table-column label="进度">
|
||||||
:label="col.label"
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
:align="col.align"
|
|
||||||
:resizable="col.resizable"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="col.prop == 'type'">{{
|
|
||||||
projectType[scope.row.type]
|
|
||||||
}}</span>
|
|
||||||
<span v-else>{{ scope.row[col.prop] }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-collapse-transition>
|
|
||||||
</el-collapse-transition>
|
|
||||||
<transition name="el-zoom-in-top">
|
|
||||||
<div class="menulist" v-show="menuOpen" ref="menulist">
|
|
||||||
<div
|
|
||||||
class="item"
|
|
||||||
v-for="(item, index) in menuLists"
|
|
||||||
@click="handleMenuClick(index, item)"
|
|
||||||
:key="item + index"
|
|
||||||
>
|
|
||||||
{{ item }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -83,70 +60,6 @@ export default {
|
||||||
checkList: [],
|
checkList: [],
|
||||||
isShowHeaderBox: false,
|
isShowHeaderBox: false,
|
||||||
menuOpen: false,
|
menuOpen: false,
|
||||||
headerList: {
|
|
||||||
name: true,
|
|
||||||
ower: true,
|
|
||||||
per: true,
|
|
||||||
type: true
|
|
||||||
},
|
|
||||||
projectType: {
|
|
||||||
1: "计划项目",
|
|
||||||
2: "里程碑",
|
|
||||||
3: "分组"
|
|
||||||
},
|
|
||||||
menuLists: ["编辑", "里程碑", "分组", "删除"],
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
prop: "name",
|
|
||||||
label: "名称",
|
|
||||||
width: "200px",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "ower",
|
|
||||||
label: "负责人",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "per",
|
|
||||||
label: "进度",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "type",
|
|
||||||
label: "项目类型",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
columnsCopy: [
|
|
||||||
{
|
|
||||||
prop: "name",
|
|
||||||
label: "名称",
|
|
||||||
width: "200px",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "ower",
|
|
||||||
label: "负责人",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "per",
|
|
||||||
label: "进度",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "type",
|
|
||||||
label: "项目类型",
|
|
||||||
align: "center",
|
|
||||||
resizable: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
//当前点击的row
|
//当前点击的row
|
||||||
currentRow: {}
|
currentRow: {}
|
||||||
};
|
};
|
||||||
|
|
@ -166,123 +79,14 @@ export default {
|
||||||
// console.log(row, expanded);
|
// console.log(row, expanded);
|
||||||
this.$emit("handlerExpand", row, expand);
|
this.$emit("handlerExpand", row, expand);
|
||||||
},
|
},
|
||||||
handlerSave() {
|
|
||||||
this.isShowHeaderBox = false;
|
|
||||||
let arr = [];
|
|
||||||
this.columnsCopy.forEach(item => {
|
|
||||||
if (this.headerList[item.prop] == true) {
|
|
||||||
arr.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.columns = arr;
|
|
||||||
},
|
|
||||||
maskClick() {
|
maskClick() {
|
||||||
this.isShowHeaderBox = false;
|
this.isShowHeaderBox = false;
|
||||||
this.menuOpen = false;
|
this.menuOpen = false;
|
||||||
this.currentRow = {};
|
this.currentRow = {};
|
||||||
},
|
},
|
||||||
handlerRowClick(row, column) {
|
handlerRowClick(row) {
|
||||||
// console.log(column);
|
|
||||||
if (row.type != 3) {
|
|
||||||
this.$emit("handlerRowClick", row);
|
this.$emit("handlerRowClick", row);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleRowMore(row, e) {
|
|
||||||
this.menuLists = ["编辑", "里程碑", "分组", "删除"];
|
|
||||||
if (row.parentId) {
|
|
||||||
this.menuLists = ["编辑", "里程碑", "删除"];
|
|
||||||
}
|
|
||||||
if (row.type == "1") {
|
|
||||||
this.menuLists[1] = "里程碑";
|
|
||||||
} else if (row.type == "2") {
|
|
||||||
this.menuLists[1] = "计划项目";
|
|
||||||
} else if (row.type == "3") {
|
|
||||||
this.menuLists = ["编辑", "添加任务", "删除分组"];
|
|
||||||
}
|
|
||||||
this.menuOpen = true;
|
|
||||||
this.currentRow = row;
|
|
||||||
let s = this.$refs.menulist.style;
|
|
||||||
s.top = e.y - 10 - 40 + "px";
|
|
||||||
s.left = e.x + 20 + "px";
|
|
||||||
},
|
|
||||||
handleShowHeaderCheckBox() {
|
|
||||||
this.isShowHeaderBox = !this.isShowHeaderBox;
|
|
||||||
},
|
|
||||||
handleMenuClick(index, name) {
|
|
||||||
this.menuOpen = false;
|
|
||||||
if (index == 3) {
|
|
||||||
this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$emit("handlerDel", this.currentRow);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else if (index == 1) {
|
|
||||||
if (this.currentRow.type == 3) {
|
|
||||||
console.log("添加任务");
|
|
||||||
this.$emit("handleGroupAdd", this.currentRow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$confirm(`确定转为${this.menuLists[1]}?`, "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "info",
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
if (this.currentRow.type == "1") {
|
|
||||||
this.$emit("milestone", this.currentRow);
|
|
||||||
} else if (this.currentRow.type == "2") {
|
|
||||||
this.$emit("planProject", this.currentRow);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else if (index == 0) {
|
|
||||||
this.$emit("handlerEdit", this.currentRow);
|
|
||||||
} else if (index == 2) {
|
|
||||||
console.log(name);
|
|
||||||
if (this.currentRow.type == 3 && name == "删除分组") {
|
|
||||||
this.$confirm("此操作将永久删除该分组及其子项目, 是否继续?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$emit("handlerDel", this.currentRow);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (name == "删除") {
|
|
||||||
this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$emit("handlerDel", this.currentRow);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$confirm(`确定转为分组?`, "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "info",
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$emit("handlerGroup", this.currentRow);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.handlerWatchScroll();
|
this.handlerWatchScroll();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="slider" ref="slider" :style="{ width: '100%' }">
|
<div
|
||||||
<div class="process" :style="{ width }" style="font-size: 12px;color: #ffffff;text-align: right">
|
class="slider"
|
||||||
|
ref="slider"
|
||||||
|
:style="{ width: '100%', display: inline-block}"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="process"
|
||||||
|
:style="{ width }"
|
||||||
|
style="font-size: 12px;color: #ffffff;text-align: right"
|
||||||
|
>
|
||||||
{{ per }}
|
{{ per }}
|
||||||
</div>
|
</div>
|
||||||
<div class="process1" :style="{width:process1Width}" style="font-size: 12px;color: #ffffff;text-align: right"> {{ per1 }}</div>
|
<div class="process1"
|
||||||
|
:style="{width:process1Width}"
|
||||||
|
style="font-size: 12px;color: #ffffff;text-align: right"
|
||||||
|
>
|
||||||
|
{{ per1 }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -92,21 +105,13 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.box {
|
|
||||||
margin: 100px auto 0;
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
.clear:after {
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
.slider {
|
.slider {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
background: #e4e7ed;
|
background: #e4e7ed;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: move;
|
cursor: text;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
.slider .process {
|
.slider .process {
|
||||||
|
|
@ -127,16 +132,8 @@ export default {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: #11c750;
|
background: #11c750;
|
||||||
}
|
}
|
||||||
.slider .thunk {
|
|
||||||
position: absolute;
|
|
||||||
left: 100px;
|
|
||||||
top: -7px;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
.slider .block {
|
|
||||||
transition: 0.2s all;
|
|
||||||
}
|
|
||||||
.slider .block i {
|
.slider .block i {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -144,20 +141,7 @@ export default {
|
||||||
top: 15px;
|
top: 15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.slider .tips {
|
|
||||||
position: absolute;
|
|
||||||
left: -3px;
|
|
||||||
bottom: 0px;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 24px;
|
|
||||||
min-width: 15px;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1px 5px;
|
|
||||||
background: #000;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 24px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.slider .tips i {
|
.slider .tips i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: -5px;
|
margin-left: -5px;
|
||||||
|
|
@ -166,8 +150,5 @@ export default {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.slider .block:hover {
|
|
||||||
transform: scale(1.1);
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -33,10 +33,15 @@
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
v-if="checkPermission(['warehouse_update'])"
|
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
|
||||||
@click="handleInspection(scope)"
|
@click="handleInspection(scope,'1')"
|
||||||
>检验
|
>检验
|
||||||
</el-link>
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.test!==null"
|
||||||
|
@click="checkRecord(scope)"
|
||||||
|
>检验记录
|
||||||
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -80,7 +85,7 @@
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link
|
<el-link
|
||||||
v-if="checkPermission(['warehouse_update'])"
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
@click="handleReview(scope)"
|
@click="handleInspection(scope,'2')"
|
||||||
>
|
>
|
||||||
检验
|
检验
|
||||||
</el-link>
|
</el-link>
|
||||||
|
|
@ -203,7 +208,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
<!--物料检查表&&-->
|
||||||
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
|
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
|
||||||
<el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange">
|
<el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -214,6 +219,7 @@
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<!--第一次操作时的展示-->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
width="60%"
|
width="60%"
|
||||||
:title="formName"
|
:title="formName"
|
||||||
|
|
@ -225,6 +231,25 @@
|
||||||
:hasPicture="hasPicture"
|
:hasPicture="hasPicture"
|
||||||
:formID="recordform"
|
:formID="recordform"
|
||||||
:wproduct="wproduct"
|
:wproduct="wproduct"
|
||||||
|
:origin_test="origin_test"
|
||||||
|
@formFunc="formFunc"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
|
<!--复检检验表单-->
|
||||||
|
<el-dialog
|
||||||
|
width="60%"
|
||||||
|
:title="formName"
|
||||||
|
:visible.sync="limitedReview"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<reviewForm
|
||||||
|
:results="fieldList"
|
||||||
|
:originList="originList"
|
||||||
|
:formID="recordform"
|
||||||
|
:hasPicture="hasPicture"
|
||||||
|
:recordItem="recordItem"
|
||||||
|
:wproduct="wproduct"
|
||||||
|
:origintest="origintest"
|
||||||
@formFunc="formFunc"
|
@formFunc="formFunc"
|
||||||
/>
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -232,24 +257,29 @@
|
||||||
<el-button @click="outerVisible = false">
|
<el-button @click="outerVisible = false">
|
||||||
取 消
|
取 消
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="submitrecordform">填写检查项目</el-button>
|
<el-button type="primary" @click="submitrecordform(innerIndex)">填写检查项目</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!--保存过的检查表显示-->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
width="60%"
|
width="60%"
|
||||||
:title="formName"
|
:title="formName"
|
||||||
:visible.sync="limitedReview"
|
:visible.sync="recordVisible"
|
||||||
>
|
>
|
||||||
<reviewForm
|
<customForm
|
||||||
|
v-if="recordVisible"
|
||||||
:results="fieldList"
|
:results="fieldList"
|
||||||
:originList="originList"
|
|
||||||
:formID="recordform"
|
|
||||||
:hasPicture="hasPicture"
|
:hasPicture="hasPicture"
|
||||||
|
:formID="recordform"
|
||||||
:wproduct="wproduct"
|
:wproduct="wproduct"
|
||||||
:origintest="origintest"
|
:recordId="recordId"
|
||||||
@formFunc="formFunc"
|
:recordItem="recordItem"
|
||||||
|
@recordSubmit="recordSubmit"
|
||||||
|
@recordSave="recordSave"
|
||||||
/>
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--半成品入库-->
|
||||||
<el-dialog title="半成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible">
|
<el-dialog title="半成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible">
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
<el-form-item label="仓库" :label-width="formLabelWidth">
|
<el-form-item label="仓库" :label-width="formLabelWidth">
|
||||||
|
|
@ -277,6 +307,53 @@
|
||||||
<el-button type="primary" @click="putin">确 定</el-button>
|
<el-button type="primary" @click="putin">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!--检验记录-->
|
||||||
|
<el-dialog title="检验记录" :close-on-click-modal="false" :visible.sync="limitedCheckRecord">
|
||||||
|
<el-table
|
||||||
|
:data="recordList"
|
||||||
|
border
|
||||||
|
height="400"
|
||||||
|
@close="pageRefresh"
|
||||||
|
@closed="pageRefresh"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<el-table-column label="表单名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.form_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检查类型">
|
||||||
|
<template slot-scope="scope">{{ checkTypes[scope.row.type] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否提交">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.is_submited">已提交</span>
|
||||||
|
<span v-else>未提交</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="!scope.row.is_submited"
|
||||||
|
@click="handleInspectionRecord(scope)"
|
||||||
|
>检验
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
@click="handleRecordDetail(scope)"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
@click="delTestRecord(scope)"
|
||||||
|
>删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="putin">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--半成品批量入库-->
|
||||||
<el-dialog title="半成品批量入库" :close-on-click-modal="false" :visible.sync="dialogFormVisibles">
|
<el-dialog title="半成品批量入库" :close-on-click-modal="false" :visible.sync="dialogFormVisibles">
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
<el-form-item label="仓库" :label-width="formLabelWidth">
|
<el-form-item label="仓库" :label-width="formLabelWidth">
|
||||||
|
|
@ -313,10 +390,12 @@
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import {getWarehouseList} from "@/api/inm";
|
import {getWarehouseList} from "@/api/inm";
|
||||||
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
||||||
|
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
|
||||||
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 defaultetestitem = {};
|
const defaultetestitem = {};
|
||||||
export default {
|
export default {
|
||||||
|
inject:['reload'],
|
||||||
components: {Pagination, customForm,reviewForm},
|
components: {Pagination, customForm,reviewForm},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -362,6 +441,13 @@
|
||||||
60: "待成品检验",
|
60: "待成品检验",
|
||||||
26:"待夹层检验",
|
26:"待夹层检验",
|
||||||
},
|
},
|
||||||
|
checkTypes:{
|
||||||
|
10:"子工序检验",
|
||||||
|
20:"工序检验",
|
||||||
|
30:"工序复检",
|
||||||
|
36:"夹层检验",
|
||||||
|
40:"成品检验",
|
||||||
|
},
|
||||||
choice: [
|
choice: [
|
||||||
{
|
{
|
||||||
value: true,
|
value: true,
|
||||||
|
|
@ -372,6 +458,7 @@
|
||||||
label: "不合格",
|
label: "不合格",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
recordList: [],
|
||||||
options: [],
|
options: [],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
fieldList: [],
|
fieldList: [],
|
||||||
|
|
@ -380,19 +467,26 @@
|
||||||
field: [],
|
field: [],
|
||||||
recordformList: [],
|
recordformList: [],
|
||||||
recordform: null,
|
recordform: null,
|
||||||
|
recordId: null,
|
||||||
fifo_detail: "",
|
fifo_detail: "",
|
||||||
listQueryrecordform: {
|
listQueryrecordform: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
|
recordVisible:false,
|
||||||
|
innerIndex:null,
|
||||||
origintest:null,
|
origintest:null,
|
||||||
mutipID: [],
|
mutipID: [],
|
||||||
wproduct: null,
|
wproduct: null,
|
||||||
|
isPost: false,
|
||||||
|
origin_test: null,
|
||||||
hasPicture: false,
|
hasPicture: false,
|
||||||
|
recordItem: false,
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
innerVisible: false,
|
innerVisible: false,
|
||||||
limitedReview: false,
|
limitedReview: false,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogFormVisibles: false,
|
dialogFormVisibles: false,
|
||||||
|
limitedCheckRecord: false,
|
||||||
testrecord: {},
|
testrecord: {},
|
||||||
WarehouseData: "",
|
WarehouseData: "",
|
||||||
formName: '项目检查表',
|
formName: '项目检查表',
|
||||||
|
|
@ -422,18 +516,15 @@
|
||||||
},
|
},
|
||||||
//复检半成品列表
|
//复检半成品列表
|
||||||
getList2() {
|
getList2() {
|
||||||
|
|
||||||
this.listQuery2.act_state = 6;
|
this.listQuery2.act_state = 6;
|
||||||
getwproductList(this.listQuery2).then((response) => {
|
getwproductList(this.listQuery2).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.wproductList2 = response.data;
|
this.wproductList2 = response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//已合格半成品
|
//已合格半成品
|
||||||
getList1() {
|
getList1() {
|
||||||
|
|
||||||
this.listQuery1.act_state = 30;
|
this.listQuery1.act_state = 30;
|
||||||
this.listQuery1.material__type = 2;
|
this.listQuery1.material__type = 2;
|
||||||
getwproductList(this.listQuery1).then((response) => {
|
getwproductList(this.listQuery1).then((response) => {
|
||||||
|
|
@ -445,7 +536,6 @@
|
||||||
},
|
},
|
||||||
//夹层半成品列表
|
//夹层半成品列表
|
||||||
getList3() {
|
getList3() {
|
||||||
|
|
||||||
this.listQuery3.act_state = 26;
|
this.listQuery3.act_state = 26;
|
||||||
getwproductList(this.listQuery3).then((response) => {
|
getwproductList(this.listQuery3).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
|
@ -491,56 +581,48 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleInspection(scope) {
|
//点击检验:如果有一个直接进入,如果有多个表再进行选择
|
||||||
|
handleInspection(scope,index) {
|
||||||
//调该物料对应的检查表
|
//调该物料对应的检查表
|
||||||
// this.step = step;
|
let that = this;
|
||||||
|
this.innerIndex = index;
|
||||||
this.outerVisible = true;
|
this.outerVisible = true;
|
||||||
this.wproduct = scope.row.id;//半成品ID
|
this.wproduct = scope.row.id;//半成品ID
|
||||||
this.wproductactstate = scope.row.act_state;//半成品状态
|
this.wproductactstate = scope.row.act_state;//半成品状态
|
||||||
this.listQueryrecordform.material = scope.row.material;//
|
this.listQueryrecordform.material = scope.row.material;//
|
||||||
this.listQueryrecordform.type = 2;
|
this.listQueryrecordform.type = 2;
|
||||||
this.recordform = "";
|
this.recordform = null;
|
||||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.recordformList = response.data;
|
this.recordformList = response.data;
|
||||||
|
if(response.data.length===1){
|
||||||
|
that.recordform = response.data[0].id;
|
||||||
|
that.formName = response.data[0].name;
|
||||||
|
that.submitrecordform(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//半产品复检
|
//检验记录
|
||||||
handleReview(scope) {
|
checkRecord(scope){
|
||||||
let that = this;
|
let that = this;
|
||||||
this.wproduct = scope.row.id;//半成品ID
|
that.wproduct = scope.row.id;//半成品ID
|
||||||
wproductReview({ wproduct: this.wproduct}).then((response) => {
|
that.limitedCheckRecord = true;
|
||||||
if (response.data) {
|
getTestRecord({wproduct:scope.row.id}).then(res=>{
|
||||||
that.hasPicture = false;
|
if(res.code==200){
|
||||||
that.formName = response.data.name;
|
debugger;
|
||||||
let fieldList = response.data.form_fields;
|
that.recordList = res.data.results;
|
||||||
that.fieldList = [...fieldList];
|
}else{
|
||||||
that.origintest = response.data.origin_test.id;
|
this.$message.error(res.msg);
|
||||||
that.recordform = response.data.origin_test.form;
|
|
||||||
let originList = response.data.origin_test.record_data_;
|
|
||||||
that.originList = [...originList];
|
|
||||||
let arr = fieldList.filter(item => {
|
|
||||||
return item.field_type === 'draw'
|
|
||||||
});
|
|
||||||
if (arr.length > 0) {
|
|
||||||
that.hasPicture = true;
|
|
||||||
}
|
}
|
||||||
this.limitedReview = true;
|
})
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
recordformChange() {
|
//点击记录里的检验
|
||||||
let that = this;
|
handleInspectionRecord(scope){
|
||||||
let arr = this.recordformList.filter(item => {
|
let that =this;
|
||||||
return item.id === that.recordform;
|
that.recordVisible = false;
|
||||||
});
|
that.recordId = scope.row.id;
|
||||||
that.formName = arr[0].name;
|
that.recordform = scope.row.form;
|
||||||
},
|
|
||||||
//根据选择的表,渲染检查项目
|
|
||||||
submitrecordform() {
|
|
||||||
let that = this;
|
|
||||||
if (that.recordform != "") {
|
|
||||||
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
|
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
that.hasPicture = false;
|
that.hasPicture = false;
|
||||||
|
|
@ -552,39 +634,105 @@
|
||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
that.hasPicture = true;
|
that.hasPicture = true;
|
||||||
}
|
}
|
||||||
|
getTestRecordItem(scope.row.id).then((res) => {
|
||||||
|
debugger;
|
||||||
|
let arr = [];
|
||||||
|
let fieldList = res.data.record_data;
|
||||||
|
for(let i=0;i<that.fieldList.length;i++){
|
||||||
|
let obj = that.fieldList[i];
|
||||||
|
obj.is_testok = null;
|
||||||
|
for(let j=0;j<fieldList.length;j++){
|
||||||
|
if(that.fieldList[i].field_key===fieldList[j].field_key){
|
||||||
|
obj.id = fieldList[j].id;
|
||||||
|
obj.is_testok = fieldList[j].is_testok;
|
||||||
|
obj.field_value = fieldList[j].field_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arr.push(obj)
|
||||||
|
}
|
||||||
|
that.fieldList = arr;
|
||||||
|
that.recordItem = true;
|
||||||
|
that.$nextTick(()=>{
|
||||||
|
that.recordVisible = true;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
//点击记录里的查看
|
||||||
|
handleRecordDetail(scope){
|
||||||
|
|
||||||
|
},
|
||||||
|
//半产品复检
|
||||||
|
handleReview() {
|
||||||
|
let that = this;
|
||||||
|
wproductReview({ wproduct: this.wproduct,form: that.recordform}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
that.hasPicture = false;
|
||||||
|
that.formName = response.data.name;
|
||||||
|
let fieldList = response.data.form_fields;
|
||||||
|
that.fieldList = [...fieldList];
|
||||||
|
that.origintest = response.data.origin_test;
|
||||||
|
that.recordform = response.data.origin_test_.form;
|
||||||
|
let originList = response.data.origin_test_.record_data;
|
||||||
|
that.originList = [...originList];
|
||||||
|
let arr = fieldList.filter(item => {
|
||||||
|
return item.field_type === 'draw'
|
||||||
|
});
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.hasPicture = true;
|
||||||
|
}
|
||||||
|
this.limitedReview = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//选择物料检查表
|
||||||
|
recordformChange() {
|
||||||
|
let that = this;
|
||||||
|
let arr = this.recordformList.filter(item => {
|
||||||
|
return item.id === that.recordform;
|
||||||
|
});
|
||||||
|
that.formName = arr[0].name;
|
||||||
|
},
|
||||||
|
//根据选择的表,渲染检查项目
|
||||||
|
submitrecordform(index) {
|
||||||
|
let that = this;
|
||||||
|
if (that.recordform != "") {
|
||||||
|
if(index==='1'){
|
||||||
|
wproductReview({ wproduct: that.wproduct,form: that.recordform}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
debugger;
|
||||||
|
that.hasPicture = false;
|
||||||
|
that.origin_test = response.data.origin_test;
|
||||||
|
that.formName = response.data.name;
|
||||||
|
/* let fieldList = response.data.form_fields;
|
||||||
|
that.fieldList = [...fieldList];*/
|
||||||
|
let list = [];
|
||||||
|
let fieldList = response.data.form_fields;
|
||||||
|
for(let i=0;i<fieldList.length;i++){
|
||||||
|
let obj = fieldList[i];
|
||||||
|
obj.is_testok = true;
|
||||||
|
obj.field_value = null;
|
||||||
|
list.push(obj)
|
||||||
|
}
|
||||||
|
that.fieldList = list;
|
||||||
|
let arr = fieldList.filter(item => {
|
||||||
|
return item.field_type === 'draw'
|
||||||
|
});
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.hasPicture = true;
|
||||||
|
}
|
||||||
|
that.recordItem =false;
|
||||||
that.innerVisible = true;
|
that.innerVisible = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else if(index==='2'){
|
||||||
|
that.handleReview();
|
||||||
|
}
|
||||||
} else this.$message.error("请选择检查表!");
|
} 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,
|
|
||||||
is_testok: item.is_testok//单项检查结果
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.testrecord.form = this.recordform;//检查表
|
|
||||||
this.testrecord.record_data = _this.field;//检查项列表
|
|
||||||
this.testrecord.is_testok = this.is_testok;//检查表检查结果
|
|
||||||
this.testrecord.wproduct = this.wproduct;//半成品ID
|
|
||||||
wproductTest(this.testrecord).then((res) => {
|
|
||||||
if (res.code >= 200) {
|
|
||||||
this.innerVisible = false;
|
|
||||||
this.outerVisible = false;
|
|
||||||
this.getList();
|
|
||||||
this.getList1();
|
|
||||||
this.getList2();
|
|
||||||
this.getList3();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},*/
|
|
||||||
//半成品入库
|
//半成品入库
|
||||||
handlePutin(scope) {
|
handlePutin(scope) {
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = true;
|
||||||
|
|
@ -600,17 +748,101 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//提交检查项目
|
delTestRecord(scope){
|
||||||
formFunc(value) {
|
let that = this;
|
||||||
wproductTest(value).then((res) => {
|
this.$confirm("确认删除?", "警告", {
|
||||||
if (res.code >= 200) {
|
confirmButtonText: "确认",
|
||||||
this.innerVisible = false;
|
cancelButtonText: "取消",
|
||||||
this.outerVisible = false;
|
type: "error",
|
||||||
this.getList();
|
})
|
||||||
this.getList1();
|
.then(async () => {
|
||||||
this.getList2();
|
await delTestRecordItem(scope.row.id).then(res=>{
|
||||||
|
if(res.code>=200){
|
||||||
|
that.$message.success("成功");
|
||||||
|
that.refreshRecord();
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//更新检验记录列表
|
||||||
|
refreshRecord(){
|
||||||
|
let that = this;
|
||||||
|
getTestRecord({wproduct:that.wproduct}).then(res=>{
|
||||||
|
if(res.code==200){
|
||||||
|
that.recordList = res.data.results;
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//记录保存检查项目
|
||||||
|
recordSave(value) {
|
||||||
|
let that = this;
|
||||||
|
let id = value.id;
|
||||||
|
let params = {};
|
||||||
|
params.record_data = value.record_data;
|
||||||
|
params.is_testok = value.is_testok;
|
||||||
|
putTestRecordItem(id,params).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.recordVisible = false;
|
||||||
|
that.reload();
|
||||||
|
that.refreshRecord();
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
}) .catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//记录提交检查项目
|
||||||
|
recordSubmit(value) {
|
||||||
|
let that = this;
|
||||||
|
let id = value.id;
|
||||||
|
let params = {};
|
||||||
|
params.record_data = value.record_data;
|
||||||
|
params.is_testok = value.is_testok;
|
||||||
|
putTestRecordItem(id,params).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
subTestRecordItem(id,params).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.recordVisible = false;
|
||||||
|
that.reload();
|
||||||
|
that.refreshRecord();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
}) .catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//第一次保存提交检查项目
|
||||||
|
formFunc(value) {
|
||||||
|
let that = this;
|
||||||
|
if(that.isPost){
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
that.isPost = true;
|
||||||
|
wproductTest(value).then((res) => {
|
||||||
|
that.isPost = false;
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.innerVisible = false;
|
||||||
|
that.outerVisible = false;
|
||||||
|
that.reload()
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
this.isPost = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pageRefresh(){
|
||||||
|
this.reload()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,6 @@
|
||||||
.box-card {
|
.box-card {
|
||||||
height: 300px;
|
height: 300px;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
|
|
@ -780,7 +779,7 @@ export default {
|
||||||
recordconfirm() {
|
recordconfirm() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
_this.record_data = []; //检查项目
|
_this.record_data = []; //检查项目
|
||||||
this.fieldList.forEach((item) => {
|
this.fieldList.form_fields.forEach((item) => {
|
||||||
_this.record_data.push({
|
_this.record_data.push({
|
||||||
form_field: item.id,
|
form_field: item.id,
|
||||||
field_value: item.sort,
|
field_value: item.sort,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue