fix:#413---成品检验

This commit is contained in:
shijing 2024-05-22 16:23:57 +08:00
parent a777e06d4b
commit b28eb27d77
2 changed files with 186 additions and 132 deletions

View File

@ -2,7 +2,11 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="add"
></el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker
@ -14,7 +18,8 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
>查询</el-button> >查询</el-button
>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -25,45 +30,70 @@
stripe stripe
:params="query" :params="query"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50" />
<el-table-column label="日期" prop="test_date" show-overflow-tooltip> <el-table-column
</el-table-column> label="日期"
<el-table-column label="批次号" prop="batch"> prop="test_date"
</el-table-column> show-overflow-tooltip
<el-table-column label="总数" prop="count"> >
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> </el-table-column>
<el-table-column label="总数" prop="count"> </el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template #default="scope"> <template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)">编辑</el-link> <el-link type="primary" @click="table_edit(scope.row)"
>编辑</el-link
>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_check(scope.row)">检验</el-link> <el-link type="primary" @click="table_check(scope.row)"
>检验</el-link
>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)">删除</el-link> <el-link type="danger" @click="table_del(scope.row)"
>删除</el-link
>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleCheckSuccess" @closed="dialog.check = false"> <save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog> </save-dialog>
<el-drawer title="成品检验" v-model="dialog.check" :size="'90%'">
<check-dialog
ref="checkDialogs"
:type="product_type"
:ftestWork="ftestWork"
>
</check-dialog>
</el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "./product_form.vue"; import saveDialog from "./product_form.vue";
export default { import checkDialog from "./productCheck.vue";
export default {
name: "rparty", name: "rparty",
components:{ components: {
saveDialog saveDialog,
checkDialog,
}, },
data() { data() {
return { return {
apiObj: this.$API.qm.ftestwork.list, apiObj: this.$API.qm.ftestwork.list,
dialog:{ dialog: {
check:false, save: false,
check: false,
}, },
query: { query: {
page:1, page: 1,
page_size:20, page_size: 20,
type:10 type: 10,
}, },
selection: [], selection: [],
}; };
@ -81,52 +111,65 @@ import saveDialog from "./product_form.vue";
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
}); });
}, },
table_del(row){ table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.qm.ftestwork.delete.req(row.id).then((res) => { .then(() => {
this.$API.qm.ftestwork.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
table_show(row) { table_show(row) {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row); this.$refs.saveDialog.open("show", 10).setData(row);
}); });
}, },
table_check(row){ table_check(row) {
// console.log('ftestWork',row) debugger;
let type = ''; console.log(row);
if(row.material_name.indexOf('棒')>-1){ let that = this;
type = 'bang'; let type = "";
}else{ if (row.material_name.indexOf("棒") > -1) {
type='guan'; type = "bang";
} else {
type = "guan";
} }
this.$router.push({ that.product_type = type;
name: "productDetail", that.ftestWork = row.id;
query: { that.dialog.check = true;
type:type, // this.$router.push({
ftestWork:row.id // name: "productDetail",
}, // query: {
}); // type: type,
// ftestWork: row.id,
// },
// });
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
handleCheckSuccess(){ handleSaveSuccess() {
this.dialog.save = false; this.dialog.save = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
handleCheckSuccess() {
this.dialog.check = false;
}, },
}; },
};
</script> </script>

View File

@ -295,6 +295,17 @@
import saveDialog from "./product_check.vue"; import saveDialog from "./product_check.vue";
export default { export default {
name: "mioitem", name: "mioitem",
emits: ["success", "closed"],
props: {
ftestWork: {
type: String,
default: "",
},
type: {
type: String,
default: "",
},
},
components: { components: {
saveDialog, saveDialog,
}, },
@ -318,8 +329,8 @@ export default {
apiObj: null, apiObj: null,
params: {}, params: {},
formTableData: [], formTableData: [],
ftestWork: "", // ftestWork: "",
type: "", // type: "",
userList: [], userList: [],
workObj: {}, workObj: {},
}; };
@ -332,8 +343,8 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
that.type = that.$route.query.type; // that.type = that.$route.query.type;
that.ftestWork = that.$route.query.ftestWork; // that.ftestWork = that.$route.query.ftestWork;
that.addTemplate.ftest_work = that.ftestWork; that.addTemplate.ftest_work = that.ftestWork;
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => { that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
that.workObj = res; that.workObj = res;