This commit is contained in:
caoqianming 2024-08-13 10:57:03 +08:00
commit 3e7473444f
4 changed files with 78 additions and 38 deletions

View File

@ -185,5 +185,11 @@ export default {
);
},
},
submit: {
name: "提交",
req: async function (id) {
return await http.post(`${config.API_URL}/qm/ftestwork/${id}/submit/`);
},
},
},
};

View File

@ -31,7 +31,6 @@
row-key="id"
:params="params"
:query="params"
@row-click="table_detail"
>
<el-table-column type="index" width="50" />
<el-table-column label="检验日期" prop="test_date"></el-table-column>
@ -41,11 +40,15 @@
<el-table-column label="抽检数" prop="count_sampling"> </el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="不合格数" prop="count_notok"> </el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<el-table-column label="操作" fixed="right" width="145">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)">编辑</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)">删除</el-link>
<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-link type="primary" v-else @click="table_show(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="danger" v-else @click="table_revert(scope.row)">撤回</el-link> -->
</template>
</el-table-column>
</scTable>
@ -109,7 +112,7 @@ export default {
this.dialog.detail = false;
this.$refs.table.refresh();
},
//
//
table_add() {
let mode = this.mgroupName+"Add";
console.log('mode',mode)
@ -118,7 +121,7 @@ export default {
this.$refs.saveDialog.open(mode);
});
},
//
//
table_edit(row) {
let mode = this.mgroupName+"Edit";
this.dialog.save = true;
@ -126,21 +129,32 @@ export default {
this.$refs.saveDialog.open(mode).setData(row);
});
},
//
table_detail(row) {
this.mlogId = row.id;
this.dialog.detail = true;
table_show(row) {
let mode = this.mgroupName+"Show";
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.detailDialog.open();
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.wpm.mlog.delete.req(id).then((res) => {
this.$API.qm.ftestwork.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
@ -150,22 +164,6 @@ export default {
});
});
},
//
mlogRevert(row) {
this.$confirm(`确定撤回该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.revert.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("撤回成功");
}
});
});
},
//
selectionChange(selection) {

View File

@ -21,6 +21,7 @@
v-model="form.batch"
placeholder="物料批次"
clearable
:disabled="mode=='sizeShow'||mode=='facadeShow'"
style="width: 100%"
@change="handleChange"
>
@ -30,6 +31,8 @@
:label="item.batch"
:value="item.id"
>
<span>{{item.batch}}</span>
<span style="float:right">({{item.count}})</span>
</el-option>
</el-select>
</el-form-item>
@ -37,7 +40,7 @@
<el-col :md="12" :sm="24">
<el-form-item label="总数">
<el-input
v-model="form.count"
v-model="formCount"
disabled
></el-input>
</el-form-item>
@ -49,6 +52,7 @@
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
/>
</el-form-item>
</el-col>
@ -56,9 +60,10 @@
<el-form-item label="检验数量">
<el-input-number
controls-position="right"
v-model="form.count_sampling"
v-model="form.count"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCheckChange"
></el-input-number>
</el-form-item>
@ -78,6 +83,7 @@
v-model="form.count_notok"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange('notok')"
></el-input-number>
</el-form-item>
@ -91,6 +97,7 @@
v-model="count_notok_json.count_n_hqnj"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -102,6 +109,7 @@
v-model="count_notok_json.count_n_hqnjyd"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -113,6 +121,7 @@
v-model="count_notok_json.count_n_hqwj"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -124,6 +133,7 @@
v-model="count_notok_json.count_n_hqwjyd"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -135,6 +145,7 @@
v-model="count_notok_json.count_n_wj"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -146,6 +157,7 @@
v-model="count_notok_json.count_n_yd"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -157,6 +169,7 @@
v-model="count_notok_json.count_n_txd"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -168,6 +181,7 @@
v-model="count_notok_json.count_n_hd"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -181,6 +195,7 @@
v-model="count_notok_json.count_n_qp"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -192,6 +207,7 @@
v-model="count_notok_json.count_n_swen"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -203,6 +219,7 @@
v-model="count_notok_json.count_n_bb"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -214,6 +231,7 @@
v-model="count_notok_json.count_n_zb"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -225,6 +243,7 @@
v-model="count_notok_json.count_n_hs"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -236,6 +255,7 @@
v-model="count_notok_json.count_n_md"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -247,6 +267,7 @@
v-model="count_notok_json.count_n_hqbx"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -258,6 +279,7 @@
v-model="count_notok_json.count_n_dj"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -269,6 +291,7 @@
v-model="count_notok_json.count_n_ps"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -280,6 +303,7 @@
v-model="count_notok_json.count_n_lq"
style="width: 100%"
precision="0"
:disabled="mode=='sizeShow'||mode=='facadeShow'"
@change="handleCountChange"
></el-input-number>
</el-form-item>
@ -287,7 +311,7 @@
</el-row>
</el-form>
</el-main>
<el-footer>
<el-footer v-if="mode!=='sizeShow'&&mode!=='facadeShow'">
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button>
<el-button @click="visible = false">取消</el-button>
@ -304,8 +328,10 @@ export default {
modeTitle: {
sizeAdd: "尺寸检验",
sizeEdit: "尺寸检验",
sizeShow: "尺寸检验",
facadeAdd: "外观和内质检验",
facadeEdit: "外观和内质检验",
facadeShow: "外观和内质检验",
},
loading: false,
form: {
@ -314,7 +340,6 @@ export default {
count: null,
count_ok: null,
count_notok: 0,
count_sampling:0,
count_notok_json:{}
},
count_notok_json:{
@ -355,6 +380,7 @@ export default {
},
],
},
formCount:null,
visible: false,
isSaveing: false,
options: [],
@ -373,7 +399,7 @@ export default {
return this;
},
handleCheckChange(){
this.form.count_ok = this.form.count_sampling-this.form.count_notok;
this.form.count_ok = this.form.count-this.form.count_notok;
},
handleCountChange(type){
if(type == 'notok'){
@ -414,7 +440,7 @@ export default {
this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_lq;
}
this.form.count_ok = this.form.count_sampling - this.form.count_notok;
this.form.count_ok = this.form.count - this.form.count_notok;
},
//
getMaterialBatch() {
@ -436,7 +462,7 @@ export default {
console.log(val);
that.options.forEach((item) => {
if (item.id == val) {
that.form.count = item.count;
that.form.count = that.formCount = item.count;
that.form.batch = item.batch;
that.form.material = item.material;
that.form.wm = item.id;
@ -479,7 +505,8 @@ export default {
//
setData(data) {
Object.assign(this.form, data);
this.form.test_group = this.form.split(",");
this.formCount = this.form.count;
// this.form.test_group = this.form.split(",");
},
//
setFilters(filters) {

View File

@ -67,6 +67,15 @@
prop="count"
min-width="80"
></el-table-column>
<el-table-column
v-if="mgroupName=='size'||mgroupName=='facade'"
label="检验状态"
>
<template #default="scope">
<el-tag type="success" v-if="scope.row.count_xtest == null">已检验</el-tag>
<el-tag type="primary" v-else>未检验 </el-tag>
</template>
</el-table-column>
<el-table-column
label="不合格标记"
prop="notok_sign_name"