needCheckForm
This commit is contained in:
parent
269ce6b9bc
commit
7555ef9dba
|
|
@ -19,7 +19,7 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model="checkForm[item.field_key]"
|
v-model="checkForm[item.field_key]"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
@input="keyChange(item.field_key)"
|
@input="keyChange($index,item.field_key)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
v-model="checkForm[item.field_key]"
|
v-model="checkForm[item.field_key]"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
@input="keyChange(item.field_key)"
|
@input="keyChange($index,item.field_key)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
v-model="checkForm[item.field_key]"
|
v-model="checkForm[item.field_key]"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
@input="keyChange(item.field_key)"
|
@input="keyChange($index,item.field_key)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="keyChange(item.field_key)"
|
@change="keyChange($index,item.field_key)"
|
||||||
/>
|
/>
|
||||||
<!--</el-date-picker>-->
|
<!--</el-date-picker>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="keyChange(item.field_key)"
|
@change="keyChange($index,item.field_key)"
|
||||||
/>
|
/>
|
||||||
<!--</el-date-picker>-->
|
<!--</el-date-picker>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
v-model="checkForm[item.field_key]"
|
v-model="checkForm[item.field_key]"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@change="keyChange(item.field_key)"
|
@change="keyChange($index,item.field_key)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item1 in item.field_choice"
|
v-for="item1 in item.field_choice"
|
||||||
|
|
@ -100,12 +100,14 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
multiple
|
multiple
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
@change="keyChange($index,item.field_key)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item1 in item.field_choice"
|
v-for="item1 in item.field_choice"
|
||||||
:key="item1"
|
:key="item1"
|
||||||
:label="item1"
|
:label="item1"
|
||||||
:value="item1"
|
:value="item1"
|
||||||
|
@change="keyChange($index,item.field_key)"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -135,11 +137,22 @@
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="text-align: right">
|
|
||||||
<el-button type="primary" @click="judgeForm">
|
<el-row>
|
||||||
合格验证
|
<el-form-item label="是否合格">
|
||||||
</el-button>
|
<!--<el-radio-group v-model="is_testok">
|
||||||
</div>
|
<el-radio :label="testokTrue">检查合格</el-radio>
|
||||||
|
<el-radio :label="testokFalse">检查不合格</el-radio>
|
||||||
|
</el-radio-group>-->
|
||||||
|
<el-radio v-model="is_testok" :label="testokTrue">检查合格</el-radio>
|
||||||
|
<el-radio v-model="is_testok" :label="testokFalse">检查不合格</el-radio>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -159,6 +172,10 @@
|
||||||
type:Number,
|
type:Number,
|
||||||
default:0
|
default:0
|
||||||
},
|
},
|
||||||
|
wproduct: {
|
||||||
|
type:Number,
|
||||||
|
default:0
|
||||||
|
},
|
||||||
hasPicture:{
|
hasPicture:{
|
||||||
type:Boolean,
|
type:Boolean,
|
||||||
default:false
|
default:false
|
||||||
|
|
@ -167,24 +184,28 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.form = this.formID;
|
this.form = this.formID;
|
||||||
// debugger;
|
let formData=this.results;
|
||||||
// console.log(this.results);
|
that.wproductId=this.wproduct;
|
||||||
this.formData=this.results;
|
formData.forEach(item => {
|
||||||
this.formData=[...this.formData];
|
let obj = new Object();
|
||||||
|
obj = item;
|
||||||
|
obj.is_testok = true;//是否合格
|
||||||
|
that.formData.push(obj)
|
||||||
|
});
|
||||||
|
that.formData=[...that.formData];
|
||||||
|
|
||||||
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接收表单数据的对象
|
||||||
that.checkForm[key]='';
|
that.checkForm[key]='';
|
||||||
that.$set(that.checkForm,key,'')
|
that.$set(that.checkForm,key,'')
|
||||||
}
|
}
|
||||||
// debugger;
|
|
||||||
// console.log(that.checkForm);
|
|
||||||
let listJudge = this.formData.filter(item => {
|
let listJudge = this.formData.filter(item => {
|
||||||
return item.need_judge === true;
|
return item.need_judge === true;
|
||||||
});
|
});
|
||||||
listJudge.forEach(item => {
|
listJudge.forEach(item => {
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
obj = item;
|
obj = item;
|
||||||
obj.judge = false;
|
|
||||||
that.judgeList.push(obj)
|
that.judgeList.push(obj)
|
||||||
});
|
});
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
@ -193,8 +214,16 @@
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
field:[],
|
||||||
checkForm:{},
|
checkForm:{},
|
||||||
|
testrecord:{
|
||||||
|
form:this.formID,
|
||||||
|
record_data:[],
|
||||||
|
is_testok:true,
|
||||||
|
wproduct:null,
|
||||||
|
},
|
||||||
canvas:null,
|
canvas:null,
|
||||||
|
wproductId:null,
|
||||||
ctx:null,
|
ctx:null,
|
||||||
myCanvas_rect:null,
|
myCanvas_rect:null,
|
||||||
Txt:null,
|
Txt:null,
|
||||||
|
|
@ -207,6 +236,9 @@
|
||||||
canvasImg:'',
|
canvasImg:'',
|
||||||
formData:[],//表单数组
|
formData:[],//表单数组
|
||||||
judgeList:[],//判定数组
|
judgeList:[],//判定数组
|
||||||
|
is_testok:true,
|
||||||
|
testokTrue:true,
|
||||||
|
testokFalse:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
|
@ -276,15 +308,63 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keyChange(key){
|
keyChange(index,key){
|
||||||
key;
|
let that = this;
|
||||||
this.$forceUpdate();
|
let reg = /\{(.+?)\}/g;
|
||||||
/* debugger;
|
that.$forceUpdate();
|
||||||
let y = this.checkForm[key];
|
that.$nextTick(()=>{
|
||||||
this.$set(this.checkForm,key,y);*/
|
if(that.formData[index].need_judge===true){
|
||||||
// this.filterBlock();
|
let arr = [],str = '';
|
||||||
|
let item = that.formData[index].rule_expression.replace(/`/g,'');
|
||||||
|
if(item.indexOf('||')>-1){
|
||||||
|
arr = item.split('||');
|
||||||
|
}else if(item.indexOf('&&')>-1){
|
||||||
|
arr = item.split('&&');
|
||||||
|
}else{
|
||||||
|
arr.push(item);
|
||||||
|
}
|
||||||
|
//对每个条件进行判定,如果符合,
|
||||||
|
for (let i = 0;i<arr.length;i++){
|
||||||
|
//获取判断依据
|
||||||
|
let a = '`'+ arr[i]+'`';
|
||||||
|
let tem =a.match(reg)[0];
|
||||||
|
let ky = tem.replace(/\{|\}/g, '');//qipao
|
||||||
|
//有值时进行判断
|
||||||
|
if(that.checkForm[ky]!==''&&that.checkForm[ky]!==null&&that.checkForm[ky]!==undefined){
|
||||||
|
//替换变量
|
||||||
|
a = a.replace(ky, 'yyy');
|
||||||
|
let yyy = "'"+that.checkForm[ky]+"'";
|
||||||
|
if(eval(eval( a))){
|
||||||
|
str += 'true';
|
||||||
|
}else{
|
||||||
|
str += 'false';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(item.indexOf('&&')>-1){
|
||||||
|
if(str.indexOf('false')>-1){
|
||||||
|
that.formData[index].is_testok = true;
|
||||||
|
}else{
|
||||||
|
that.formData[index].is_testok = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(str.indexOf('true')>-1){
|
||||||
|
that.formData[index].is_testok = false;
|
||||||
|
}else{
|
||||||
|
that.formData[index].is_testok = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.formData[index].is_testok = true;
|
||||||
|
}
|
||||||
|
that.judgeList = that.formData.filter(item => {
|
||||||
|
return item.need_judge === true;
|
||||||
|
});
|
||||||
|
that.judgeForm();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/* base64ToFile */
|
/* 图片保存 */
|
||||||
|
//初始化canvas
|
||||||
canvasInit(){
|
canvasInit(){
|
||||||
let that = this;
|
let that = this;
|
||||||
preDrawAry = [];
|
preDrawAry = [];
|
||||||
|
|
@ -299,6 +379,7 @@
|
||||||
that.draw();
|
that.draw();
|
||||||
},500);
|
},500);
|
||||||
},
|
},
|
||||||
|
//画布添加背景模板图
|
||||||
draw(){
|
draw(){
|
||||||
let canvasImg = document.getElementById("canvasImg");
|
let canvasImg = document.getElementById("canvasImg");
|
||||||
canvasImg.style.width = '500px';
|
canvasImg.style.width = '500px';
|
||||||
|
|
@ -360,7 +441,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 文字
|
// 文字
|
||||||
word1(){
|
word1(){
|
||||||
let canvas3 = document.getElementById('canvas');
|
let canvas3 = document.getElementById('canvas');
|
||||||
|
|
@ -462,6 +542,7 @@
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//base64ToFile
|
||||||
base64ToFile(baseUrl) {
|
base64ToFile(baseUrl) {
|
||||||
let arr = baseUrl.split(',');
|
let arr = baseUrl.split(',');
|
||||||
// let type = arr[0].match(/:(.*?);/)[1]; // 解锁图片类型
|
// let type = arr[0].match(/:(.*?);/)[1]; // 解锁图片类型
|
||||||
|
|
@ -474,7 +555,8 @@
|
||||||
// let fileOfBlob = new File([bufferArray], new Date()+'.jpg');
|
// let fileOfBlob = new File([bufferArray], new Date()+'.jpg');
|
||||||
return new File([bufferArray ],'draw.jpg');
|
return new File([bufferArray ],'draw.jpg');
|
||||||
},
|
},
|
||||||
/* base64ToFile */
|
/* 图片保存 */
|
||||||
|
//最终表格判定
|
||||||
judgeForm(){
|
judgeForm(){
|
||||||
let that = this ,
|
let that = this ,
|
||||||
reg = /\{(.+?)\}/g,
|
reg = /\{(.+?)\}/g,
|
||||||
|
|
@ -508,21 +590,56 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(str.indexOf('true')>-1){
|
if(item.indexOf('&&')>-1){
|
||||||
that.judgeList[i].judge = true;
|
if(str.indexOf('false')>-1){
|
||||||
|
that.judgeList[i].is_testok = true;
|
||||||
|
}else{
|
||||||
|
that.judgeList[i].is_testok = false;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
that.judgeList[i].judge = false;
|
if(str.indexOf('true')>-1){
|
||||||
|
that.judgeList[i].is_testok = false;
|
||||||
|
}else{
|
||||||
|
that.judgeList[i].is_testok = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let real = that.judgeList.filter(item=>{
|
let real = that.judgeList.filter(item=>{
|
||||||
return item.judge==true;
|
return item.is_testok===false;
|
||||||
});
|
});
|
||||||
if(real.length>0){
|
if(real.length>0){
|
||||||
|
that.is_testok = false;
|
||||||
alert("检验不合格!")
|
alert("检验不合格!")
|
||||||
}else{
|
}else{
|
||||||
|
that.is_testok = true;
|
||||||
alert("检验合格!")
|
alert("检验合格!")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//提交检查项目
|
||||||
|
submitfield() {
|
||||||
|
let that = this;
|
||||||
|
debugger;
|
||||||
|
console.log(that.checkForm);
|
||||||
|
debugger;
|
||||||
|
that.field = []; //检查项目
|
||||||
|
that.formData.forEach((item) => {
|
||||||
|
debugger;
|
||||||
|
console.log(that.checkForm[item.field_key]);
|
||||||
|
debugger;
|
||||||
|
that.field.push({
|
||||||
|
form_field: item.id,
|
||||||
|
field_value: that.checkForm[item.field_key],
|
||||||
|
is_testok: item.is_testok//单项检查结果
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(that.field);
|
||||||
|
debugger;
|
||||||
|
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);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,152 +1,155 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="待检半成品">
|
<el-tab-pane label="待检半成品">
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="wproductList.results"
|
:data="wproductList.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
max-height="600"
|
max-height="600"
|
||||||
>
|
>
|
||||||
<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>
|
||||||
|
|
||||||
<el-table-column label="半成品编号">
|
<el-table-column label="半成品编号">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="检测状态">
|
<el-table-column label="检测状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ actstate_[scope.row.act_state] }}
|
{{ actstate_[scope.row.act_state] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<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'])"
|
||||||
@click="handleInspection(scope)"
|
@click="handleInspection(scope)"
|
||||||
>检验</el-link
|
>检验
|
||||||
>
|
</el-link
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
<pagination
|
</el-table>
|
||||||
v-show="wproductList.count > 0"
|
<pagination
|
||||||
:total="wproductList.count"
|
v-show="wproductList.count > 0"
|
||||||
:page.sync="listQuery.page"
|
:total="wproductList.count"
|
||||||
:limit.sync="listQuery.page_size"
|
:page.sync="listQuery.page"
|
||||||
@pagination="getList"
|
:limit.sync="listQuery.page_size"
|
||||||
/>
|
@pagination="getList"
|
||||||
</el-card>
|
/>
|
||||||
</el-tab-pane>
|
</el-card>
|
||||||
<el-tab-pane label="复检半成品">
|
</el-tab-pane>
|
||||||
<el-card style="margin-top: 2px">
|
<el-tab-pane label="复检半成品">
|
||||||
<el-table
|
<el-card style="margin-top: 2px">
|
||||||
v-loading="listLoading"
|
<el-table
|
||||||
:data="wproductList2.results"
|
v-loading="listLoading"
|
||||||
border
|
:data="wproductList2.results"
|
||||||
fit
|
border
|
||||||
stripe
|
fit
|
||||||
highlight-current-row
|
stripe
|
||||||
max-height="600"
|
highlight-current-row
|
||||||
>
|
max-height="600"
|
||||||
<el-table-column type="index" width="50" />
|
>
|
||||||
<el-table-column label="半成品名称">
|
<el-table-column type="index" width="50"/>
|
||||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
<el-table-column label="半成品名称">
|
||||||
</el-table-column>
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="半成品编号">
|
<el-table-column label="半成品编号">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="检测状态">
|
<el-table-column label="检测状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ actstate_[scope.row.act_state] }}
|
{{ actstate_[scope.row.act_state] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<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'])"
|
||||||
@click="handleInspection(scope)"
|
@click="handleInspection(scope)"
|
||||||
>检验</el-link
|
>检验
|
||||||
>
|
</el-link
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
<pagination
|
</el-table>
|
||||||
v-show="wproductList2.count > 0"
|
<pagination
|
||||||
:total="wproductList2.count"
|
v-show="wproductList2.count > 0"
|
||||||
:page.sync="listQuery2.page"
|
:total="wproductList2.count"
|
||||||
:limit.sync="listQuery2.page_size"
|
:page.sync="listQuery2.page"
|
||||||
@pagination="getList2"
|
:limit.sync="listQuery2.page_size"
|
||||||
/>
|
@pagination="getList2"
|
||||||
</el-card>
|
/>
|
||||||
</el-tab-pane>
|
</el-card>
|
||||||
<el-tab-pane label="已合格半成品">
|
</el-tab-pane>
|
||||||
<el-card style="margin-top: 2px">
|
<el-tab-pane label="已合格半成品">
|
||||||
<el-table
|
<el-card style="margin-top: 2px">
|
||||||
v-loading="listLoading"
|
<el-table
|
||||||
:data="wproductList1.results"
|
v-loading="listLoading"
|
||||||
border
|
:data="wproductList1.results"
|
||||||
fit
|
border
|
||||||
stripe
|
fit
|
||||||
highlight-current-row
|
stripe
|
||||||
max-height="600"
|
highlight-current-row
|
||||||
>
|
max-height="600"
|
||||||
<el-table-column type="index" width="50" />
|
>
|
||||||
<el-table-column label="半成品名称">
|
<el-table-column type="index" width="50"/>
|
||||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
<el-table-column label="半成品名称">
|
||||||
</el-table-column>
|
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="半成品编号">
|
<el-table-column label="半成品编号">
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="检测状态">
|
<el-table-column label="检测状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ actstate_[scope.row.act_state] }}
|
{{ actstate_[scope.row.act_state] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="所在子工序">
|
<el-table-column label="所在子工序">
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" label="操作" width="220px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['warehouse_update'])"
|
||||||
|
@click="handlePutin(scope)"
|
||||||
|
>入库
|
||||||
|
</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="wproductList1.count > 0"
|
||||||
|
:total="wproductList1.count"
|
||||||
|
:page.sync="listQuery1.page"
|
||||||
|
:limit.sync="listQuery1.page_size"
|
||||||
|
@pagination="getList1"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
<el-table-column align="center" label="操作" width="220px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-link
|
|
||||||
v-if="checkPermission(['warehouse_update'])"
|
|
||||||
@click="handlePutin(scope)"
|
|
||||||
>入库</el-link
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<pagination
|
|
||||||
v-show="wproductList1.count > 0"
|
|
||||||
:total="wproductList1.count"
|
|
||||||
:page.sync="listQuery1.page"
|
|
||||||
:limit.sync="listQuery1.page_size"
|
|
||||||
@pagination="getList1"
|
|
||||||
/>
|
|
||||||
</el-card>
|
|
||||||
</el-tab-pane>
|
|
||||||
</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="请选择">
|
<el-select style="width: 100%" v-model="recordform" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -154,383 +157,276 @@
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
|
@change="recordformChange(item)"
|
||||||
|
@select="recordformChange(item)"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
width="50%"
|
width="50%"
|
||||||
title="检查项目"
|
:title="formName"
|
||||||
:visible.sync="innerVisible"
|
:visible.sync="innerVisible"
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
<el-form label-width="100px" label-position="right">
|
<customForm
|
||||||
<el-row
|
:results="fieldList"
|
||||||
:gutter="2"
|
:hasPicture="hasPicture"
|
||||||
v-for="(item, $index) in fieldList"
|
:formID="recordform"
|
||||||
:key="$index"
|
:wproduct="wproduct"
|
||||||
>
|
@formFunc="formFunc"
|
||||||
<el-col :span="12">
|
/>
|
||||||
<el-form-item
|
|
||||||
v-if="item.field_type === 'string'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-input placeholder="请输入" v-model="item.sort" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'int'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
width="120"
|
|
||||||
type="number"
|
|
||||||
placeholder="请输入"
|
|
||||||
v-model="item.sort"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'float'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
type="number"
|
|
||||||
placeholder="请输入"
|
|
||||||
v-model="item.sort"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'date'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-date-picker
|
|
||||||
v-model="item.create_time"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择日期"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'datetime'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-date-picker
|
|
||||||
v-model="item.create_time"
|
|
||||||
type="datetime"
|
|
||||||
placeholder="选择日期"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'select'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-select
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="item.sort"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item1 in item.field_choice"
|
|
||||||
:key="item1"
|
|
||||||
:label="item1"
|
|
||||||
:value="item1"
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
v-else-if="item.field_type === 'selects'"
|
|
||||||
:label="item.field_name"
|
|
||||||
>
|
|
||||||
<el-select
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="optio"
|
|
||||||
multiple
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item1 in item.field_choice"
|
|
||||||
:key="item1"
|
|
||||||
:label="item1"
|
|
||||||
:value="item1"
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否检验合格" width="50px">
|
|
||||||
<el-select
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="item.is_testok"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in choice"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-form-item label="是否合格" prop="sort_str">
|
|
||||||
<el-radio v-model="is_testok" label="true">检查合格</el-radio>
|
|
||||||
<el-radio v-model="is_testok" label="false">检查不合格</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="innerVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="submitfield"
|
|
||||||
>提交检查项目</el-button
|
|
||||||
>
|
|
||||||
</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>
|
||||||
<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">-->
|
||||||
<el-select
|
<el-form-item label="仓库">
|
||||||
style="width: 100%"
|
<el-select
|
||||||
v-model="form.warehouse"
|
style="width: 100%"
|
||||||
placeholder="请选择仓库"
|
v-model="form.warehouse"
|
||||||
>
|
placeholder="请选择仓库"
|
||||||
<el-option
|
>
|
||||||
v-for="item in WarehouseData"
|
<el-option
|
||||||
:key="item.id"
|
v-for="item in WarehouseData"
|
||||||
:label="item.name"
|
:key="item.id"
|
||||||
:value="item.id"
|
:label="item.name"
|
||||||
>
|
:value="item.id"
|
||||||
</el-option>
|
>
|
||||||
</el-select>
|
</el-option>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
<el-form-item label="备注" :label-width="formLabelWidth">
|
</el-form-item>
|
||||||
<el-input v-model="form.remark" ></el-input>
|
<el-form-item label="备注" >
|
||||||
</el-form-item>
|
<!--<el-form-item label="备注" :label-width="formLabelWidth">-->
|
||||||
|
<el-input v-model="form.remark"></el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
</el-form>
|
||||||
<el-button type="primary" @click="putin">确 定</el-button>
|
<div slot="footer" class="dialog-footer">
|
||||||
</div>
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
</el-dialog>
|
<el-button type="primary" @click="putin">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getwproductList ,wproductTest,wproductPutin} from "@/api/wpm";
|
import customForm from '@/components/customForm/index';
|
||||||
import checkPermission from "@/utils/permission";
|
import {getwproductList, wproductTest, wproductPutin} from "@/api/wpm";
|
||||||
import { getWarehouseList } from "@/api/inm";
|
import checkPermission from "@/utils/permission";
|
||||||
import { getMaterialList, getrecordformList, getrffieldList } from "@/api/mtm";
|
import {getWarehouseList} from "@/api/inm";
|
||||||
import { genTree } from "@/utils";
|
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import {genTree} from "@/utils";
|
||||||
const defaultetestitem = {};
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
export default {
|
const defaultetestitem = {};
|
||||||
components: { Pagination },
|
export default {
|
||||||
data() {
|
components: {Pagination,customForm},
|
||||||
return {
|
data() {
|
||||||
testitem: defaultetestitem,
|
return {
|
||||||
form:{},
|
wproduct:null,
|
||||||
wproductList: {
|
testitem: defaultetestitem,
|
||||||
count: 0,
|
form: {},
|
||||||
},
|
wproductList: {
|
||||||
wproductList1: {
|
count: 0,
|
||||||
count: 0,
|
},
|
||||||
},
|
wproductList1: {
|
||||||
wproductList2: {
|
count: 0,
|
||||||
count: 0,
|
},
|
||||||
},
|
wproductList2: {
|
||||||
listQuery: {
|
count: 0,
|
||||||
page: 1,
|
},
|
||||||
page_size: 20,
|
listQuery: {
|
||||||
},
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
listQuery1: {
|
listQuery1: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
|
||||||
listQuery2: {
|
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
},
|
|
||||||
actstate_: {
|
|
||||||
6: "待复检",
|
|
||||||
10: "生产中",
|
|
||||||
20: "待检验",
|
|
||||||
30: "已合格",
|
|
||||||
40: "库存中",
|
|
||||||
50: "不合格",
|
|
||||||
60: "待成品检验",
|
|
||||||
},
|
|
||||||
choice: [
|
|
||||||
{
|
|
||||||
value: true,
|
|
||||||
label: "合格",
|
|
||||||
},
|
},
|
||||||
{
|
listQuery2: {
|
||||||
value: false,
|
page: 1,
|
||||||
label: "不合格",
|
page_size: 20,
|
||||||
},
|
},
|
||||||
],
|
actstate_: {
|
||||||
options: [],
|
6: "待复检",
|
||||||
listLoading: true,
|
10: "生产中",
|
||||||
fieldList: "",
|
20: "待检验",
|
||||||
is_testok: "true",
|
30: "已合格",
|
||||||
field: [],
|
40: "库存中",
|
||||||
recordformList: [],
|
50: "不合格",
|
||||||
recordform: "",
|
60: "待成品检验",
|
||||||
fifo_detail: "",
|
},
|
||||||
listQueryrecordform: {
|
choice: [
|
||||||
page: 0,
|
{
|
||||||
},
|
value: true,
|
||||||
outerVisible: false,
|
label: "合格",
|
||||||
innerVisible: false,
|
},
|
||||||
dialogFormVisible:false,
|
{
|
||||||
testrecord: {},
|
value: false,
|
||||||
WarehouseData:"",
|
label: "不合格",
|
||||||
};
|
},
|
||||||
},
|
],
|
||||||
computed: {},
|
checkForm: {
|
||||||
watch: {},
|
hhh: '',
|
||||||
created() {
|
},
|
||||||
this.getList();
|
formName:'项目检查表',
|
||||||
this.getList2();
|
options: [],
|
||||||
this.getList1();
|
listLoading: true,
|
||||||
this.getLists();
|
fieldList: "",
|
||||||
},
|
is_testok: "true",
|
||||||
methods: {
|
field: [],
|
||||||
checkPermission,
|
recordformList: [],
|
||||||
//待检半成品列表
|
recordform: "",
|
||||||
getList() {
|
fifo_detail: "",
|
||||||
this.listLoading = true;
|
listQueryrecordform: {
|
||||||
this.listQuery.act_state = 20;
|
page: 0,
|
||||||
getwproductList(this.listQuery).then((response) => {
|
},
|
||||||
if (response.data) {
|
hasPicture: false,
|
||||||
this.wproductList = response.data;
|
outerVisible: false,
|
||||||
}
|
innerVisible: false,
|
||||||
this.listLoading = false;
|
dialogFormVisible: false,
|
||||||
});
|
testrecord: {},
|
||||||
|
WarehouseData: "",
|
||||||
|
};
|
||||||
},
|
},
|
||||||
//复检半成品列表
|
computed: {},
|
||||||
getList2() {
|
watch: {},
|
||||||
|
created() {
|
||||||
this.listQuery2.act_state = 6;
|
this.getList();
|
||||||
getwproductList(this.listQuery2).then((response) => {
|
this.getList2();
|
||||||
if (response.data) {
|
this.getList1();
|
||||||
this.wproductList2 = response.data;
|
// this.getLists();
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//已合格半成品
|
methods: {
|
||||||
getList1() {
|
formFunc(value) {
|
||||||
|
wproductTest(value).then((res) => {
|
||||||
this.listQuery1.act_state = 30;
|
if (res.code >= 200) {
|
||||||
getwproductList(this.listQuery1).then((response) => {
|
this.innerVisible = false;
|
||||||
if (response.data) {
|
this.outerVisible = false;
|
||||||
this.wproductList1 = response.data;
|
this.getList();
|
||||||
}
|
this.getList1();
|
||||||
|
this.getList2();
|
||||||
});
|
|
||||||
},
|
|
||||||
//仓库列表
|
|
||||||
getWarehouseLists(){
|
|
||||||
|
|
||||||
getWarehouseList({page:0}).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
this.WarehouseData = response.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleInspection(scope) {
|
|
||||||
//调该物料对应的检查表
|
|
||||||
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="";
|
|
||||||
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("请选择检查表!");
|
},
|
||||||
},
|
checkPermission,
|
||||||
//提交检查项目
|
//待检半成品列表
|
||||||
submitfield() {
|
getList() {
|
||||||
let _this = this;
|
this.listLoading = true;
|
||||||
_this.field = []; //检查项目
|
this.listQuery.act_state = 20;
|
||||||
this.fieldList.forEach((item) => {
|
getwproductList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
_this.field.push({
|
this.wproductList = response.data;
|
||||||
form_field:item.id,
|
}
|
||||||
field_value:item.sort,
|
this.listLoading = false;
|
||||||
is_testok:item.is_testok//单项检查结果
|
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
//复检半成品列表
|
||||||
|
getList2() {
|
||||||
|
|
||||||
console.log(this.recordform);
|
this.listQuery2.act_state = 6;
|
||||||
this.testrecord.form = this.recordform;//检查表
|
getwproductList(this.listQuery2).then((response) => {
|
||||||
this.testrecord.record_data = _this.field;//检查项列表
|
if (response.data) {
|
||||||
this.testrecord.is_testok = this.is_testok;//检查表检查结果
|
this.wproductList2 = response.data;
|
||||||
this.testrecord.wproduct = this.wproduct;//半成品ID
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
wproductTest(this.testrecord).then((res) => {
|
},
|
||||||
if (res.code >= 200) {
|
//已合格半成品
|
||||||
this.innerVisible = false;
|
getList1() {
|
||||||
this.outerVisible = false;
|
|
||||||
this.getList();
|
|
||||||
this.getList1();
|
|
||||||
this.getList2();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
this.listQuery1.act_state = 30;
|
||||||
|
getwproductList(this.listQuery1).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.wproductList1 = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//仓库列表
|
||||||
|
getWarehouseLists() {
|
||||||
|
|
||||||
|
getWarehouseList({page: 0}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.WarehouseData = response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleInspection(scope) {
|
||||||
|
//调该物料对应的检查表
|
||||||
|
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 = "";
|
||||||
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.recordformList = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
recordformChange(item){
|
||||||
|
let that = this;
|
||||||
|
let arr = this.recordformList.filter(item=>{
|
||||||
|
return item.id=that.recordform;
|
||||||
|
})
|
||||||
|
that.formName = arr[0].name;
|
||||||
|
},
|
||||||
|
//根据选择的表,渲染检查项目
|
||||||
|
submitrecordform() {
|
||||||
|
let that = this;
|
||||||
|
if (that.recordform != "") {
|
||||||
|
getrffieldList({form: that.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'
|
||||||
|
});
|
||||||
|
that.judgeList = [];
|
||||||
|
let listJudge = fieldList.filter(item => {
|
||||||
|
return item.need_judge === true;
|
||||||
|
});
|
||||||
|
listJudge.forEach(item => {
|
||||||
|
let obj = new Object();
|
||||||
|
obj = item;
|
||||||
|
obj.judge = false;
|
||||||
|
that.judgeList.push(obj)
|
||||||
|
});
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.hasPicture = true;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < fieldList.length; i++) {
|
||||||
|
let key = fieldList[i].field_key;
|
||||||
|
that.checkForm[key] = '';
|
||||||
|
that.$set(that.checkForm, key, '')
|
||||||
|
}
|
||||||
|
that.innerVisible = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else that.$message.error("请选择检查表!");
|
||||||
|
},
|
||||||
|
//半成品入库
|
||||||
|
handlePutin(scope) {
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
this.getWarehouseLists();//仓库
|
||||||
|
this.id = scope.row.id;//半成品id
|
||||||
|
},
|
||||||
|
putin() {
|
||||||
|
wproductPutin(this.id, this.form).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.$message.success("入库成功!");
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.getList1();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//半成品入库
|
};
|
||||||
handlePutin(scope){
|
|
||||||
this.dialogFormVisible=true;
|
|
||||||
this.getWarehouseLists();//仓库
|
|
||||||
this.id=scope.row.id;//半成品id
|
|
||||||
},
|
|
||||||
putin(){
|
|
||||||
wproductPutin(this.id,this.form).then((res) => {
|
|
||||||
if (res.code >= 200) {
|
|
||||||
this.$message.success("入库成功!");
|
|
||||||
this.dialogFormVisible=false;
|
|
||||||
this.getList1();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue