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

巡检单临时提交

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