208 lines
5.7 KiB
Vue
208 lines
5.7 KiB
Vue
<template>
|
|
<el-container>
|
|
<el-header>
|
|
<div class="left-panel">
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-plus"
|
|
@click="table_add"
|
|
v-auth="'mlog.create'"
|
|
>新增
|
|
</el-button>
|
|
</div>
|
|
<div class="right-panel">
|
|
<el-input
|
|
style="margin-right: 5px"
|
|
v-model="query.search"
|
|
placeholder="名称"
|
|
clearable
|
|
></el-input>
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-search"
|
|
@click="handleQuery"
|
|
></el-button>
|
|
</div>
|
|
</el-header>
|
|
<el-main>
|
|
<scTable
|
|
ref="table"
|
|
:apiObj="apiObj"
|
|
row-key="id"
|
|
:params="params"
|
|
:query="params"
|
|
>
|
|
<!-- <el-table-column type="index" width="50" /> -->
|
|
<el-table-column label="检验类型" width="80">
|
|
<template #default="scope">
|
|
<el-tag v-if="scope.row.type2 == 20" type="success">全检</el-tag>
|
|
<el-tag v-else-if="scope.row.type2 == 10" type="primary">抽检</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="检验日期" prop="test_date" width="100"></el-table-column>
|
|
<el-table-column label="批次号" prop="batch" min-width="120"> </el-table-column>
|
|
<el-table-column label="物料名" prop="material_name" show-overflow-tooltip min-width="120"> </el-table-column>
|
|
<el-table-column label="检验数" prop="count" min-width="80"> </el-table-column>
|
|
<el-table-column label="合格数" prop="count_ok" min-width="80"> </el-table-column>
|
|
<el-table-column label="不合格数" prop="count_notok" width="100"> </el-table-column>
|
|
<el-table-column label="提交时间" prop="submit_time" width="150"></el-table-column>
|
|
<el-table-column label="操作" fixed="right" width="145">
|
|
<template #default="scope">
|
|
<el-link type="primary" v-if="scope.row.submit_user==null" @click="table_submit(scope.row)">提交</el-link>
|
|
<el-divider direction="vertical" v-if="scope.row.submit_user==null"></el-divider>
|
|
<el-link type="primary" v-if="scope.row.submit_user==null" @click="table_edit(scope.row)">编辑</el-link>
|
|
<el-divider direction="vertical" v-if="scope.row.submit_user==null"></el-divider>
|
|
<el-link type="danger" v-if="scope.row.submit_user==null" @click="table_del(scope.row)">删除</el-link>
|
|
<el-link type="primary" v-if="scope.row.submit_user!==null" @click="handlePrint(scope.row)">打印</el-link>
|
|
<el-divider direction="vertical" v-if="scope.row.submit_user!==null"></el-divider>
|
|
<el-link type="primary" v-if="scope.row.submit_user!==null" @click="table_show(scope.row)">查看</el-link>
|
|
<!-- <el-link type="danger" v-else @click="table_revert(scope.row)">撤回</el-link> -->
|
|
</template>
|
|
</el-table-column>
|
|
</scTable>
|
|
</el-main>
|
|
<save-dialog
|
|
v-if="dialog.save"
|
|
ref="saveDialog"
|
|
:process="processId"
|
|
:mgroup="mgroupId"
|
|
:dept="deptId"
|
|
@success="handleSaveSuccess"
|
|
@closed="dialog.save = false"
|
|
>
|
|
</save-dialog>
|
|
<el-dialog v-model="printVisible" width="1200px">
|
|
<print :baseData="rowItem" :type="type" @closePrint="printVisible=false"/>
|
|
</el-dialog>
|
|
</el-container>
|
|
</template>
|
|
<script>
|
|
import print from "./../setting/print/A4.vue";
|
|
import saveDialog from "./products_form.vue";
|
|
|
|
export default {
|
|
props: {
|
|
mgroupName: {
|
|
// cc wg
|
|
type: String,
|
|
default: "",
|
|
},
|
|
},
|
|
name: "mlog",
|
|
components: {
|
|
saveDialog,print
|
|
},
|
|
data() {
|
|
return {
|
|
apiObj: null,
|
|
params: { material__process__name: "" },
|
|
query: {},
|
|
dialog: {
|
|
save: false,
|
|
detail: false,
|
|
},
|
|
type:'',
|
|
tableData: [],
|
|
selection: [],
|
|
rowItem:{},
|
|
mtask: "",
|
|
mlogId: "",
|
|
deptId: null,
|
|
processId: "",
|
|
processCate: "",
|
|
printVisible:false,
|
|
};
|
|
},
|
|
mounted() {
|
|
let that = this;
|
|
if(that.mgroupName == "size"){
|
|
this.type = "productstest_cc";
|
|
this.params.material__process__name = "一次超洗";
|
|
}else{
|
|
this.type = "productstest_wg";
|
|
this.params.material__process__name = "二次超洗";
|
|
}
|
|
that.apiObj= this.$API.qm.ftestwork.list;
|
|
},
|
|
methods: {
|
|
detailClose() {
|
|
this.dialog.detail = false;
|
|
this.$refs.table.refresh();
|
|
},
|
|
//添加检验
|
|
table_add() {
|
|
let mode = this.mgroupName+"Add";
|
|
console.log('mode',mode)
|
|
this.dialog.save = true;
|
|
this.$nextTick(() => {
|
|
this.$refs.saveDialog.open(mode);
|
|
});
|
|
},
|
|
//编辑检验
|
|
table_edit(row) {
|
|
let mode = this.mgroupName+"Edit";
|
|
this.dialog.save = true;
|
|
this.$nextTick(() => {
|
|
this.$refs.saveDialog.open(mode).setData(row);
|
|
});
|
|
},
|
|
table_show(row) {
|
|
let mode = this.mgroupName+"Show";
|
|
this.dialog.save = true;
|
|
this.$nextTick(() => {
|
|
this.$refs.saveDialog.open(mode).setData(row);
|
|
});
|
|
},
|
|
//提交检验
|
|
table_submit(row){
|
|
let that = this;
|
|
that.$API.qm.ftestwork.submit.req(row.id).then((res) => {
|
|
if (res.err_msg) {
|
|
that.$message.error(res.err_msg);
|
|
} else {
|
|
that.$refs.table.refresh();
|
|
that.$message.success("提交成功");
|
|
}
|
|
});
|
|
},
|
|
//检验删除
|
|
table_del(row) {
|
|
this.$confirm(`确定删除吗?`, "提示", {
|
|
type: "warning",
|
|
}).then(() => {
|
|
var id = row.id;
|
|
this.$API.qm.ftestwork.delete.req(id).then((res) => {
|
|
if (res.err_msg) {
|
|
this.$message.error(res.err_msg);
|
|
} else {
|
|
this.$refs.table.refresh();
|
|
this.$message.success("删除成功");
|
|
}
|
|
});
|
|
});
|
|
},
|
|
|
|
//表格选择后回调事件
|
|
selectionChange(selection) {
|
|
this.selection = selection;
|
|
},
|
|
//搜索
|
|
handleQuery() {
|
|
this.$refs.table.queryData(this.query);
|
|
},
|
|
//本地更新数据
|
|
//新增岗位后更新数据
|
|
handleSaveSuccess(data, mode) {
|
|
this.dialog.save = true;
|
|
this.$refs.table.refresh();
|
|
},
|
|
//打印
|
|
handlePrint(row){
|
|
this.rowItem = row;
|
|
this.printVisible = true;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped></style>
|