fix:交接单删除接口修正,以及状态判断

This commit is contained in:
shijing 2024-08-01 10:41:21 +08:00
parent dbec6f5396
commit e6b945b152
3 changed files with 94 additions and 55 deletions

View File

@ -134,10 +134,20 @@
highlightCurrentRow
>
<el-table-column type="index" width="50" />
<el-table-column
label="名称"
prop="mpoint_nickname"
<el-table-column label="名称">
<template #default="scope">
<span
v-if="
scope.row.mpoint_nickname !=
null
"
>
{{ scope.row.mpoint_nickname }}
</span>
<span v-else>
{{ scope.row.mpoint_name }}
</span>
</template>
</el-table-column>
<el-table-column label="班组时间">
<template #default="scope">
@ -173,38 +183,56 @@
</el-table-column>
</scTable>
</el-col>
<el-col :md="12" :sm="24" v-if="!mpFormVal">
<el-col :md="12" :sm="24" :key="updateKey">
<el-form
:key="updateKey"
ref="mpointForm"
:model="mpForm"
:rules="rules"
label-width="120px"
label-width="150px"
label-position="right"
v-if="form.mgroup_name == '石灰石破碎'"
v-if="mpointOptions.length > 0"
>
<template
v-for="item in mpointOptions"
:key="item.id"
>
<!-- 石灰石破碎 -->
<el-form-item :label="item.name">
<el-row>
<el-col :span="20">
<el-form-item
:label="item.name"
required="1"
>
<el-input-number
v-model="mpForm.val"
v-model="item.mpFormVal"
controls-position="right"
placeholder="请输入"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button
type="primary"
:loading="isSaveing"
:disabled="
item.mpFormValAble
"
@click="submit5(item)"
style="float: right"
>保存</el-button
>
</el-col>
</el-row>
</template>
</el-form>
<el-footer style="text-align: center">
<!-- <el-footer style="text-align: center">
<el-button
type="primary"
:loading="isSaveing"
@click="submit5"
>保存</el-button
>
</el-footer>
</el-footer> -->
</el-col>
</el-row>
</el-tab-pane>
@ -717,15 +745,11 @@ export default {
visible: false,
hideDelete: true,
isSaveing: false,
mpFormVal: false,
activeName: "first",
stlogTitle: "新增异常",
clickItem: {},
sflogItem: {},
form: {},
mpForm: {
val: null,
},
thirdForm: {
num: "",
},
@ -770,6 +794,7 @@ export default {
apiObj: null,
apiObjStlog: null,
heightTable: null,
updateKey: false,
};
},
mounted() {
@ -781,10 +806,7 @@ export default {
this.apiObjStlog = this.$API.wpm.stlog.list;
let form = this.$TOOL.data.get("sflogItem");
this.form = JSON.parse(form);
if (this.form.mgroup_name == "石灰石破碎") {
this.getMpoint();
this.getMpointStat();
}
this.getTeam();
this.getStlog();
let height = document.getElementById("elMain").clientHeight;
@ -820,7 +842,14 @@ export default {
form.enabled = 1;
form.mgroup = that.mgroupId;
that.$API.enm.mpoint.list.req(form).then((res) => {
that.mpointOptions = res;
if (res.length > 0) {
that.mpointOptions = [];
res.forEach((item) => {
item.mpFormVal = "";
that.mpointOptions.push(item);
});
that.getMpointStat();
}
});
},
getMpointStat() {
@ -830,23 +859,23 @@ export default {
form.has_create_by = 1;
form.mgroup = that.mgroupId;
that.$API.enm.mpoint.stat.req(form).then((res) => {
console.log("res", res);
that.mpointStat = res.results;
// this.$refs.mpointStatTable.queryData(form);
res.results.forEach((item) => {
let month_s =
item.month_s > 9 ? item.month_s : "0" + item.month_s;
let day_s = item.day_s > 9 ? item.day_s : "0" + item.day_s;
let work_date = item.year_s + "-" + month_s + "-" + day_s;
// debugger;
// console.log("work_date", work_date);
// console.log("that.form.work_date", that.form.work_date);
if (work_date == that.form.work_date) {
that.mpForm.val = item.val;
this.mpFormVal = true;
that.mpointOptions.forEach((item2) => {
if (item2.name == item.mpoint_name) {
item2.mpFormValAble = true;
item2.mpFormVal = item.val;
}
});
console.log(that.mpointOptions);
that.updateKey = !that.updateKey;
// that.$set(that.mpointOptions,"that.mpointOptions","");
that.$forceUpdate();
});
});
},
mpointStat_del(row) {
@ -857,10 +886,9 @@ export default {
that.$API.enm.mpoint.statDelete
.req(row.id)
.then((res) => {
that.$message.success("删除成功");
that.mpFormVal = false;
that.getMpointStat();
that.$refs.mpointStatTable.refresh();
that.$message.success("删除成功");
})
.catch((err) => {
this.$message.success(err);
@ -1067,20 +1095,21 @@ export default {
this.visible = true;
this.sflogExpVisiable = false;
},
submit5() {
//
submit5(item) {
let that = this;
that.isSaveing = true;
let obj = {};
obj.val = that.mpForm.val;
obj.val = item.mpFormVal;
obj.sflog = that.form.id;
obj.mgroup = that.mgroupId;
obj.mpoint = that.mpointOptions[0].id;
obj.mpoint = item.id;
that.$API.enm.mpoint.statCreate
.req(obj)
.then((res) => {
that.isSaveing = false;
that.$message.success("操作成功");
that.mpFormVal = true;
that.$message.success("保存成功");
that.getMpointStat();
that.$refs.mpointStatTable.refresh();
})
.catch((res) => {

View File

@ -74,6 +74,14 @@
<el-table-column label="批次" prop="batch" min-width="100">
</el-table-column>
<el-table-column label="数量" prop="count"></el-table-column>
<el-table-column label="类型" prop="type">
<template #default="scope">
<el-tag v-if="scope.row.type == 10">交送</el-tag>
<el-tag v-if="scope.row.type == 20" type="success"
>接收</el-tag
>
</template>
</el-table-column>
<el-table-column
label="交送人"
prop="send_user_name"
@ -127,6 +135,10 @@
>
<el-popconfirm
title="确定删除吗?"
v-if="
scope.row.send_mgroup == mgroupId &&
scope.row.submit_time == null
"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
@ -216,7 +228,7 @@ export default {
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
if(res.length != 1){
if (res.length != 1) {
that.$message.error("获取工段错误");
return;
}
@ -281,7 +293,7 @@ export default {
//
async table_del(row) {
var id = row.id;
var res = await this.$API.mtm.mgroup.delete.req(id);
var res = await this.$API.wpm.handover.delete.req(id);
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {

View File

@ -42,17 +42,16 @@
<el-table-column
label="物料名称"
prop="material_name"
min-width="100"
min-width="120"
></el-table-column>
<el-table-column
label="批次号"
prop="batch"
min-width="100"
min-width="120"
></el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
min-width="150"
></el-table-column>
<el-table-column
label="数量"
@ -62,14 +61,13 @@
<el-table-column
label="不合格标记"
prop="notok_sign_name"
min-width="80"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
min-width="150"
width="150"
></el-table-column>
<el-table-column
<!-- <el-table-column
label="操作"
fixed="right"
align="center"
@ -100,7 +98,7 @@
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table-column> -->
</scTable>
</el-main>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
@ -152,7 +150,7 @@ export default {
that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName })
.then((res) => {
if(res.length != 1){
if (res.length != 1) {
that.$message.error("获取工段错误");
return;
}