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

检验单临时提交

parent 0ef36e24
<template> <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-form ref="qcForm" label-width="90px" class="addForm">
<u-row> <u-row>
<u-col span="4"> <u-col span="4">
...@@ -53,13 +53,13 @@ ...@@ -53,13 +53,13 @@
<u-col span="4"> <u-col span="4">
<u-form-item label="检测人员" prop="inspectorNickName"> <u-form-item label="检测人员" prop="inspectorNickName">
<u-input disabled v-model="qcForm.inspectorNickName"></u-input> <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-form-item>
</u-col> </u-col>
</u-row> </u-row>
</u-form> </u-form>
<view class="btnbox"> <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>
<view class="line-content-item"> <view class="line-content-item">
<uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据"> <uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据">
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
import SearchInput from '@/components/ScanInput/index.vue'; import SearchInput from '@/components/ScanInput/index.vue';
import User from '@/components/User/User.vue'; import User from '@/components/User/User.vue';
export default { export default {
props: ["zjVisible", "qcAddIndex", "visible"], props: ["zjVisible", "qcAddIndex", "visible", "showIpqcConfirmButton", "btnType", "curQcType", "currentItem"],
components: { components: {
SearchInput, SearchInput,
User, User,
...@@ -143,12 +143,29 @@ ...@@ -143,12 +143,29 @@
} }
}, },
created() { created() {
console.log('sadsadsa')
this.visable = true this.visable = true
}, },
watch: { watch: {
visable(){ visable(){
this.$emit('update:visible', this.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: { methods: {
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
class="uni-button" class="uni-button"
size="mini" size="mini"
type="primary" 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')" @click="qcLineClick(scope.row, false, 'firstView')"
> >
查看 查看
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</zb-table> </zb-table>
</view> </view>
</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-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-form ref="qcForm" label-width="90px" class="addForm">
<u-row> <u-row>
...@@ -650,18 +650,18 @@ export default { ...@@ -650,18 +650,18 @@ export default {
} }
const ipqcCode = await this.$u.api.getIpqcCode(); const ipqcCode = await this.$u.api.getIpqcCode();
const param = { const param = {
ipqcId: this.qcForm.ipqcId, ipqcId: params.ipqcId || this.qcForm.ipqcId,
ipqcCode: ipqcCode, ipqcCode: ipqcCode,
arrangeCode: params.arrangeCode || null, arrangeCode: params.arrangeCode || null,
ipqcName: this.qcForm.ipqcName, ipqcName: params.ipqcName || this.qcForm.ipqcName,
ipqcType: this.curQcType, ipqcType: this.curQcType,
templateId: this.qcForm.templateId, templateId: params.templateId || this.qcForm.templateId,
workorderId: params.workorderId || this.taskInfo.workorderId, workorderId: params.workorderId || this.taskInfo.workorderId,
workorderCode: params.workorderCode || this.taskInfo.workorderCode, workorderCode: params.workorderCode || this.taskInfo.workorderCode,
workorderName: params.workorderName || this.taskInfo.workorderName, workorderName: params.workorderName || this.taskInfo.workorderName,
taskId: this.taskInfo.taskId, taskId: params.taskId || this.taskInfo.taskId,
taskCode: this.taskInfo.taskCode, taskCode: params.taskCode || this.taskInfo.taskCode,
taskName: this.taskInfo.taskName, taskName: params.taskName || this.taskInfo.taskName,
workorderProcessId: params.workorderProcessId || null, workorderProcessId: params.workorderProcessId || null,
workstationId: params.workstationId || this.taskInfo.workstationId, workstationId: params.workstationId || this.taskInfo.workstationId,
workstationCode: params.workstationCode || this.taskInfo.workstationCode, workstationCode: params.workstationCode || this.taskInfo.workstationCode,
...@@ -672,7 +672,7 @@ export default { ...@@ -672,7 +672,7 @@ export default {
itemId: params.productId || this.taskInfo.itemId, itemId: params.productId || this.taskInfo.itemId,
itemCode: params.productCode || this.taskInfo.itemCode, itemCode: params.productCode || this.taskInfo.itemCode,
itemName: params.productName || this.taskInfo.itemName, itemName: params.productName || this.taskInfo.itemName,
specification: this.taskInfo.specification, specification: params.specification || this.taskInfo.specification,
unitOfMeasure: params.unitOfMeasure || this.taskInfo.unitOfMeasure, unitOfMeasure: params.unitOfMeasure || this.taskInfo.unitOfMeasure,
quantityCheck: params.quantityCheck || this.qcForm.quantityCheck, quantityCheck: params.quantityCheck || this.qcForm.quantityCheck,
quantityUnqualified: params.quantityUnqualified || this.qcForm.quantityUnqualified, quantityUnqualified: params.quantityUnqualified || this.qcForm.quantityUnqualified,
...@@ -692,7 +692,7 @@ export default { ...@@ -692,7 +692,7 @@ export default {
if (this.btnType === 'sjqrFinish') { if (this.btnType === 'sjqrFinish') {
delete param.ipqcType 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) { if (res.code === 200) {
this.getIpqcList(this.curQcType); this.getIpqcList(this.curQcType);
this.taskInfo = {}; this.taskInfo = {};
...@@ -745,7 +745,7 @@ export default { ...@@ -745,7 +745,7 @@ export default {
this.qcForm = { this.qcForm = {
quantityCheck: 0 quantityCheck: 0
}; };
if(this.curQcType === 'PATROL') { if(this.curQcType !== 'FINAL') {
this.addQuFlag = true this.addQuFlag = true
} else { } else {
this.qcModalFlag = true; this.qcModalFlag = true;
...@@ -796,19 +796,17 @@ export default { ...@@ -796,19 +796,17 @@ export default {
qcLineClick(item, flag, btnType) { qcLineClick(item, flag, btnType) {
this.qcAddList = [] this.qcAddList = []
this.btnType = btnType this.btnType = btnType
this.qcModalFlag = true; if(this.curQcType !== 'FINAL') {
this.addQuFlag = true
} else {
this.qcModalFlag = true;
}
this.qcForm = Object.assign({}, item); this.qcForm = Object.assign({}, item);
console.log(item, ' itme33344'); 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.inspector = this.qcForm.inspector? this.qcForm.inspector: this.vuex_user.userName;
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;
} }
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.showIpqcConfirmButton = flag === false ? false : true;
this.getTemplateLineList(); 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