Commit 0ef36e24 authored by 沈翠玲's avatar 沈翠玲

巡检单临时提交

parent 3c0882c6
......@@ -142,8 +142,8 @@ const install = (Vue, vm) => {
ipqcList: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/qc/ipqc/list', params),
//增加检验
addIpqc: (params = {}) =>
vm.$u.postJson(config.adminPath + '/mes/qc/ipqc', params),
addIpqc: (params = {}, type = 'postJson') =>
vm.$u[type](config.adminPath + '/mes/qc/ipqc', params),
//切换检验单状态
changeState: (params = {}) =>
vm.$u.postJson(config.adminPath + '/mes/qc/ipqc/changeState', params),
......
......@@ -17,11 +17,20 @@
<uni-data-select v-model="qcForm.processId" :localdata="processList" @change="changeprocess"></uni-data-select>
</u-form-item>
</u-col>
<u-col span="3">
<u-col span="4">
<u-form-item label="检验单名称" label-width="90px">
<u-input v-model="qcForm.ipqcName" placeholder="请输入检验单名称"></u-input>
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="检测结果" prop="checkResult">
<u-radio-group v-model="qcForm.checkResult">
<u-radio :name="item.value" v-for="item in dict.type.mes_qc_result" :key="item.value">
{{ item.label }}
</u-radio>
</u-radio-group>
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="4">
......@@ -49,6 +58,9 @@
</u-col>
</u-row>
</u-form>
<view class="btnbox">
<u-button type="success" size="medium" @click="handleAddFirstEdit">新增</u-button>
</view>
<view class="line-content-item">
<uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr>
......@@ -68,7 +80,7 @@
<uni-td align="center">
<view style="display:flex;">
<u-input disabled v-model="line.indexName" placeholder="选择质检项目"></u-input>
<u-button @tap="zjVisible = true, qcAddIndex = index" type="success" size="mini">选择质检项目</u-button>
<u-button @tap="chooseZJ(index)" type="success" size="mini">选择质检项目</u-button>
</view>
</uni-td>
<uni-td align="center"></uni-td>
......@@ -99,12 +111,14 @@
import SearchInput from '@/components/ScanInput/index.vue';
import User from '@/components/User/User.vue';
export default {
props: ["zjVisible", "qcAddIndex", "visible"],
components: {
SearchInput,
User,
UniEasyinput,
UButton
},
dicts: ['mes_qc_result'],
data() {
return {
qcForm: {
......@@ -112,8 +126,9 @@
arrangeCode: '',
processId: '',
ipqcName: '',
quantityCheck: 0,
quantityQualified: 0,
checkResult: 'REJECT',
quantityCheck: 1,
quantityQualified: 1,
quantityUnqualified: 0,
inspectorNickName: '',
inspector: ''
......@@ -124,11 +139,28 @@
visable: true,
qcAddList: [],
qcLines: [],
qcAddList: [],
processList: []
}
},
created() {
console.log('sadsadsa')
this.visable = true
},
watch: {
visable(){
this.$emit('update:visible', this.visable)
}
},
methods: {
handleSubmitZj(params){
Object.keys(params).forEach(item => {
this.$set(this.qcAddList[this.qcAddIndex], item, params[item])
})
},
chooseZJ(index) {
this.$emit('update:zjVisible', true)
this.$emit('update:qcAddIndex', index)
},
userDetermine() {
this.qcForm.inspectorNickName = this.$refs.userRef.tableSelectData[0]?.nickName;
this.qcForm.inspector = this.$refs.userRef.tableSelectData[0]?.userName;
......@@ -188,7 +220,7 @@
this.qcForm.workorderCode = res.data.workorderCode
this.qcForm.arrangeCode = res.data.arrangeCode
if(res.data.processList && res.data.processList.length > 0){
this.processList = res.data.processList.map(v=>({text: v.processName, value: v.processId, code: v.processCode, workstationCode: v.workstationCode, workstationId: v.workstationId, workstationName: v.workstationName}))
this.processList = res.data.processList.map(v=>({text: v.processName, value: v.processId, code: v.processCode, workstationCode: v.workstationCode, workstationId: v.workstationId, workstationName: v.workstationName, workorderProcessId: v.workorderProcessId}))
}
}
},
......@@ -205,7 +237,7 @@
this.qcForm.workorderCode = res.data.workorderCode
this.qcForm.arrangeCode = res.data.arrangeCode
if(res.data.processList && res.data.processList.length > 0){
this.processList = res.data.processList.map(v=>({text: v.processName, value: v.processId, code: v.processCode, workstationCode: v.workstationCode, workstationId: v.workstationId, workstationName: v.workstationName}))
this.processList = res.data.processList.map(v=>({text: v.processName, value: v.processId, code: v.processCode, workstationCode: v.workstationCode, workstationId: v.workstationId, workstationName: v.workstationName, workorderProcessId: v.workorderProcessId}))
}
}
},
......@@ -215,15 +247,18 @@
return;
}
const item = this.processList.find(v=>v.value === this.qcForm.processId)
console.log('item', item)
this.$emit('confirm', {
...this.Condition,
...this.qcForm,
processCode: item.code,
processName: item.text,
workstationCode: item.workstationCode,
workstationCode: item.workstationCode,
workorderProcessId: item.workorderProcessId,
workstationId: item.workstationId,
workstationName: item.workstationName,
qcLines: this.qcLines
qcLines: this.qcLines,
qcAddList: this.qcAddList
})
},
close(){
......@@ -246,4 +281,12 @@
.addForm {
padding: 0 10px;
}
.btnbox {
// display:flex;
margin-bottom: 20rpx;
padding-left: 20rpx;
.u-btn {
width: 150rpx;
}
}
</style>
\ No newline at end of file
......@@ -68,8 +68,8 @@
</zb-table>
</view>
</view>
<u-modal width="90%" @confirm="submitIpqc" v-model="qcModalFlag" :showConfirmButton="showIpqcConfirmButton" :showCancelButton="true" title="请填写检验单" content="操作内容">
<addDialog v-if="addQuFlag" :visible.sync="addQuFlag" 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>
<u-col span="5">
......@@ -317,7 +317,7 @@
</u-form>
</uni-card>
</u-modal>
<addDialog v-if="addQuFlag" @confirm="submitIpqc" @close="addQuFlag=false" />
</view>
</template>
......@@ -566,13 +566,18 @@ export default {
}
// 必传 qcTemplateIndexId inputType:1 ipqcId indexId indexCode indexName indexType qcTool
console.log(this.$refs.zjListRef.tableSelectData, 'this.$refs.zjListRef.tableSelectData');
this.$set(this.qcAddList[this.qcAddIndex], 'inputType', 1)
this.$set(this.qcAddList[this.qcAddIndex], 'ipqcId', this.qcForm.ipqcId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexId', this.$refs.zjListRef.tableSelectData[0]?.indexId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexCode', this.$refs.zjListRef.tableSelectData[0]?.indexCode)
this.$set(this.qcAddList[this.qcAddIndex], 'indexName', this.$refs.zjListRef.tableSelectData[0]?.indexName)
this.$set(this.qcAddList[this.qcAddIndex], 'indexType', this.$refs.zjListRef.tableSelectData[0]?.indexType)
this.$set(this.qcAddList[this.qcAddIndex], 'qcTool', this.$refs.zjListRef.tableSelectData[0]?.qcTool)
if(this.addQuFlag) {
this.$refs.addDialog.handleSubmitZj({inputType:1, ipqcId: this.qcForm.ipqcId, indexId: this.$refs.zjListRef.tableSelectData[0].indexId, indexCode: this.$refs.zjListRef.tableSelectData[0].indexCode, indexName: this.$refs.zjListRef.tableSelectData[0].indexName, indexType: this.$refs.zjListRef.tableSelectData[0].indexType, qcTool: this.$refs.zjListRef.tableSelectData[0].qcTool})
} else {
this.$set(this.qcAddList[this.qcAddIndex], 'inputType', 1)
this.$set(this.qcAddList[this.qcAddIndex], 'ipqcId', this.qcForm.ipqcId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexId', this.$refs.zjListRef.tableSelectData[0]?.indexId)
this.$set(this.qcAddList[this.qcAddIndex], 'indexCode', this.$refs.zjListRef.tableSelectData[0]?.indexCode)
this.$set(this.qcAddList[this.qcAddIndex], 'indexName', this.$refs.zjListRef.tableSelectData[0]?.indexName)
this.$set(this.qcAddList[this.qcAddIndex], 'indexType', this.$refs.zjListRef.tableSelectData[0]?.indexType)
this.$set(this.qcAddList[this.qcAddIndex], 'qcTool', this.$refs.zjListRef.tableSelectData[0]?.qcTool)
}
console.log(this.qcAddList)
},
userDetermine() {
......@@ -583,7 +588,7 @@ export default {
async getIpqcList(type) {
let params = { ipqcType: type || this.curQcType };
if (this.curQcType == 'SJQR') {
params = { status: 'PENDING' };
params = { status: 'PENDING', ipqcType: 'FIRST' };
}
const res = await this.$u.api.ipqcList(params);
if (res.code === 200) {
......@@ -640,7 +645,9 @@ export default {
});
if (this.btnType === 'firstEdit') {
qcIpqclineList = qcIpqclineList.concat(this.qcAddList)
}
} else if(params.qcAddList) {
qcIpqclineList = qcIpqclineList.concat(params.qcAddList)
}
const ipqcCode = await this.$u.api.getIpqcCode();
const param = {
ipqcId: this.qcForm.ipqcId,
......@@ -655,6 +662,7 @@ export default {
taskId: this.taskInfo.taskId,
taskCode: this.taskInfo.taskCode,
taskName: this.taskInfo.taskName,
workorderProcessId: params.workorderProcessId || null,
workstationId: params.workstationId || this.taskInfo.workstationId,
workstationCode: params.workstationCode || this.taskInfo.workstationCode,
workstationName: params.workstationName || this.taskInfo.workstationName,
......@@ -675,7 +683,7 @@ export default {
crQuantity: null,
majQuantity: null,
minQuantity: null,
checkResult: params ? null: this.qcForm.checkResult,
checkResult: params.checkResult || this.qcForm.checkResult,
inspectDate: new Date(),
inspector: params.inspector || this.qcForm.inspector,
status: this.btnType === 'sjqrFinish'? 'CONFIRMED': 'PREPARE',
......@@ -684,7 +692,7 @@ export default {
if (this.btnType === 'sjqrFinish') {
delete param.ipqcType
}
const res = await this.$u.api.addIpqc(param);
const res = await this.$u.api.addIpqc(param, this.btnType === 'firstEdit' ? 'putJson' : 'postJson');
if (res.code === 200) {
this.getIpqcList(this.curQcType);
this.taskInfo = {};
......@@ -695,7 +703,7 @@ export default {
} else {
this.$u.toast(res.msg);
}
this.addQuFlag=false
this.closemodel()
},
getTemplateLineList() {
this.$u.api
......@@ -822,6 +830,10 @@ export default {
}
});
},
closemodel(){
this.btnType = ''
this.addQuFlag = false
},
addQcdeffect() {
this.defectrecordList.push({
recordId: null,
......
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