Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
743e1e73ff
|
@ -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,83 +1,83 @@
|
||||||
<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="所在子工序">
|
|
||||||
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
|
<el-table-column label="所在子工序">
|
||||||
|
<template slot-scope="scope">{{ scope.row.step_.name }}</template>
|
||||||
|
</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
|
||||||
|
@ -122,39 +122,40 @@
|
||||||
<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="handlePutin(scope)"
|
@click="handlePutin(scope)"
|
||||||
>入库</el-link
|
>入库
|
||||||
>
|
</el-link
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
<pagination
|
</el-table>
|
||||||
v-show="wproductList1.count > 0"
|
<pagination
|
||||||
:total="wproductList1.count"
|
v-show="wproductList1.count > 0"
|
||||||
:page.sync="listQuery1.page"
|
:total="wproductList1.count"
|
||||||
:limit.sync="listQuery1.page_size"
|
:page.sync="listQuery1.page"
|
||||||
@pagination="getList1"
|
:limit.sync="listQuery1.page_size"
|
||||||
/>
|
@pagination="getList1"
|
||||||
</el-card>
|
/>
|
||||||
</el-tab-pane>
|
</el-card>
|
||||||
</el-tabs>
|
</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="请选择">
|
||||||
|
@ -163,152 +164,29 @@
|
||||||
: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">
|
||||||
|
@ -368,6 +246,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import customForm from '@/components/customForm/index';
|
||||||
import { getwproductList ,wproductTest,wproductPutin,createputins} from "@/api/wpm";
|
import { getwproductList ,wproductTest,wproductPutin,createputins} from "@/api/wpm";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import { getWarehouseList } from "@/api/inm";
|
import { getWarehouseList } from "@/api/inm";
|
||||||
|
@ -376,15 +255,15 @@ 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 {
|
||||||
components: { Pagination },
|
components: {Pagination,customForm},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
testitem: defaultetestitem,
|
testitem: defaultetestitem,
|
||||||
form:{remark:"",warehouse:""},
|
form: {remark: "", warehouse: ""},
|
||||||
wproductList: {
|
wproductList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
wproductList1: {
|
wproductList1: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
wproductList2: {
|
wproductList2: {
|
||||||
|
@ -394,11 +273,11 @@ export default {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
listQuery1: {
|
listQuery1: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
listQuery2: {
|
listQuery2: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
|
@ -432,21 +311,21 @@ export default {
|
||||||
listQueryrecordform: {
|
listQueryrecordform: {
|
||||||
page: 0,
|
page: 0,
|
||||||
},
|
},
|
||||||
mutipID:[],
|
mutipID: [],
|
||||||
outerVisible: false,
|
outerVisible: false,
|
||||||
innerVisible: false,
|
innerVisible: false,
|
||||||
dialogFormVisible:false,
|
dialogFormVisible: false,
|
||||||
dialogFormVisibles:false,
|
dialogFormVisibles: false,
|
||||||
testrecord: {},
|
testrecord: {},
|
||||||
WarehouseData:"",
|
WarehouseData: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getList2();
|
this.getList2();
|
||||||
this.getList1();
|
this.getList1();
|
||||||
this.getLists();
|
this.getLists();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -462,7 +341,7 @@ export default {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//复检半成品列表
|
//复检半成品列表
|
||||||
getList2() {
|
getList2() {
|
||||||
|
|
||||||
this.listQuery2.act_state = 6;
|
this.listQuery2.act_state = 6;
|
||||||
|
@ -474,10 +353,10 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//已合格半成品
|
//已合格半成品
|
||||||
getList1() {
|
getList1() {
|
||||||
|
|
||||||
this.listQuery1.act_state = 30;
|
this.listQuery1.act_state = 30;
|
||||||
this.listQuery1.material__type = 1;
|
this.listQuery1.material__type = 1;
|
||||||
getwproductList(this.listQuery1).then((response) => {
|
getwproductList(this.listQuery1).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.wproductList1 = response.data;
|
this.wproductList1 = response.data;
|
||||||
|
@ -486,49 +365,49 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//半成品批量入库
|
//半成品批量入库
|
||||||
handleCreate(){
|
handleCreate() {
|
||||||
this.dialogFormVisibles=true;
|
this.dialogFormVisibles = true;
|
||||||
this.getWarehouseLists();//仓库
|
this.getWarehouseLists();//仓库
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
//批量入库
|
//批量入库
|
||||||
putins(){
|
putins() {
|
||||||
let _this=this
|
let _this = this
|
||||||
_this.mutipID=[]
|
_this.mutipID = []
|
||||||
this.$refs.multipleTable.selection.forEach((item) => {
|
this.$refs.multipleTable.selection.forEach((item) => {
|
||||||
_this.mutipID.push( item.id );
|
_this.mutipID.push(item.id);
|
||||||
alert(_this.mutipID);
|
alert(_this.mutipID);
|
||||||
});
|
});
|
||||||
console.log(_this.mutipID);
|
console.log(_this.mutipID);
|
||||||
|
|
||||||
createputins({warehouse:this.form.warehouse,wproducts: _this.mutipID,remark:this.form.remark}).then((res) => {
|
createputins({warehouse: this.form.warehouse, wproducts: _this.mutipID, remark: this.form.remark}).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.$message.success("批量入库成功!");
|
this.$message.success("批量入库成功!");
|
||||||
this.dialogFormVisibles=false;
|
this.dialogFormVisibles = false;
|
||||||
this.getList1();
|
this.getList1();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//仓库列表
|
//仓库列表
|
||||||
getWarehouseLists(){
|
getWarehouseLists() {
|
||||||
|
|
||||||
getWarehouseList({page:0}).then((response) => {
|
getWarehouseList({page: 0}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.WarehouseData = response.data;
|
this.WarehouseData = response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleInspection(scope) {
|
handleInspection(scope) {
|
||||||
//调该物料对应的检查表
|
//调该物料对应的检查表
|
||||||
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 = "";
|
||||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.recordformList = response.data;
|
this.recordformList = response.data;
|
||||||
|
@ -537,11 +416,20 @@ export default {
|
||||||
},
|
},
|
||||||
//根据选择的表,渲染检查项目
|
//根据选择的表,渲染检查项目
|
||||||
submitrecordform() {
|
submitrecordform() {
|
||||||
|
let that = this;
|
||||||
if (this.recordform != "") {
|
if (this.recordform != "") {
|
||||||
getrffieldList({ form: this.recordform, page: 0 }).then((response) => {
|
getrffieldList({form: this.recordform, page: 1,page_size:100}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fieldList = response.data;
|
that.hasPicture = false;
|
||||||
this.innerVisible = true;
|
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;
|
||||||
|
}
|
||||||
|
that.innerVisible = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else this.$message.error("请选择检查表!");
|
} else this.$message.error("请选择检查表!");
|
||||||
|
@ -553,9 +441,9 @@ export default {
|
||||||
this.fieldList.forEach((item) => {
|
this.fieldList.forEach((item) => {
|
||||||
|
|
||||||
_this.field.push({
|
_this.field.push({
|
||||||
form_field:item.id,
|
form_field: item.id,
|
||||||
field_value:item.sort,
|
field_value: item.sort,
|
||||||
is_testok:item.is_testok//单项检查结果
|
is_testok: item.is_testok//单项检查结果
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -563,39 +451,47 @@ export default {
|
||||||
this.testrecord.form = this.recordform;//检查表
|
this.testrecord.form = this.recordform;//检查表
|
||||||
this.testrecord.record_data = _this.field;//检查项列表
|
this.testrecord.record_data = _this.field;//检查项列表
|
||||||
this.testrecord.is_testok = this.is_testok;//检查表检查结果
|
this.testrecord.is_testok = this.is_testok;//检查表检查结果
|
||||||
this.testrecord.wproduct = this.wproduct;//半成品ID
|
this.testrecord.wproduct = this.wproduct;//半成品ID
|
||||||
|
|
||||||
|
|
||||||
|
wproductTest(this.testrecord).then((res) => {
|
||||||
wproductTest(this.testrecord).then((res) => {
|
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.innerVisible = false;
|
this.innerVisible = false;
|
||||||
this.outerVisible = false;
|
this.outerVisible = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getList1();
|
this.getList1();
|
||||||
this.getList2();
|
this.getList2();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
//半成品入库
|
//半成品入库
|
||||||
handlePutin(scope){
|
handlePutin(scope) {
|
||||||
this.dialogFormVisible=true;
|
this.dialogFormVisible = true;
|
||||||
this.getWarehouseLists();//仓库
|
this.getWarehouseLists();//仓库
|
||||||
this.id=scope.row.id;//半成品id
|
this.id = scope.row.id;//半成品id
|
||||||
},
|
},
|
||||||
putin(){
|
putin() {
|
||||||
wproductPutin(this.id,this.form).then((res) => {
|
wproductPutin(this.id, this.form).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.$message.success("入库成功!");
|
this.$message.success("入库成功!");
|
||||||
this.dialogFormVisible=false;
|
this.dialogFormVisible = false;
|
||||||
this.getList1();
|
this.getList1();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
formFunc(value) {
|
||||||
|
wproductTest(value).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.innerVisible = false;
|
||||||
|
this.outerVisible = false;
|
||||||
|
this.getList();
|
||||||
|
this.getList1();
|
||||||
|
this.getList2();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue