Commit 60dacb91 authored by 沈翠玲's avatar 沈翠玲

检验单提交

parent ed1cc44c
<template> <template>
<div class="inputp"> <div class="inputp">
<div class="inputs"> <div class="inputs" :class="{'disabled': disabled}">
<u-icon name="search" size="35" class='searchimg' @click='search'/> <u-icon name="search" size="35" class='searchimg' @click='search'/>
<input type="text" v-model="value" :placeholder="placeholder" confirm-type="search" <input type="text" v-model="value" :placeholder="placeholder" confirm-type="search" :disabled="disabled"
inputmode="search" ref='searchinput' :focus='isfocus' class='scaninput' @input='search'> inputmode="search" ref='searchinput' :focus='isfocus' class='scaninput' @input='search'>
<u-icon name="scan" size="35" class="scanimg" @click='clickscan'/> <u-icon name="scan" size="35" class="scanimg" @click='clickscan'/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'SearchInput', name: 'SearchInput',
props: { props: {
hasscanbtn: Boolean, hasscanbtn: Boolean,
isfocus: Boolean, isfocus: Boolean,
hasgosearch: Boolean, disabled: Boolean,
types: Number, hasgosearch: Boolean,
placeholder: { types: Number,
type: String, placeholder: {
default: '搜索车辆编号' type: String,
}, default: '搜索车辆编号'
gourl: { },
type: String, gourl: {
default: '/pages/scan/scan' type: String,
}, default: '/pages/scan/scan'
value: { },
type: String, value: {
default: '' type: String,
} default: ''
}, }
methods: { },
clickinput() { methods: {
// var me = this; clickinput() {
// if (me.hasgosearch) { // var me = this;
// console.log('需要跳转') // if (me.hasgosearch) {
// uni.navigateTo({ // console.log('需要跳转')
// url: `${me.gourl}?type=${me.types}` // uni.navigateTo({
// }) // url: `${me.gourl}?type=${me.types}`
// } // })
}, // }
search() { },
var me = this; search() {
if (me.value === '') { if(this.search) return
uni.showToast({ var me = this;
icon: 'none', if (me.value === '') {
title: '请先输入搜索内容' uni.showToast({
}) icon: 'none',
return; title: '请先输入搜索内容'
} })
me.$emit('serach', me.value) return;
}, }
clickscan() { me.$emit('serach', me.value)
var me = this; },
if (me.hasscanbtn) { clickscan() {
uni.navigateTo({ if(this.search) return
url: `${me.gourl}?cameratype=scan&type=${me.types}` var me = this;
}) if (me.hasscanbtn) {
return; uni.navigateTo({
} url: `${me.gourl}?cameratype=scan&type=${me.types}`
uni.scanCode({ })
success(res) { return;
var result = res.result; }
var arrs = result.split('?')[1].split('&') uni.scanCode({
var code = ''; success(res) {
arrs.forEach(e => { var result = res.result;
var arr = e.split('=') var arrs = result.split('?')[1].split('&')
if (arr[0] === 'code') { var code = '';
code = arr[1]; arrs.forEach(e => {
} var arr = e.split('=')
}) if (arr[0] === 'code') {
me.$emit('inputchange', code); code = arr[1];
} }
}) })
} me.$emit('inputchange', code);
}, }
watch: { })
value(v) { }
var me = this; },
me.$emit('input', v) watch: {
} value(v) {
} var me = this;
} me.$emit('input', v)
</script> }
<style lang="less" scoped> }
.inputp { }
padding: 20upx; </script>
<style lang="less" scoped>
.inputs { .inputp {
background: #F2F2F2; padding: 20upx;
border-radius: 20upx;
position: relative; .inputs {
background: #F2F2F2;
.scaninput { border-radius: 20upx;
padding: 20upx 80upx 20upx 80upx; position: relative;
line-height: 1em; &.disabled {
height: 1em; background-color: #f5f7fa; cursor: not-allowed; }
min-height: 1em;
} .scaninput {
padding: 20upx 80upx 20upx 80upx;
.searchimg { line-height: 1em;
width: 1em; height: 1em;
height: 1em; min-height: 1em;
position: absolute; }
top: 25upx;
left: 20upx; .searchimg {
} width: 1em;
height: 1em;
.scanimg { position: absolute;
width: 1em; top: 25upx;
height: 1em; left: 20upx;
position: absolute; }
top: 25upx;
right: 20upx; .scanimg {
} width: 1em;
height: 1em;
.searchbtn { position: absolute;
position: absolute; top: 25upx;
right: 20upx; right: 20upx;
top: 15upx; }
border-radius: 5upx;
background: #007AFF; .searchbtn {
color: #fff; position: absolute;
width: 4em; right: 20upx;
line-height: 2em; top: 15upx;
text-align: center; border-radius: 5upx;
font-size: 0.8em; background: #007AFF;
} color: #fff;
} width: 4em;
} line-height: 2em;
</style> text-align: center;
font-size: 0.8em;
}
}
}
</style>
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<u-row> <u-row>
<u-col span="4"> <u-col span="4">
<u-form-item label="工单编码"> <u-form-item label="工单编码">
<SearchInput v-model="qcForm.workorderCode" placeholder="请输入工单编码" hassearchbtn="true" @serach="searchTask" /> <SearchInput v-model="qcForm.workorderCode" :disabled="btnType !== ''" placeholder="请输入工单编码" hassearchbtn="true" @serach="searchTask" />
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
<u-form-item label="编排编码"> <u-form-item label="编排编码">
<SearchInput v-model="qcForm.arrangeCode" placeholder="请输入编排编码" hassearchbtn="true" @serach="searWorkorder" /> <SearchInput v-model="qcForm.arrangeCode" :disabled="btnType !== ''" placeholder="请输入编排编码" hassearchbtn="true" @serach="searWorkorder" />
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
<u-form-item label="工序名称"> <u-form-item label="工序名称">
<uni-data-select v-model="qcForm.processId" :localdata="processList" @change="changeprocess"></uni-data-select> <uni-data-select v-model="qcForm.processId" :disabled="btnType !== ''" :localdata="processList" @change="changeprocess"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
...@@ -149,10 +149,13 @@ ...@@ -149,10 +149,13 @@
visable(){ visable(){
this.$emit('update:visible', this.visable) this.$emit('update:visible', this.visable)
}, },
currentItem: { currentItem: {
handler(){ handler(){
if(this.btnType && this.currentItem) { if(this.btnType && this.currentItem) {
this.qcForm = Object.assign({}, this.currentItem); this.qcForm = Object.assign({}, this.currentItem);
this.qcLines = []
this.getTemplateLineList()
if(this.currentItem.workorderCode) this.searchTask(this.currentItem.workorderCode) if(this.currentItem.workorderCode) this.searchTask(this.currentItem.workorderCode)
if(this.currentItem.arrangeCode) this.searWorkorder(this.currentItem.arrangeCode) if(this.currentItem.arrangeCode) this.searWorkorder(this.currentItem.arrangeCode)
} }
...@@ -169,6 +172,40 @@ ...@@ -169,6 +172,40 @@
} }
}, },
methods: { methods: {
getTemplateLineList() {
this.$u.api
.getIpqcLineList({
ipqcId: this.qcForm.ipqcId
})
.then((res) => {
if (res.code === 200) {
this.qcLines = res.rows.map((item) => {
let selectValues = item.selectValues;
let qualityCheckResults = item.qualityCheckResults;
if (item.inputType == 2) {
// selectValues = selectValues? JSON.parse(item.selectValues) : []
if (selectValues) {
const data = JSON.parse(item.selectValues);
selectValues = data.map((item) => {
return {
text: item.name,
value: item.name
};
});
} else {
selectValues = [];
}
qualityCheckResults = qualityCheckResults ? JSON.parse(item.qualityCheckResults) : [];
}
return {
...item,
selectValues,
qualityCheckResults
};
});
}
});
},
handleSubmitZj(params){ handleSubmitZj(params){
Object.keys(params).forEach(item => { Object.keys(params).forEach(item => {
this.$set(this.qcAddList[this.qcAddIndex], item, params[item]) this.$set(this.qcAddList[this.qcAddIndex], item, params[item])
...@@ -288,6 +325,7 @@ ...@@ -288,6 +325,7 @@
<style> <style>
.line-content-item { .line-content-item {
width: 100%; width: 100%;
padding: 0 10px;
height: 300px; height: 300px;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
...@@ -296,12 +334,12 @@ ...@@ -296,12 +334,12 @@
display: inline-block; display: inline-block;
} }
.addForm { .addForm {
padding: 0 10px; padding: 0 40rpx;
} }
.btnbox { .btnbox {
// display:flex; // display:flex;
margin-bottom: 20rpx; margin-bottom: 40rpx;
padding-left: 20rpx; padding-left: 40rpx;
.u-btn { .u-btn {
width: 150rpx; width: 150rpx;
} }
......
...@@ -750,6 +750,7 @@ export default { ...@@ -750,6 +750,7 @@ export default {
} else { } else {
this.qcModalFlag = true; this.qcModalFlag = true;
} }
this.showIpqcConfirmButton = true
if (this.curQcType === 'FIRST') { if (this.curQcType === 'FIRST') {
this.setDefaultQcForm(); this.setDefaultQcForm();
} }
...@@ -808,7 +809,9 @@ export default { ...@@ -808,7 +809,9 @@ export default {
this.qcForm.inspectorNickName = this.qcForm.inspectorNickName? this.qcForm.inspectorNickName: this.vuex_user.nickName; this.qcForm.inspectorNickName = this.qcForm.inspectorNickName? this.qcForm.inspectorNickName: this.vuex_user.nickName;
} }
this.showIpqcConfirmButton = flag === false ? false : true; this.showIpqcConfirmButton = flag === false ? false : true;
this.getTemplateLineList(); if(this.curQcType === 'FINAL') {
this.getTemplateLineList();
}
}, },
qcLineItemClick(item) { qcLineItemClick(item) {
this.qcLineItem = item; this.qcLineItem = item;
...@@ -905,8 +908,8 @@ export default { ...@@ -905,8 +908,8 @@ export default {
.btnbox { .btnbox {
// display:flex; // display:flex;
margin-bottom: 20rpx; margin-bottom: 40rpx;
padding-left: 20rpx; padding-left: 40rpx;
.u-btn { .u-btn {
width: 150rpx; width: 150rpx;
} }
...@@ -949,6 +952,7 @@ export default { ...@@ -949,6 +952,7 @@ export default {
.line-content-item { .line-content-item {
width: 100%; width: 100%;
padding: 0 10px;
height: 300px; height: 300px;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
...@@ -983,6 +987,6 @@ export default { ...@@ -983,6 +987,6 @@ export default {
display: block; display: block;
} }
.addForm { .addForm {
padding: 0 10px; padding: 0 20px;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment