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

检验单提交

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