成品检验&0119的问题

This commit is contained in:
shijing 2024-01-19 11:11:07 +08:00
parent b3edf33de9
commit 3a3d89d127
10 changed files with 619 additions and 194 deletions

View File

@ -950,6 +950,17 @@ const routes = [
"perms": ["producttest"]
},
"component": "qm/product"
},
{
"name": "productDetail",
"path": "/qm/productDetail",
"meta": {
"title": "成品检验",
"icon": "el-icon-cellphone",
"perms": ["producttest"],
"hidden":true
},
"component": "qm/productCheck"
}
]
},

View File

@ -45,67 +45,67 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="不合格数" prop="count_notok">
<el-input-number v-model="form.count_notok" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_notok" :min="0" style="width:100%" disabled controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="炸纹">
<el-input-number v-model="form.count_n_zw" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_zw" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="条纹">
<el-input-number v-model="form.count_n_tw" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_tw" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number v-model="form.count_n_qp" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_qp" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="弯曲">
<el-input-number v-model="form.count_n_wq" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_wq" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="断裂">
<el-input-number v-model="form.count_n_dl" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_dl" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="偏壁">
<el-input-number v-model="form.count_n_pb" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_pb" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="大小头">
<el-input-number v-model="form.count_n_dxt" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_dxt" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结石">
<el-input-number v-model="form.count_n_js" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_js" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气线">
<el-input-number v-model="form.count_n_qx" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_qx" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number v-model="form.count_n_qt" :min="0" style="width:100%" controls-position="right">
<el-input-number v-model="form.count_n_qt" @change="countNotOkSun" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
@ -518,6 +518,19 @@ export default {
that.form.batch = that.objitem.batch;
that.form.count_bag = that.objitem.count_bag;
}
if(that.type=='do_in'&&that.cate=='halfgood'){
this.form.count_notok=0;
this.form.count_n_zw=0;
this.form.count_n_tw=0;
this.form.count_n_qp=0;
this.form.count_n_wq=0;
this.form.count_n_dl=0;
this.form.count_n_pb=0;
this.form.count_n_dxt=0;
this.form.count_n_js=0;
this.form.count_n_qx=0;
this.form.count_n_qt=0;
}
},
methods: {
//
@ -552,6 +565,19 @@ export default {
},
countChange(){
},
countNotOkSun() {
this.form.count_notok =
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js+
this.form.count_n_qx+
this.form.count_n_qt;
},
//
submit() {

View File

@ -76,6 +76,7 @@
v-model="form.test_user"
placeholder="检验员"
clearable
filterable
style="width:100%"
>
<el-option
@ -243,7 +244,7 @@ export default {
//
getTextItem(){
let that = this;
that.$API.qm.getTestItem.get({tag:'behavior',page:0}).then(res=>{
that.$API.qm.getTestItem.get({tag:'performance',page:0}).then(res=>{
that.behaviors = res;
})
},
@ -256,8 +257,8 @@ export default {
//
getUserList(){
let that = this;
this.$API.system.user.list.req({page_size:20,page:1}).then(res=>{
that.userList = res.results;
this.$API.system.user.list.req({page:0,belong_dept__name:'检验管理部'}).then(res=>{
that.userList = res;
});
},
getProcess(){

View File

@ -15,7 +15,7 @@
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="test_date" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
<el-table-column label="工序" prop="test_numer">
</el-table-column>
<el-table-column label="检测内容及标准">
<template #default="scope">

View File

@ -45,6 +45,22 @@
</el-table-column>
</el-table>
<el-row style="margin-top:14px">
<el-col :md="12" :sm="24">
<el-form-item label="检验工序集" prop="test_group">
<el-select
v-model="form.test_group"
placeholder="检验工序集"
clearable style="width:100%"
>
<el-option
v-for="item in processOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" prop="is_ok">
<el-form-item label="合格判定" prop="is_ok">
<el-select
@ -116,7 +132,7 @@ export default {
isSaveing: false,
userList:[],
options: [],
processOptions: [],
processOptions: ['粗中细磨','抛光','半抛光'],
deptOptions: [],
selectionFilters: [],
setFiltersVisible: false,
@ -126,7 +142,7 @@ export default {
},
mounted() {
this.getTextItem();
this.getProcess();
// this.getProcess();
this.getUserList();
this.getDeptOptions();
},
@ -168,35 +184,41 @@ export default {
that.userList = res.results;
});
},
getProcess(){
let that = this;
this.$API.mtm.process.list.req({page:0}).then(res=>{
let arr = [];
res.forEach(item => {
if(item.name=='粗中细磨'){
arr.push(item);
}
})
that.processOptions = arr;
})
},
// getProcess(){
// let that = this;
// this.$API.mtm.process.list.req({page:0}).then(res=>{
// let arr = [];
// res.forEach(item => {
// if(item.name==''){
// arr.push(item);
// }
// })
// that.processOptions = arr;
// })
// },
//
submit() {
console.log('111111')
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
this.form.test_group = this.form.test_group.join(',')
if (this.mode == "add") {
res = await this.$API.qm.ftest.create.req(this.form);
this.$API.qm.ftest.create.req(this.form).then(res=>{
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
})
} else if (this.mode == "edit") {
res = await this.$API.qm.ftest.update.req(this.form.id,this.form);
this.$API.qm.ftest.update.req(this.form.id,this.form).then(res=>{
this.isSaveing = false;
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
})
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;
@ -208,7 +230,7 @@ export default {
//
setData(data) {
Object.assign(this.form, data);
this.form.test_group = this.form.split(',')
// this.form.test_group = this.form.split(',')
},
//
setFilters(filters) {

View File

@ -26,11 +26,11 @@
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
<el-table-column label="日期" prop="test_date" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="number">
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="总数" prop="model">
<el-table-column label="总数" prop="count">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
@ -43,50 +43,57 @@
</el-table-column>
</scTable>
</el-main>
<check-dialog v-if="dialog.check" ref="checkDialog" @success="handleCheckSuccess" @closed="dialog.check = false">
</check-dialog>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleCheckSuccess" @closed="dialog.check = false">
</save-dialog>
</el-container>
</template>
<script>
import checkDialog from "./product_form.vue";
import saveDialog from "./product_form.vue";
export default {
name: "rparty",
components:{
checkDialog
saveDialog
},
data() {
return {
// apiObj: this.$API.qm.list,
apiObj: this.$API.qm.ftestwork.list,
dialog:{
check:false,
},
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
selection: [],
state_: {
'R': '不合格',
'S': '合格',
},
};
},
methods: {
add() {
this.dialog.check = true;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("add");
this.$refs.saveDialog.open("add");
});
},
table_edit(row) {
this.dialog.check = true;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
this.$refs.saveDialog.open("edit").setData(row);
});
},
table_del(){ },
table_del(row){
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
table_show(row) {
this.dialog.save = true;
@ -94,8 +101,21 @@ import checkDialog from "./product_form.vue";
this.$refs.saveDialog.open("show",10).setData(row);
});
},
table_check(){
table_check(row){
// console.log('ftestWork',row)
let type = '';
if(row.material_name.indexOf('棒')>-1){
type = 'bang';
}else{
type='guan';
}
this.$router.push({
name: "productDetail",
query: {
type:type,
ftestWork:row.id
},
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
@ -103,6 +123,10 @@ import checkDialog from "./product_form.vue";
resetQuery() {
this.query = {};
},
handleCheckSuccess(){
this.dialog.save = false;
this.$refs.table.refresh();
},
},
};
</script>

View File

@ -3,59 +3,175 @@
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="日期">{{ mioObj.test_date }}</el-descriptions-item>
<el-descriptions-item label="批次号">{{ mioObj.number }}</el-descriptions-item>
<el-descriptions-item label="总数">{{ mioObj.count }}</el-descriptions-item>
<el-descriptions-item label="日期">{{ workObj.test_date }}</el-descriptions-item>
<el-descriptions-item label="批次号">{{ workObj.batch }}</el-descriptions-item>
<el-descriptions-item label="总数">{{ workObj.count }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="物料明细" shadow="hover">
<div>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-if="mioObj.state == 10">新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="抽检编号" prop="number">
</el-table-column>
<el-table-column label="检验项目">
<el-card style="width: 100%" header="检验记录" shadow="hover">
<!-- 预制棒 -->
<sc-form-table
ref="formTable"
v-if="type=='bang'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="val" label="抽检编号" min-width="120">
<template #default="scope">
<div v-for="item in scope.row.ftestitems" :key="item.id">
{{ item.testitem_description }}
</div>
<span v-if="scope.row.id">{{scope.row.test_numer}}</span>
<el-input v-else v-model="scope.row.test_numer" placeholder="抽检编号"></el-input>
</template>
</el-table-column>
<el-table-column label="检验值" prop="production_date">
<template #default="scope">
<div v-for="item in scope.row.ftestitems" :key="item.id">
{{ item.test_val }}
</div>
<el-table-column label="检验记录" align="center">
<template v-for="(item0,$index) in ftestitems" :key="item0.id">
<el-table-column prop="test_val" :label="item0.name">
<template #default="scope">
<el-input-number v-model="scope.row.ftestitems[$index].test_val" :disabled="!scope.row.isEdit" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column label="结论">
<el-table-column prop="test_val" label="合格判定" width="100">
<template #default="scope">
<el-tag v-if="scope.row.is_ok" type="success">
合格
</el-tag>
<el-tag v-else type="warning">
不合格
</el-tag>
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width:100%"
>
<el-option label="是" :value="true"/>
<el-option label="否" :value="false"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="检验员" prop="test_user_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100">
<el-table-column prop="test_user" label="检验人" width="120">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'ftest.update'">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'ftest.delete'">删除
</el-link>
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width:100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
</scTable>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
text type="primary"
size="small"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-button>
<el-button
text type="primary"
size="small"
v-else
@click="editCheck(scope.row)"
>编辑</el-button>
<el-button
text
type="danger"
size="small"
@click="delCheck(scope.row.id)"
>删除</el-button>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
ref="formTable"
v-else-if="type=='guan'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="val" label="抽检编号">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.test_numer}}</span>
<el-input v-else v-model="scope.row.test_numer" placeholder="抽检编号"></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template v-for="(item,$index) in ftestitems" :key="item.id">
<el-table-column prop="test_val" :label="item.name">
<template #default="scope">
<el-input-number v-model="scope.row.ftestitems[$index].test_val" :disabled="!scope.row.isEdit" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column prop="test_val" label="合格判定" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width:100%"
>
<el-option label="是" :value="true"/>
<el-option label="否" :value="false"/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="test_user" label="检验人" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width:100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
text type="primary"
size="small"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-button>
<el-button
text type="primary"
size="small"
v-else
@click="editCheck(scope.row)"
>编辑</el-button>
<el-button
text
type="danger"
size="small"
@click="delCheck(scope.row.id)"
>删除</el-button>
</template>
</el-table-column>
</sc-form-table>
</el-card>
</div>
</div>
@ -75,75 +191,113 @@ export default {
},
data() {
return {
addTemplate:{
ftestitems:[
{test_val:'',check_val:'',testitem:''},
{test_val:'',check_val:'',testitem:''},
{test_val:'',check_val:'',testitem:''},
{test_val:'',check_val:'',testitem:''},
],
test_date:'',//work
test_numer:'',
is_ok:true,
test_user:'',
ftest_work:'',//work
isEdit:true,
},
ftestitems:[],
dialog: {
check:false,
save: false,
},
apiObj: null,
params: {},
mioId: '',
mioObj: {},
selection: [],
stateDict: {
10: '创建中',
20: '已提交'
},
typeDict: {
'do_out': '生产领料',
'sale_out': '销售发货',
'pur_in': '采购入库',
'do_in': '生产入库',
'other_in': '其他入库',
'other_out': '其他出库',
},
mioitemId:'',
formTableData: null,
ftestWork:'',
type:'',
cate:'',
objitem:{},
userList:[],
workObj:{},
};
},
watch: {
formTableData(newValue, oldValue) {
console.log('值发生了变化:', newValue);
this.testNumberChange();
}
},
mounted() {
this.type = this.$route.query.type;
this.cate = this.$route.query.cate;
this.mioId = this.$route.query.mio;
this.params.mio = this.$route.query.mio;
this.apiObj = this.$API.inm.mioitem.list;
this.getMio();
let that = this;
that.type = that.$route.query.type;
that.ftestWork = that.$route.query.ftestWork;
that.addTemplate.ftest_work = that.ftestWork;
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
that.workObj = res;
that.addTemplate.test_date = res.test_date;
that.addTemplate.test_numer = res.batch+'_1';
that.getCheckList();
})
let tag = that.type == 'bang'?'prod_bang':'prod_guan';
that.getTestItem(tag,that.ftestWork);
that.getUserList(that.ftestWork);
},
methods: {
getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res;
this.belongDeptId = res.belong_dept
//
getTestItem(tag,ftestWork){
let that = this;
that.$API.qm.getTestItem.get({tag:tag,page:0,ftest_work:ftestWork}).then(res=>{
// console.log(res)
let arr = res;
that.ftestitems = res;
let ftestitems = [];
arr.forEach(item => {
let obj = {};
obj.test_val = 0;
obj.testitem = item.id;
ftestitems.push(obj);
});
that.addTemplate.ftestitems = ftestitems;
})
},
//
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", this.mioObj.type);
//
getUserList(){
let that = this;
this.$API.system.user.list.req({page:0}).then(res=>{
that.userList = res;
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
//
getCheckList(ftestwork){
let that = this;
that.formTableData = [];
this.$API.qm.ftest.list.req({page:0,type:'prod',ftest_work:ftestwork}).then(res=>{
if(res.length>0){
that.addTemplate.test_numer = that.workObj.batch+'_'+(res.length+1);
console.log('that.addTemplate.test_numer',that.addTemplate.test_numer)
res.forEach(item=>{
let obj = {};
obj = item;
obj.isEdit = false;
that.formTableData.push(obj);
})
}
})
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
testNumberChange(){
this.addTemplate.test_numer = this.workObj.batch+'_'+(this.formTableData.length+1);
},
editCheck(row){
this.formTableData.forEach((item,index)=>{
if(item.id == row.id){
this.formTableData[index].isEdit = true;
}
})
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.mioitem.delete.req(row.id).then((res) => {
this.$API.qm.ftest.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
@ -152,29 +306,17 @@ mioitemId:'',
});
}).catch(() => { });
},
table_check(row){
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("add");
});
},
check_Show(row){
this.mioitemId = row.id;
this.objitem = row;
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("show").setData(row);
saveCheck(row){
this.$API.qm.ftest.create.req(row).then((res) => {
this.$message.success("操作成功");
this.$refs.table.refresh();
}).catch((err) => {
return err;
});
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
this.$refs.table.refresh();
},
handleCheckSuccess(){
this.$refs.table.refresh();

View File

@ -15,33 +15,224 @@
label-width="100px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
v-model="form.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号">
<el-input v-model="form.name" placeholder="批次号"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="总数">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检数">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col>
<!-- 预制棒 -->
<sc-form-table
v-model="form.ftestitems"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="val" label="抽检编号">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.name}}</span>
<el-input v-else v-model="scope.row.name" placeholder="名称"></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<el-table-column prop="test_val" label="长度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="直径/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="椭圆度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="锥度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="结石、沙石、黑点">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="条纹">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="气泡">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="test_val" label="合格判定" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
style="width:100%"
>
<el-option label="是" value="true"/>
<el-option label="否" value="false"/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="test_user" label="检验人" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
style="width:100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
text
type="danger"
size="small"
@click="userPostDel(scope.row.id)"
>删除</el-button>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
v-model="form.ftestitems"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="val" label="抽检编号">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.name}}</span>
<el-input v-else v-model="scope.row.name" placeholder="名称"></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<el-table-column prop="test_val" label="长度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="内径/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="椭圆度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="壁厚/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="壁厚偏差/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="锥度/mm">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="气泡(线)">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="结石、杂志">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="条纹">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="划伤">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="test_val" label="水雾">
<template #default="scope">
<el-input-number v-model="scope.row.test_val" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="test_val" label="合格判定" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
style="width:100%"
>
<el-option label="是" value="true"/>
<el-option label="否" value="false"/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="test_user" label="检验人" min-width="120" align="center">
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
style="width:100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
text
type="danger"
size="small"
@click="userPostDel(scope.row.id)"
>删除</el-button>
</template>
</el-table-column>
</sc-form-table>
</el-row>
<el-table :data="form.ftestitems" border placeholder="暂无数据">
<el-table-column prop="testitem" label="抽检编号" min-width="100" align="center">

View File

@ -99,6 +99,7 @@ export default {
that.options.forEach(item => {
if(item.id==val){
that.form.count = item.count;
that.form.batch = item.batch;
that.form.material = item.material;
}
});
@ -110,14 +111,21 @@ export default {
this.isSaveing = true;
try {
if (this.mode == "add") {
res = await this.$API.qm.ftestwork.create.req(this.form);
this.$API.qm.ftestwork.create.req(this.form).then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
});
} else if (this.mode == "edit") {
res = await this.$API.qm.ftestwork.update.req(this.form.id,this.form);
this.$API.qm.ftestwork.update.req(this.form.id,this.form).then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
});
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
} catch (err) {
//
this.isSaveing = false;

View File

@ -1217,7 +1217,7 @@ export default {
let equipment_number = number.substring(number.length - 1);
this.equipment_number = equipment_number;
let index= this.form.index
if(index!==undefined&&index!==''&&index!==null){
if(index==undefined||index==''||index==null){
index=''
}
this.form.batch=this.material_model+'-'+equipment_number+'-'+this.dateNow+'-'+index;