test&gantt

This commit is contained in:
shijing 2021-12-15 23:07:12 +08:00
parent 2b4bc1025b
commit f34ecf8395
10 changed files with 740 additions and 1292 deletions

View File

@ -57,4 +57,41 @@ export function deleteTestitem(id, 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
})
}

9
hb_client/src/api/srm.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
//生产进度表
export function getPlanGantt(data) {
return request({
url: '/srm/gantt/plan/',
method: 'get',
params: data
})
}

View File

@ -181,8 +181,8 @@ export function getrecordList(query) {
//操作提交自定义表
export function createRecord(id, data) {
return request({
url: `/wpm/operation_record/${id}/submit/`,
method: 'post',
url: `/wpm/operation_record/${id}/`,
method: 'put',
data
})
}

View File

@ -9,7 +9,7 @@
<el-row>
<el-col
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"
:span="12"
style="position: relative"
@ -123,7 +123,8 @@
<el-row v-show="hasPicture">
<el-form-item label="图表">
<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;
border: 1px solid #DCDFE6;">
<canvas id="canvas" width="500" height="300">
@ -155,7 +156,8 @@
</el-form-item>
<div class="dialog-footer" style="text-align: right">
<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>
</el-row>
@ -182,29 +184,49 @@
type:Number,
default:0
},
recordId: {
type:Number,
default:null
},
origin_test: {
type:Number,
default:null
},
hasPicture:{
type:Boolean,
default:false
},
recordItem:{
type:Boolean,
default:false
}
},
mounted() {
debugger;
let that = this;
that.checkForm = {};
this.form = this.formID;
let formData=this.results;
that.wproductId=this.wproduct;
formData.forEach(item => {
let obj = new Object();
obj = item;
obj.is_testok = null;//是否合格
that.formData.push(obj)
});
that.formData=[...that.formData];
that.formData=[...formData];
debugger;
for(let i=0;i<this.results.length;i++){
let key = this.results[i].field_key;
//checkForm接收表单数据的对象
that.checkForm[key]='';
that.$set(that.checkForm,key,'')
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.$set(that.checkForm,key,null)
}
}
let listJudge = this.formData.filter(item => {
return item.need_judge === true;
@ -217,9 +239,9 @@
let imag= this.formData.filter(item => {
return item.field_type === 'draw';
});
that.img = new Image();
/* that.img = new Image();
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(){
that.canvasInit();
},500);
@ -252,11 +274,12 @@
judgeList:[],//判定数组
is_testok:true,
testokTrue:true,
is_save:false,
testokFalse:false,
}
},
methods:{
filterBlock(parent,rule){
filterBlock(parent,rule,index,field_key){
// debugger;
let that = this;
if(parent!==''&&parent!==null&&parent!==undefined){
@ -305,6 +328,12 @@
rea = true;
}
}
if(rea){
that.formData[index].is_hidden = false;
}else{
that.formData[index].is_hidden = true;
that.checkForm[field_key] = null;
}
return rea;
}else{
let temp =rule.match(reg)[0];
@ -312,13 +341,21 @@
let a = rule.replace(key, 'yy');
a = a.replace(key, 'yy');
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("'"+y+"'"+str);
}
}else{
that.formData[index].is_hidden = true;
that.checkForm[field_key] = null;
return false;
}
}else{
that.formData[index].is_hidden = false;
return true;
}
},
@ -638,7 +675,7 @@
}
},
//提交检查项目
submitfield() {
submitfield(isSubmit) {
let that = this;
let drawArr = that.formData.filter(item=>{
return item.field_type==='draw';
@ -657,29 +694,58 @@
if(res){
let key = drawArr[0].field_key;
that.imgUrl=res.data.file;
that.checkForm[key] = that.imgUrl;
that.fieldData();
that.checkForm[key] = res.data.file;
that.fieldData(isSubmit);
}
});
}else{
that.fieldData();
that.fieldData(isSubmit);
}
},
fieldData(){
fieldData(isSubmit){
let that = this;
that.field = []; //检查项目
that.formData.forEach((item) => {
that.field.push({
form_field: item.id,
field_value: that.checkForm[item.field_key],
is_testok: item.is_testok//单项检查结果
let submit = isSubmit=='1'?false:true;
if(that.recordItem){//有记录
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.form = that.formID;//检查表
that.testrecord.record_data = that.field;//检查项列表
that.testrecord.is_testok = that.is_testok;//检查表检查结果
that.testrecord.wproduct = that.wproductId;//半成品ID
this.$emit('formFunc',that.testrecord);
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({
form_field: item.id,
field_value: that.checkForm[item.field_key],
is_testok: item.is_testok,//单项检查结果
is_hidden: item.is_hidden
});
}
});
if(that.origin_test!==null){
that.testrecord.origin_test = that.origin_test;
}
that.testrecord.record_data = that.field;//检查项列表
that.testrecord.is_testok = that.is_testok;//检查表检查结果
that.testrecord.form = that.formID;//检查表
that.testrecord.wproduct = that.wproductId;//半成品ID
that.testrecord.is_submited = submit;//提交状态false保存
this.$emit('formFunc',that.testrecord);//第一次保存或提交
}
},
}
}

View File

@ -186,6 +186,13 @@ export const asyncRoutes = [
meta: { title: '甘特图', perms: ['vendor_manage'] },
hidden: true
},
{
path: 'gantt1',
name: 'gantt1',
component: () => import('@/views/pm/gantt1'),
meta: { title: '甘特图', perms: ['vendor_manage'] },
hidden: true
},
]
}
,

View File

@ -19,36 +19,13 @@
@expand-change="handlerExpand"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
v-for="col in columns"
:prop="col.prop"
:key="col.prop"
:label="col.label"
: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 label="名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="进度">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
</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>
</template>
@ -83,70 +60,6 @@ export default {
checkList: [],
isShowHeaderBox: 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
currentRow: {}
};
@ -166,123 +79,14 @@ export default {
// console.log(row, expanded);
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() {
this.isShowHeaderBox = false;
this.menuOpen = false;
this.currentRow = {};
},
handlerRowClick(row, column) {
// console.log(column);
if (row.type != 3) {
this.$emit("handlerRowClick", row);
}
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() {
this.handlerWatchScroll();

View File

@ -1,9 +1,22 @@
<template>
<div class="slider" ref="slider" :style="{ width: '100%' }">
<div class="process" :style="{ width }" style="font-size: 12px;color: #ffffff;text-align: right">
<div
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 }}
</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>
</template>
<script>
@ -92,21 +105,13 @@ export default {
};
</script>
<style>
.box {
margin: 100px auto 0;
width: 80%;
}
.clear:after {
content: "";
display: block;
clear: both;
}
.slider {
position: relative;
height: 20px;
background: #e4e7ed;
border-radius: 3px;
cursor: move;
cursor: text;
user-select: none;
}
.slider .process {
@ -127,16 +132,8 @@ export default {
border-radius: 3px;
background: #11c750;
}
.slider .thunk {
position: absolute;
left: 100px;
top: -7px;
width: 20px;
height: 20px;
}
.slider .block {
transition: 0.2s all;
}
.slider .block i {
font-size: 25px;
position: relative;
@ -144,20 +141,7 @@ export default {
top: 15px;
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 {
position: absolute;
margin-left: -5px;
@ -166,8 +150,5 @@ export default {
font-size: 16px;
color: #000;
}
.slider .block:hover {
transform: scale(1.1);
opacity: 0.6;
}
</style>
</style>

File diff suppressed because it is too large Load Diff

View File

@ -33,10 +33,15 @@
<el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleInspection(scope)"
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
@click="handleInspection(scope,'1')"
>检验
</el-link>
<el-link
v-if="scope.row.test!==null"
@click="checkRecord(scope)"
>检验记录
</el-link>
</template>
</el-table-column>
</el-table>
@ -80,7 +85,7 @@
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleReview(scope)"
@click="handleInspection(scope,'2')"
>
检验
</el-link>
@ -203,7 +208,7 @@
</el-card>
</el-tab-pane>
</el-tabs>
<!--物料检查表&&-->
<el-dialog title="物料检查表" :close-on-click-modal="false" :visible.sync="outerVisible">
<el-select style="width: 100%" v-model="recordform" placeholder="请选择" @change="recordformChange">
<el-option
@ -214,6 +219,7 @@
>
</el-option>
</el-select>
<!--第一次操作时的展示-->
<el-dialog
width="60%"
:title="formName"
@ -225,6 +231,25 @@
:hasPicture="hasPicture"
:formID="recordform"
: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"
/>
</el-dialog>
@ -232,24 +257,29 @@
<el-button @click="outerVisible = false">
</el-button>
<el-button type="primary" @click="submitrecordform">填写检查项目</el-button>
<el-button type="primary" @click="submitrecordform(innerIndex)">填写检查项目</el-button>
</div>
</el-dialog>
<!--保存过的检查表显示-->
<el-dialog
width="60%"
:title="formName"
:visible.sync="limitedReview"
:visible.sync="recordVisible"
>
<reviewForm
<customForm
v-if="recordVisible"
:results="fieldList"
:originList="originList"
:formID="recordform"
:hasPicture="hasPicture"
:formID="recordform"
:wproduct="wproduct"
:origintest="origintest"
@formFunc="formFunc"
:recordId="recordId"
:recordItem="recordItem"
@recordSubmit="recordSubmit"
@recordSave="recordSave"
/>
</el-dialog>
<!--半成品入库-->
<el-dialog title="半成品入库" :close-on-click-modal="false" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="仓库" :label-width="formLabelWidth">
@ -277,6 +307,53 @@
<el-button type="primary" @click="putin"> </el-button>
</div>
</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-form :model="form">
<el-form-item label="仓库" :label-width="formLabelWidth">
@ -313,10 +390,12 @@
import checkPermission from "@/utils/permission";
import {getWarehouseList} from "@/api/inm";
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultetestitem = {};
export default {
inject:['reload'],
components: {Pagination, customForm,reviewForm},
data() {
return {
@ -362,6 +441,13 @@
60: "待成品检验",
26:"待夹层检验",
},
checkTypes:{
10:"子工序检验",
20:"工序检验",
30:"工序复检",
36:"夹层检验",
40:"成品检验",
},
choice: [
{
value: true,
@ -372,6 +458,7 @@
label: "不合格",
},
],
recordList: [],
options: [],
listLoading: true,
fieldList: [],
@ -380,19 +467,26 @@
field: [],
recordformList: [],
recordform: null,
recordId: null,
fifo_detail: "",
listQueryrecordform: {
page: 0,
},
recordVisible:false,
innerIndex:null,
origintest:null,
mutipID: [],
wproduct: null,
isPost: false,
origin_test: null,
hasPicture: false,
recordItem: false,
outerVisible: false,
innerVisible: false,
limitedReview: false,
dialogFormVisible: false,
dialogFormVisibles: false,
limitedCheckRecord: false,
testrecord: {},
WarehouseData: "",
formName: '项目检查表',
@ -422,18 +516,15 @@
},
//复检半成品列表
getList2() {
this.listQuery2.act_state = 6;
getwproductList(this.listQuery2).then((response) => {
if (response.data) {
this.wproductList2 = response.data;
}
});
},
//已合格半成品
getList1() {
this.listQuery1.act_state = 30;
this.listQuery1.material__type = 2;
getwproductList(this.listQuery1).then((response) => {
@ -445,7 +536,6 @@
},
//夹层半成品列表
getList3() {
this.listQuery3.act_state = 26;
getwproductList(this.listQuery3).then((response) => {
if (response.data) {
@ -491,34 +581,101 @@
}
});
},
handleInspection(scope) {
//点击检验:如果有一个直接进入如果有多个表再进行选择
handleInspection(scope,index) {
//调该物料对应的检查表
// this.step = step;
let that = this;
this.innerIndex = index;
this.outerVisible = true;
this.wproduct = scope.row.id;//半成品ID
this.wproductactstate = scope.row.act_state;//半成品状态
this.listQueryrecordform.material = scope.row.material;//
this.listQueryrecordform.type = 2;
this.recordform = "";
this.recordform = null;
getrecordformList(this.listQueryrecordform).then((response) => {
if (response.data) {
this.recordformList = response.data;
if(response.data.length===1){
that.recordform = response.data[0].id;
that.formName = response.data[0].name;
that.submitrecordform(index);
}
}
});
},
//半产品复检
handleReview(scope) {
//验记录
checkRecord(scope){
let that = this;
this.wproduct = scope.row.id;//半成品ID
wproductReview({ wproduct: this.wproduct}).then((response) => {
that.wproduct = scope.row.id;//半成品ID
that.limitedCheckRecord = true;
getTestRecord({wproduct:scope.row.id}).then(res=>{
if(res.code==200){
debugger;
that.recordList = res.data.results;
}else{
this.$message.error(res.msg);
}
})
},
//点击记录里的检验
handleInspectionRecord(scope){
let that =this;
that.recordVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
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.id;
that.recordform = response.data.origin_test.form;
let originList = response.data.origin_test.record_data_;
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'
@ -530,6 +687,7 @@
}
});
},
//选择物料检查表
recordformChange() {
let that = this;
let arr = this.recordformList.filter(item => {
@ -538,53 +696,43 @@
that.formName = arr[0].name;
},
//根据选择的表渲染检查项目
submitrecordform() {
submitrecordform(index) {
let that = this;
if (that.recordform != "") {
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
if (arr.length > 0) {
that.hasPicture = true;
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("请选择检查表!");
},
/* 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) {
this.dialogFormVisible = true;
@ -600,18 +748,102 @@
}
});
},
//提交检查项目
formFunc(value) {
wproductTest(value).then((res) => {
if (res.code >= 200) {
this.innerVisible = false;
this.outerVisible = false;
this.getList();
this.getList1();
this.getList2();
delTestRecord(scope){
let that = this;
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await delTestRecordItem(scope.row.id).then(res=>{
if(res.code>=200){
that.$message.success("成功");
that.refreshRecord();
}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()
},
},
}
</script>

View File

@ -57,7 +57,7 @@
size="10%">
<el-table :data="techdocList">
<el-table-column label="表名称" width="150">
<template slot-scope="scope">
<el-link type="primary" :href="scope.row.file_.file" target="_blank">{{ scope.row.file_.name }}</el-link>
</template>
@ -335,7 +335,7 @@
</el-table-column>
<el-table-column type="index" width="50" />
<el-table-column
label="子计划编号"
>
<template slot-scope="scope">{{
@ -390,7 +390,7 @@
<el-button type="danger" @click="dialogTablepick = false">取消</el-button>
<el-button type="primary" @click="handlepicks()">提交</el-button>
</div>
</el-dialog>
</template>
</el-card>
@ -513,7 +513,6 @@
.box-card {
height: 300px;
}
</style>
</style>
<script>
import {
@ -780,7 +779,7 @@ export default {
recordconfirm() {
let _this = this;
_this.record_data = []; //检查项目
this.fieldList.forEach((item) => {
this.fieldList.form_fields.forEach((item) => {
_this.record_data.push({
form_field: item.id,
field_value: item.sort,
@ -801,7 +800,7 @@ export default {
getinputLists() {
getinputList({ operation: this.id, page: 0 }).then((response) => {
if (response.data) {
this.inputData = response.data;
}
});
@ -835,10 +834,10 @@ export default {
//车间领料批量提交
handlepicks() {
let _this = this;
this.pickDatas=[],
this.$refs.multipleTable.selection.forEach((item) => {
if(item.pick_count>0)
@ -850,22 +849,22 @@ export default {
});
}
});
createInputs(this.pickDatas).then((res) => {
if (res.code >= 200) {
this.dialogTablepick = false;
this.$message.success("提交成功!");
_this.getinputLists();
}
});
},
//操作产出物料列表
getoutputLists() {
getoutputList({ operation: this.id, page: 0 }).then((response) => {
@ -900,7 +899,7 @@ export default {
},
//车间产出物料批量提交
handleoutputs() {
this.outputDatas=[],
this.$refs.multipleTables.selection.forEach((item) => {
@ -913,18 +912,18 @@ export default {
});
}
});
createOutputs(this.outputDatas).then((res) => {
if (res.code >= 200) {
this.dialogTableoutput = false;
this.$message.success("提交成功!");
this.getoutputLists();
}
});
},
@ -941,4 +940,4 @@ export default {
},
},
};
</script>
</script>