Commit ed1cc44c authored by 沈翠玲's avatar 沈翠玲

检验单临时提交

parent 0ef36e24
<template>
<u-modal width="90%" @confirm="submitIpqc" v-model="visable" :showConfirmButton="true" :showCancelButton="true" title="请填写检验单" content="操作内容" @cancel="close">
<u-modal width="90%" @confirm="submitIpqc" v-model="visable" :showConfirmButton="showIpqcConfirmButton" :showCancelButton="true" title="请填写检验单" content="操作内容" @cancel="close">
<u-form ref="qcForm" label-width="90px" class="addForm">
<u-row>
<u-col span="4">
......@@ -53,13 +53,13 @@
<u-col span="4">
<u-form-item label="检测人员" prop="inspectorNickName">
<u-input disabled v-model="qcForm.inspectorNickName"></u-input>
<u-button @tap="userTempVisible=true" type="success" size="mini">选择人员</u-button>
<u-button @tap="userTempVisible=true" v-if="btnType !== 'firstView'" type="success" size="mini">选择人员</u-button>
</u-form-item>
</u-col>
</u-row>
</u-form>
<view class="btnbox">
<u-button type="success" size="medium" @click="handleAddFirstEdit">新增</u-button>
<u-button type="success" v-if="btnType === 'firstEdit' || !btnType" size="medium" @click="handleAddFirstEdit">新增</u-button>
</view>
<view class="line-content-item">
<uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据">
......@@ -111,7 +111,7 @@
import SearchInput from '@/components/ScanInput/index.vue';
import User from '@/components/User/User.vue';
export default {
props: ["zjVisible", "qcAddIndex", "visible"],
props: ["zjVisible", "qcAddIndex", "visible", "showIpqcConfirmButton", "btnType", "curQcType", "currentItem"],
components: {
SearchInput,
User,
......@@ -143,12 +143,29 @@
}
},
created() {
console.log('sadsadsa')
this.visable = true
},
watch: {
visable(){
this.$emit('update:visible', this.visable)
},
currentItem: {
handler(){
if(this.btnType && this.currentItem) {
this.qcForm = Object.assign({}, this.currentItem);
if(this.currentItem.workorderCode) this.searchTask(this.currentItem.workorderCode)
if(this.currentItem.arrangeCode) this.searWorkorder(this.currentItem.arrangeCode)
}
},
immediate: true
},
btnType () {
if(this.btnType === 'firstEdit') {
this.qcForm.checkResult = this.qcForm.checkResult ? this.qcForm.checkResult : 'REJECT';
this.qcForm.quantityCheck = this.qcForm.quantityCheck ? this.qcForm.quantityCheck : 1;
this.qcForm.quantityQualified = this.qcForm.quantityQualified ? this.qcForm.quantityQualified : 1;
this.qcForm.quantityUnqualified = this.qcForm.quantityUnqualified ? this.qcForm.quantityUnqualified : 0;
}
}
},
methods: {
......
......@@ -54,7 +54,7 @@
class="uni-button"
size="mini"
type="primary"
v-if="curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && scope.row.status === 'CONFIRMED'"
v-if="(curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && scope.row.status === 'CONFIRMED') || curQcType === 'PATROL'"
@click="qcLineClick(scope.row, false, 'firstView')"
>
查看
......@@ -68,7 +68,7 @@
</zb-table>
</view>
</view>
<addDialog v-if="addQuFlag" :visible.sync="addQuFlag" ref="addDialog" @confirm="submitIpqc" :qcAddIndex.sync = "qcAddIndex" :zjVisible.sync = "zjVisible" @close="closemodel" />
<addDialog v-if="addQuFlag" :visible.sync="addQuFlag" :currentItem="qcForm" :btnType="btnType" :curQcType="curQcType" :showIpqcConfirmButton="showIpqcConfirmButton" ref="addDialog" @confirm="submitIpqc" :qcAddIndex.sync = "qcAddIndex" :zjVisible.sync = "zjVisible" @close="closemodel" />
<u-modal width="90%" @confirm="submitIpqc" @cancel="closemodel" v-model="qcModalFlag" :showConfirmButton="showIpqcConfirmButton" :showCancelButton="true" title="请填写检验单" content="操作内容">
<u-form ref="qcForm" label-width="90px" class="addForm">
<u-row>
......@@ -650,18 +650,18 @@ export default {
}
const ipqcCode = await this.$u.api.getIpqcCode();
const param = {
ipqcId: this.qcForm.ipqcId,
ipqcId: params.ipqcId || this.qcForm.ipqcId,
ipqcCode: ipqcCode,
arrangeCode: params.arrangeCode || null,
ipqcName: this.qcForm.ipqcName,
ipqcName: params.ipqcName || this.qcForm.ipqcName,
ipqcType: this.curQcType,
templateId: this.qcForm.templateId,
templateId: params.templateId || this.qcForm.templateId,
workorderId: params.workorderId || this.taskInfo.workorderId,
workorderCode: params.workorderCode || this.taskInfo.workorderCode,
workorderName: params.workorderName || this.taskInfo.workorderName,
taskId: this.taskInfo.taskId,
taskCode: this.taskInfo.taskCode,
taskName: this.taskInfo.taskName,
taskId: params.taskId || this.taskInfo.taskId,
taskCode: params.taskCode || this.taskInfo.taskCode,
taskName: params.taskName || this.taskInfo.taskName,
workorderProcessId: params.workorderProcessId || null,
workstationId: params.workstationId || this.taskInfo.workstationId,
workstationCode: params.workstationCode || this.taskInfo.workstationCode,
......@@ -672,7 +672,7 @@ export default {
itemId: params.productId || this.taskInfo.itemId,
itemCode: params.productCode || this.taskInfo.itemCode,
itemName: params.productName || this.taskInfo.itemName,
specification: this.taskInfo.specification,
specification: params.specification || this.taskInfo.specification,
unitOfMeasure: params.unitOfMeasure || this.taskInfo.unitOfMeasure,
quantityCheck: params.quantityCheck || this.qcForm.quantityCheck,
quantityUnqualified: params.quantityUnqualified || this.qcForm.quantityUnqualified,
......@@ -692,7 +692,7 @@ export default {
if (this.btnType === 'sjqrFinish') {
delete param.ipqcType
}
const res = await this.$u.api.addIpqc(param, this.btnType === 'firstEdit' ? 'putJson' : 'postJson');
const res = await this.$u.api.addIpqc(param, (this.btnType === 'firstEdit' || this.btnType === 'sjqrFinish') ? 'putJson' : 'postJson');
if (res.code === 200) {
this.getIpqcList(this.curQcType);
this.taskInfo = {};
......@@ -745,7 +745,7 @@ export default {
this.qcForm = {
quantityCheck: 0
};
if(this.curQcType === 'PATROL') {
if(this.curQcType !== 'FINAL') {
this.addQuFlag = true
} else {
this.qcModalFlag = true;
......@@ -796,19 +796,17 @@ export default {
qcLineClick(item, flag, btnType) {
this.qcAddList = []
this.btnType = btnType
if(this.curQcType !== 'FINAL') {
this.addQuFlag = true
} else {
this.qcModalFlag = true;
}
this.qcForm = Object.assign({}, item);
console.log(item, ' itme33344');
if (btnType === 'firstEdit' || btnType === 'sjqrFinish') {
if (btnType === 'sjqrFinish') {
this.qcForm.inspector = this.qcForm.inspector? this.qcForm.inspector: this.vuex_user.userName;
this.qcForm.inspectorNickName = this.qcForm.inspectorNickName? this.qcForm.inspectorNickName: this.vuex_user.nickName;
}
if (btnType === 'firstEdit') {
this.qcForm.checkResult = this.qcForm.checkResult ? this.qcForm.checkResult : 'REJECT';
this.qcForm.quantityCheck = this.qcForm.quantityCheck ? this.qcForm.quantityCheck : 1;
this.qcForm.quantityQualified = this.qcForm.quantityQualified ? this.qcForm.quantityQualified : 1;
this.qcForm.quantityUnqualified = this.qcForm.quantityUnqualified ? this.qcForm.quantityUnqualified : 0;
}
this.showIpqcConfirmButton = flag === false ? false : true;
this.getTemplateLineList();
},
......
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