Merge remote-tracking branch 'origin/master'

master
mengjiao 6 months ago
commit 8fd7b12cc8

@ -174,3 +174,9 @@ export function getCkeckProjectXJList(query) {
params: query params: query
}); });
} }
export function getWeightValue(recordId) {
return request({
url: '/quality/qcIncome/getWeightValue/' + recordId,
method: 'get'
})
}

@ -13,22 +13,22 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="最终判定结果" prop="checkResult"> <el-form-item label="最终判定结果" prop="checkResult">
<el-radio-group v-model="form.checkResult" > <el-radio-group v-model="form.checkResult" >
<el-radio :label="'1'">合格</el-radio> <el-radio :label="'Y'">合格</el-radio>
<el-radio :label="'0'">不合格</el-radio> <el-radio :label="'N'">不合格</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="是否发起OA" prop="startOA"> <el-form-item label="是否发起OA" prop="startOA">
<el-radio-group v-model="form.startOA"> <el-radio-group v-model="form.startOA">
<el-radio :label="'Y'"></el-radio> <el-radio :label="'1'"></el-radio>
<el-radio :label="'N'"></el-radio> <el-radio :label="'0'"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item v-if="form.startOA == 'Y'" label="来料类别" prop="materialType"> <el-form-item v-if="form.startOA == '1'" label="来料类别" prop="materialType">
<el-select v-model="queryParams.materialType" placeholder="请选择检验规则属性" clearable> <el-select v-model="form.materialType" placeholder="请选择检验规则属性" clearable>
<el-option <el-option
v-for="dict in dict.type.material_type_oa" v-for="dict in dict.type.material_type_oa"
:key="dict.value" :key="dict.value"
@ -41,8 +41,8 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item v-if="form.startOA == 'Y'" label="物料来源" prop="materialType"> <el-form-item v-if="form.startOA == '1'" label="物料来源" prop="materialType">
<el-select v-model="queryParams.materialFrom" placeholder="请选择检验规则属性" clearable> <el-select v-model="form.materialFrom" placeholder="请选择检验规则属性" clearable>
<el-option <el-option
v-for="dict in dict.type.material_from_oa" v-for="dict in dict.type.material_from_oa"
:key="dict.value" :key="dict.value"
@ -53,7 +53,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-form-item v-if="form.startOA == 'Y'" label="不合格描述" prop="remark"> <el-form-item v-if="form.startOA == '1'" label="不合格描述" prop="remark">
<el-input type='textarea' v-model="form.remark" placeholder="请输入不合格描述" /> <el-input type='textarea' v-model="form.remark" placeholder="请输入不合格描述" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -139,7 +139,7 @@
</el-dialog> </el-dialog>
<!--测量值弹窗--> <!--测量值弹窗-->
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body> <el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic"> <el-form :model="dynamicValidateForm" v-loading="dyloading" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-form-item <el-form-item
v-for="(domain, index) in dynamicValidateForm.domains" v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index" :label="'测量值' + index"
@ -156,7 +156,7 @@
<el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button> <el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button>
<el-button @click="addDomain"></el-button> <el-button @click="addDomain"></el-button>
<el-button v-if="this.weight === '1'" type="primary" icon="el-icon-refresh" @click="handleWeightValue"></el-button> <el-button v-if="this.weight === '1'" type="primary" icon="el-icon-refresh" @click="handleWeightValue"></el-button>
<el-button @click="resetForm('dynamicValidateForm')"></el-button> <el-button @click="handleResetForm()"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -193,6 +193,7 @@ export default {
return { return {
viewStatus : '0', viewStatus : '0',
showFlag: false, showFlag: false,
dyloading: false,
// //
selectedRows: {}, selectedRows: {},
// //
@ -222,8 +223,8 @@ export default {
}, },
data:{}, data:{},
form:{ form:{
checkResult: '1', checkResult: 'Y',
startOA: 'N', startOA: '0',
}, },
dynamicValidateForm: { dynamicValidateForm: {
domains: [{ domains: [{
@ -333,8 +334,8 @@ export default {
projectType: null, projectType: null,
}; };
this.resetForm("form"); this.resetForm("form");
this.form.checkResult = '1'; this.form.checkResult = 'Y';
this.form.startOA = 'N'; this.form.startOA = '0';
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -389,6 +390,10 @@ export default {
this.showFlag = false; this.showFlag = false;
this.reset(); this.reset();
}, },
// 使nextTick
handleResetForm() {
this.dynamicValidateForm.domains = [{ value: ''}];
},
// /YN // /YN
/* handleStatusChange(row) { /* handleStatusChange(row) {
@ -405,16 +410,17 @@ export default {
// //
/** 检测结果钮操作 */ /** 检测结果钮操作 */
handleShowValue(row) { handleShowValue(row) {
this.handleResetForm();
this.valueOpen = true; this.valueOpen = true;
this.recordId = row.recordId; this.recordId = row.recordId;
this.weight = row.weight; this.weight = row.weight;
const actualValue = row.actualValue; const actualValue = row.actualValue;
if(actualValue !== null || actualValue !== ''){ if(actualValue !== null && actualValue !== '') {
this.dynamicValidateForm.domains = []; this.dynamicValidateForm.domains = [];
let values = actualValue.split(","); let values = actualValue.split(",");
values.forEach((item,index) => { values.forEach((item,index) => {
this.dynamicValidateForm.domains.push({ this.dynamicValidateForm.domains.push({
value: item, value: item.toString(),
key: Date.now() + index key: Date.now() + index
}); });
}); });
@ -523,13 +529,14 @@ export default {
this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0)); this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0));
}, },
handleWeightValue() { handleWeightValue() {
this.dyloading = true;
const recordId = this.recordId; const recordId = this.recordId;
getWeightValue(recordId).then(response => { getWeightValue(recordId).then(response => {
if(response.code === 200) { if(response.code === 200) {
let value = response.msg; let value = response.msg;
if(value !== null || value !== ''){ if(value !== null && value !== ''){
let arr = value.split(","); let arr = value.split(",");
console.log(arr); this.dynamicValidateForm.domains = [];
arr.forEach((item,index)=> { arr.forEach((item,index)=> {
this.dynamicValidateForm.domains.push({ this.dynamicValidateForm.domains.push({
value: item, value: item,
@ -537,8 +544,7 @@ export default {
}); });
}); });
} }
this.dyloading = false;
console.log(this.dynamicValidateForm.domains);
}else { }else {
this.$modal.msgError(response.msg); this.$modal.msgError(response.msg);
} }

Loading…
Cancel
Save