Commit 5aa16f3f authored by 沈翠玲's avatar 沈翠玲

iqc对接口

parent f39d8179
......@@ -187,6 +187,9 @@ const install = (Vue, vm) => {
//查询检验列表
ipqcList: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/qc/ipqc/list', params),
//查询IQC检验列表
iqcList: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/qc/iqc/list'),
//增加检验
addIpqc: (params = {}, type = 'postJson') =>
vm.$u[type](config.adminPath + '/mes/qc/ipqc', params),
......@@ -204,7 +207,18 @@ const install = (Vue, vm) => {
params
),
// iqc查看详情
getIqcInfo: (ipcId) =>
vm.$u.get(config.adminPath + '/mes/qc/iqc/' + ipcId),
// iqc加载校验项
reloadTable: (params = {}) =>
vm.$u.postJson(config.adminPath + '/mes/qc/iqc/reloadTable', params),
// iqc提交
commitIqcInfo: (ipcId) =>
vm.$u.get(config.adminPath + '/mes/qc/iqc/commit/' + ipcId),
// iqc保存
saveIqcInfo: (params = {}) =>
vm.$u.putJson(config.adminPath + '/mes/qc/iqc', params),
/**
* 工艺工序相关API
*/
......
<template>
<u-modal width="90%" @confirm="submitIpqc" v-model="visable" :showConfirmButton="showIpqcConfirmButton" :showCancelButton="true" title="请填写检验单" content="操作内容" @cancel="close">
<u-modal width="90%" v-model="visable" :showConfirmButton="false" :showCancelButton="false" title="请填写检验单" content="操作内容">
<u-button type="primary" class="reload-btn" @click="reloadTable" style="width: 200rpx">加载校验项</u-button>
<u-form ref="qcForm" label-width="90px" class="addForm">
<u-row>
<u-col span="4">
<u-form-item label="检验单名称">
{{ qcForm.workorderCode }}
{{ qcForm.iqcName }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="检验单编号">
{{ qcForm.workorderCode }}
{{ qcForm.iqcCode }}
</u-form-item>
</u-col>
<u-col span="4">
......@@ -23,57 +24,57 @@
</u-col>
<u-col span="3">
<u-form-item label="采购单号">
{{ qcForm.workorderCode }}
{{ qcForm.purchaseNo }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="采购单行号">
{{ qcForm.workorderCode }}
{{ qcForm.purchaseLineNo }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="送货单号">
{{ qcForm.workorderCode }}
{{ qcForm.deliveryNo }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="送货单行号">
{{ qcForm.workorderCode }}
{{ qcForm.deliveryLineNo }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="批次号">
{{ qcForm.workorderCode }}
{{ qcForm.batchNo }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="批次数量">
{{ qcForm.workorderCode }}
{{ qcForm.quantity }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="单位">
{{ qcForm.workorderCode }}
{{ qcForm.unitOfMeasure }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="送货日期">
{{ qcForm.workorderCode }}
{{ qcForm.deliveryDate }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="物料分类">
{{ qcForm.workorderCode }}
{{ qcForm.itemTypeName }}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="物料编码">
{{ qcForm.workorderCode }}
{{ qcForm.sapItemCode }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="物料名称">
{{ qcForm.workorderCode }}
{{ qcForm.itemName }}
</u-form-item>
</u-col>
</u-row>
......@@ -96,16 +97,13 @@
</u-row>
<u-row>
<u-col span="4">
<u-form-item label="检测人员" prop="inspectorNickName">
<u-input disabled v-model="qcForm.inspectorNickName"></u-input>
<u-form-item label="检测人员" prop="inspectorName">
<u-input disabled v-model="qcForm.inspectorName"></u-input>
<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" v-if="isEdit" size="medium" @click="handleAddFirstEdit">新增</u-button>
</view>
<scroll-view scroll-y="true" show-scrollbar="true" class="line-content-item">
<uni-table ref="qcLineTable" class="line-table" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr>
......@@ -125,21 +123,6 @@
<view @click="del('qcAddList', index)" :style="{color: isEdit ? '#e56048' : '#ddd'}">删除</view>
</uni-td> -->
</uni-tr>
<uni-tr v-for="(line, index) in qcAddList" :key="index + 'add'">
<uni-td align="center">
<view style="display:flex;">
<u-input disabled v-model="line.indexName" placeholder="选择质检项目"></u-input>
<u-button @tap="chooseZJ(index)" type="success" size="mini">选择质检项目</u-button>
</view>
</uni-td>
<uni-td align="center"></uni-td>
<uni-td width="150px" align="center">
<uni-easyinput v-model="line.qualityCheckResults"></uni-easyinput>
</uni-td>
<!-- <uni-td width="15px" align="center">
<view @click="del('qcAddList', index)" :style="{color: isEdit ? '#e56048' : '#ddd'}">删除</view>
</uni-td> -->
</uni-tr>
</uni-table>
</scroll-view>
<u-modal
......@@ -154,6 +137,20 @@
<User ref="userRef" v-if="userTempVisible" />
</view>
</u-modal>
<view class="u-model__footer u-border-top">
<view :hover-stay-time="100" hover-class="u-model__btn--hover" class="u-model__footer__button"
@tap="close">
取消
</view>
<view :hover-stay-time="100" hover-class="u-model__btn--hover" v-if="showIpqcConfirmButton"
class="u-model__footer__button hairline-left" @tap="save">
保存
</view>
<view :hover-stay-time="100" hover-class="u-model__btn--hover" v-if="showIpqcConfirmButton"
class="u-model__footer__button hairline-left" @tap="submitIpqc">
确认提交
</view>
</view>
</u-modal>
</template>
......@@ -182,7 +179,7 @@
quantityCheck: 1,
quantityQualified: 1,
quantityUnqualified: 0,
inspectorNickName: '',
inspectorName: '',
inspector: ''
},
Condition: {},
......@@ -210,11 +207,9 @@
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)
if (this.curQcType === 'IQC') {
this.getIqcInfo(this.currentItem.iqcId)
}
}
},
immediate: true
......@@ -229,28 +224,15 @@
}
},
methods: {
del(list, index){
if(this.isEdit) {
uni.showModal({
title: '提示',
content: '您确定要删除此项吗?',
style: 'z-index: 99999',
success: async (res) => {
if (res.confirm) {
this[list].splice(index, 1)
}
}
})
}
},
getTemplateLineList() {
getIqcInfo (iqcId) {
this.$u.api
.getIpqcLineList({
ipqcId: this.qcForm.ipqcId
})
.getIqcInfo(iqcId)
.then((res) => {
if (res.code === 200) {
this.qcLines = res.rows.map((item) => {
console.log(res, 'rows88999655');
res.data['iqcId'] = this.currentItem.iqcId
this.qcForm = res.data
this.qcLines = res.data.qcIqcLineList.map((item) => {
let selectValues = item.selectValues;
let qualityCheckResults = item.qualityCheckResults;
if (item.inputType == 2) {
......@@ -274,28 +256,33 @@
qualityCheckResults
};
});
console.log(this.qcLines, 'this.qcLines');
}
});
},
handleSubmitZj(params){
Object.keys(params).forEach(item => {
this.$set(this.qcAddList[this.qcAddIndex], item, params[item])
del(list, index){
if(this.isEdit) {
uni.showModal({
title: '提示',
content: '您确定要删除此项吗?',
style: 'z-index: 99999',
success: async (res) => {
if (res.confirm) {
this[list].splice(index, 1)
}
}
})
}
},
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;
},
async changeprocess() {
const res = await this.$u.api.generateItems({"workorderCode":this.qcForm.workorderCode,"arrangeCode":this.qcForm.arrangeCode,"qcTypes":"PATROL","processId":this.qcForm.processId})
// const res = await this.$u.api.generateItems({"workorderCode":"","arrangeCode":"BP24531002","qcTypes":"PATROL","processId":389})
reloadTable() {
this.$u.api
.reloadTable({'iqcCode': this.currentItem.iqcCode})
.then((res) => {
if (res.code === 200) {
console.log(res.data)
this.qcLines = res.data.map((item) => {
console.log(res, 'rows88999655');
res.data['iqcId'] = this.currentItem.iqcId
this.qcForm = res.data
this.qcLines = res.data.qcIqcLineList.map((item) => {
let selectValues = item.selectValues;
let qualityCheckResults = item.qualityCheckResults;
if (item.inputType == 2) {
......@@ -320,11 +307,15 @@
};
});
}
});
},
userDetermine() {
this.qcForm.inspectorName = this.$refs.userRef.tableSelectData[0]?.nickName;
this.qcForm.inspector = this.$refs.userRef.tableSelectData[0]?.userName;
},
handleChangeQuantityCheck(e) {
console.log('sadasdas', e)
const sum = this.qcForm.quantityQualified + this.qcForm.quantityUnqualified;
this.$set(this.qcForm, 'quantityCheck', sum);
!isNaN(sum) && this.$set(this.qcForm, 'quantityCheck', sum);
},
handleAddFirstEdit() {
this.qcAddList.push({
......@@ -332,58 +323,25 @@
qualityCheckResults: ''
})
},
async searchTask(val) {
const res = await this.$u.api.getQcCondition({
workorderCode: val,
arrangeCode: this.qcForm.arrangeCode
});
if (res.code === 200) {
if (!res.data) {
this.$u.toast('暂未查询到工序信息!');
}
this.Condition = res.data
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, workorderProcessId: v.workorderProcessId}))
}
}
},
async searWorkorder(val) {
const res = await this.$u.api.getQcCondition({
workorderCode: this.qcForm.workorderCode,
arrangeCode: val
});
if (res.code === 200) {
if (!res.data) {
this.$u.toast('暂未查询到工序信息!');
}
this.Condition = res.data
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, workorderProcessId: v.workorderProcessId}))
}
submitIpqc() {
this.$u.api.commitIqcInfo(this.qcForm.iqcId).then(res=>{
if(res.code === 200) {
this.$u.toast('提交成功')
this.$emit('confirm')
} else {
this.$u.toast(res.msg || '提交失败')
this.$emit('confirm')
}
})
},
submitIpqc() {
if(!this.qcForm.processId) {
this.$u.toast('请输入工单编码或编排编码并选择工序!');
return;
save() {
this.$u.api.saveIqcInfo(this.qcForm).then(res=>{
if(res.code === 200) {
this.$u.toast('保存成功')
} else {
this.$u.toast('保存失败')
}
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,
workorderProcessId: item.workorderProcessId,
workstationId: item.workstationId,
workstationName: item.workstationName,
qcLines: this.qcLines,
qcAddList: this.qcAddList
})
},
close(){
......@@ -393,7 +351,7 @@
}
</script>
<style>
<style lang="scss" scoped>
.line-content-item {
width: 100%;
height: 300px;
......@@ -418,4 +376,23 @@
.del-modal{
z-index: 99999;
}
.u-model__footer {
display: flex;
.u-model__footer__button {
flex: 1;
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
box-sizing: border-box;
cursor: pointer;
text-align: center;
border-radius: 4rpx;
}
}
.reload-btn {
position: absolute;
top: 15rpx;
left: 40rpx;
}
</style>
\ No newline at end of file
......@@ -13,15 +13,15 @@
</view>
<view class="grid-text">首检确认</view>
</view> -->
<view class="button-frame" :class="{ active: qcType.value === curQcType }" v-for="qcType in dict.type.mes_ipqc_type" @click="handleClickBtn(qcType.value)">
<view class="button-frame" :class="{ active: qcType.value === curQcType }" v-for="qcType in dict.type.mes_ipqc_type" :key="qcType.value" @click="handleClickBtn(qcType.value)">
<!-- <view class="shortcut-icon icon-color01">
<image class="icon-button" src="/static/icons/png/pro.png"/>
</view> -->
<view class="grid-text">{{ qcType.label }}</view>
</view>
<!-- <view class="button-frame" :class="{'active': !curQcType }" @click="handleClickBtn('')">
<view class="grid-text">全部</view>
</view> -->
<view class="button-frame" :class="{'active': curQcType === 'IQC' }" @click="handleClickBtn('IQC')">
<view class="grid-text">IQC</view>
</view>
</view>
<view class="list-bar">
......@@ -45,16 +45,17 @@
class="uni-button"
size="mini"
type="primary"
v-if="curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && (scope.row.status === 'PREPARE' || scope.row.status === 'PENDING')"
v-if="(curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && (scope.row.status === 'PREPARE' || scope.row.status === 'PENDING')) || (curQcType === 'IQC' && (scope.row.status === 'PREPARE'))"
@click="qcLineClick(scope.row, true, 'firstEdit')"
>
查看编辑
</button>
<button
class="uni-button"
style="margin-left: 10rpx"
size="mini"
type="primary"
v-if="(curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && scope.row.status === 'CONFIRMED') || curQcType === 'PATROL'"
v-if="(curQcType === 'FIRST' && scope.row.ipqcType === 'FIRST' && scope.row.status === 'CONFIRMED') || curQcType === 'PATROL' || curQcType === 'IQC'"
@click="qcLineClick(scope.row, false, 'firstView')"
>
查看
......@@ -69,6 +70,7 @@
</view>
</view>
<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" />
<iqcDialog v-if="iqcFlag" :visible.sync="iqcFlag" :currentItem="qcForm" :btnType="btnType" :curQcType="curQcType" :showIpqcConfirmButton="showIpqcConfirmButton" ref="iqcDialog" @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>
......@@ -328,6 +330,7 @@ import UniEasyinput from '../../../uni_modules/uni-easyinput/components/uni-easy
import User from '@/components/User/User.vue';
import zjList from './components/zjList.vue';
import addDialog from './components/addDialog.vue';
import iqcDialog from './components/iqcDialog.vue';
export default {
name: 'QcContent',
......@@ -337,13 +340,18 @@ export default {
UniEasyinput,
User,
zjList,
addDialog
addDialog,
iqcDialog
},
dicts: ['mes_ipqc_type', 'mes_qc_result', 'mes_order_status', 'mes_defect_level'],
computed: {
tableColumn() {
if (this.curQcType === 'FIRST' || this.curQcType === 'SJQR') {
return this.tableSjColumn;
} else if(this.curQcType === 'IQC'){
let list = JSON.parse(JSON.stringify(this.tableSjColumn))
list[0].name = 'iqcCode'
return list
} else {
return this.tableDefaultColumn;
}
......@@ -355,6 +363,7 @@ export default {
qcAddIndex: null,
zjVisible: false,
addQuFlag: false,
iqcFlag: false,
qcAddList: [],
tableSjColumn: [
{
......@@ -568,7 +577,9 @@ export default {
console.log(this.$refs.zjListRef.tableSelectData, 'this.$refs.zjListRef.tableSelectData');
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 {
} else if (this.iqcFlag) {
this.$refs.iqcDialog.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)
......@@ -590,7 +601,12 @@ export default {
if (this.curQcType == 'SJQR') {
params = { status: 'PENDING', ipqcType: 'FIRST' };
}
const res = await this.$u.api.ipqcList(params);
let res = null
if (type === 'IQC') {
res = await this.$u.api.iqcList();
} else {
res = await this.$u.api.ipqcList(params);
}
if (res.code === 200) {
this.qcList = res.rows;
} else {
......@@ -616,6 +632,10 @@ export default {
},
async submitIpqc(params={}) {
if (this.curQcType === 'IQC') {
this.getIpqcList(this.curQcType);
return
}
console.log('params', params)
// if (this.btnType === 'sjqrFinish') {
// this.firstCONFIRMED(this.qcForm);
......@@ -745,7 +765,9 @@ export default {
this.qcForm = {
quantityCheck: 0
};
if(this.curQcType !== 'FINAL') {
if (this.curQcType === 'IQC') {
this.iqcFlag = true
} else if (this.curQcType !== 'FINAL') {
this.addQuFlag = true
} else {
this.qcModalFlag = true;
......@@ -797,7 +819,9 @@ export default {
qcLineClick(item, flag, btnType) {
this.qcAddList = []
this.btnType = btnType
if(this.curQcType !== 'FINAL') {
if (this.curQcType === 'IQC') {
this.iqcFlag = true
} else if(this.curQcType !== 'FINAL') {
this.addQuFlag = true
} else {
this.qcModalFlag = true;
......@@ -834,6 +858,7 @@ export default {
closemodel(){
this.btnType = ''
this.addQuFlag = false
this.iqcFlag = false
},
addQcdeffect() {
this.defectrecordList.push({
......
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