This commit is contained in:
caoqianming 2024-07-02 13:47:19 +08:00
commit 66142799fd
19 changed files with 2542 additions and 1413 deletions

Binary file not shown.

BIN
public/img/ly/hzy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

BIN
public/img/ly/mm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
public/img/ly/shsps.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
public/img/ly/ylm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/img/ly/yrfd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Binary file not shown.

View File

@ -298,8 +298,8 @@ export default {
color: #ffffff;
}
.elProgress > .el-progress-circle {
width: 5vw !important;
height: 5vw !important;
width: 9vh !important;
height: 9vh !important;
}
//
</style>

View File

@ -2687,7 +2687,7 @@ const routes = [
path: "/bigScreenly",
name: "bigScreenly",
meta: {
title: "能管大屏ly",
title: "数智大屏",
icon: "el-icon-position",
perms: ["bigScreenly"],
fullpage: true,

View File

@ -17,7 +17,13 @@
export default {
methods: {
gohome(){
location.href="#/"
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
if (base_dashboard == null || base_dashboard == undefined) {
base_dashboard = '/dashboard'
}
this.$router.replace({
path: base_dashboard,
});
},
goback(){
this.$router.go(-1);

File diff suppressed because it is too large Load Diff

View File

@ -2,26 +2,65 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'material.create'">新增</el-button>
<scFileImport :templateUrl="materialTemplate" accept=".xlsx" :apiObj="$API.common.upload" @success="upSuccess">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'material.create'"
>新增</el-button
>
<scFileImport
:templateUrl="materialTemplate"
accept=".xlsx"
:apiObj="$API.common.upload"
@success="upSuccess"
>
</scFileImport>
</div>
<div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
<el-input
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 class="nopadding">
<el-container>
<el-header>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" type="card">
<el-tab-pane v-for="item in tabOptions" v-bind:key="item.name" :label="item.label" :name="item.name">
<el-tabs
v-model="activeName"
class="demo-tabs"
@tab-click="handleClick"
type="card"
>
<el-tab-pane
v-for="item in tabOptions"
v-bind:key="item.name"
:label="item.label"
:name="item.name"
>
</el-tab-pane>
</el-tabs>
<el-checkbox v-model="showHidden" label="显示隐式物料" @change="hiddenChange" />
<el-checkbox
v-model="showHidden"
label="显示隐式物料"
@change="hiddenChange"
/>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
@row-click="rowClick"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料编号" prop="number">
</el-table-column>
@ -31,40 +70,92 @@
</el-table-column>
<el-table-column label="型号" prop="model">
</el-table-column>
<el-table-column label="物料特征" prop="type" width="230">
<el-table-column
label="物料特征"
prop="type"
width="230"
>
<template #default="scope">
<span><el-tag>{{ typeOptions[scope.row.type] }}</el-tag>
<el-tag type="warning" v-if="scope.row.is_assemb" effect="plain"></el-tag>
<el-tag type="warning" v-if="scope.row.process_name" effect="plain">{{ scope.row.process_name
<span
><el-tag>{{
typeOptions[scope.row.type]
}}</el-tag>
<el-tag type="warning" v-if="scope.row.is_hidden" effect="plain"></el-tag></span>
<el-tag
type="warning"
v-if="scope.row.is_assemb"
effect="plain"
></el-tag
>
<el-tag
type="warning"
v-if="scope.row.process_name"
effect="plain"
>{{ scope.row.process_name }}</el-tag
>
<el-tag
type="warning"
v-if="scope.row.is_hidden"
effect="plain"
></el-tag
></span
>
</template>
</el-table-column>
<el-table-column label="关联物料" prop="brothers">
<template #default="scope">
<el-icon v-if="scope.row.brothers.length > 0" color="green">
<el-icon
v-if="scope.row.brothers.length > 0"
color="green"
>
<CircleCheckFilled />
</el-icon>
</template>
</el-table-column>
<el-table-column label="计量单位" prop="unit" width="80">
<el-table-column
label="计量单位"
prop="unit"
width="80"
>
</el-table-column>
<el-table-column label="总库存" prop="count" width="80">
</el-table-column>
<el-table-column label="安全库存" prop="count_safe" width="80">
<el-table-column
label="安全库存"
prop="count_safe"
width="80"
>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<el-table-column
v-if="materialType !== ''"
label="操作"
fixed="right"
align="center"
width="140"
>
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'material.update'">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-button>
<el-button link type="warning" @click="table_copy(scope.row)" v-auth="'material.create'">
<el-button
link
type="warning"
@click="table_copy(scope.row)"
v-auth="'material.create'"
>
复制
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'material.delete'">
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-button>
</template>
@ -72,41 +163,53 @@
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from "./materials_form.vue";
import scFileImport from '@/components/scFileImport'
import scFileExport from '@/components/scFileExport'
import { ElLoading } from 'element-plus'
import scFileImport from "@/components/scFileImport";
import scFileExport from "@/components/scFileExport";
import { ElLoading } from "element-plus";
export default {
name: "rparty",
props: {
materialType: {
type: String,
default() {
return "";
},
},
},
components: {
saveDialog,
scFileImport,
scFileExport,
ElLoading
ElLoading,
},
data() {
return {
materialTemplate: '/media/template/material.xlsx',
materialTemplate: "/media/template/material.xlsx",
dialog: {
save: false,
},
apiObj: null,
query: { type: 10, is_hidden: false },
activeName: '主要原料',
activeName: "主要原料",
selection: [],
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
tabOptions: [
{ label: "成品", name: 10 },
@ -119,27 +222,36 @@ export default {
// { label: "//", name: 0 },
],
typeOptions: {
0: '电/水/气',
10: '成品',
20: '半成品',
30: '主要原料',
40: '辅助材料',
0: "电/水/气",
10: "成品",
20: "半成品",
30: "主要原料",
40: "辅助材料",
// 50: '',
// 60: '',
70: '办公用品',
70: "办公用品",
},
materialId: "",
materialName: "",
showHidden: false,
};
},
mounted() {
this.apiObj = this.$API.mtm.material.list
this.$refs.table.queryData(this.query)
console.log("materialType", this.materialType);
this.apiObj = this.$API.mtm.material.list;
this.$refs.table.queryData(this.query);
},
methods: {
rowClick(row) {
console.log("rowClick", row);
this.materialId = row.id;
this.materialName = row.full_name;
this.$emit("choseChange", row.id);
},
handleClick(pane, ev) {
this.query.type = pane.props.name
this.query.page = 1
this.$refs.table.queryData(this.query)
this.query.type = pane.props.name;
this.query.page = 1;
this.$refs.table.queryData(this.query);
},
//
add() {
@ -172,15 +284,20 @@ export default {
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.mtm.material.delete.req(row.id).then((res) => {
})
.then(() => {
this.$API.mtm.material.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
})
.catch((err) => {
return err;
});
}).catch(() => { });
})
.catch(() => {});
},
//
@ -192,31 +309,36 @@ export default {
}
},
handleQuery() {
this.$refs.table.queryData(this.query)
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
upSuccess(res, close) {
close();
const loading = ElLoading.service({ fullscreen: true, text: "解析中...请稍等" });
this.$API.mtm.material.daoru.req({ path: res.path }).then(res => {
const loading = ElLoading.service({
fullscreen: true,
text: "解析中...请稍等",
});
this.$API.mtm.material.daoru
.req({ path: res.path })
.then((res) => {
loading.close();
this.$message.success("导入成功");
this.$refs.table.queryData(this.query)
}).catch(err => {
loading.close();
this.$refs.table.queryData(this.query);
})
.catch((err) => {
loading.close();
});
},
hiddenChange(val) {
if (val) {
this.query.is_hidden = ''
}
else {
this.query.is_hidden = false
}
this.$refs.table.queryData(this.query)
this.query.is_hidden = "";
} else {
this.query.is_hidden = false;
}
this.$refs.table.queryData(this.query);
},
},
};
</script>

View File

@ -3,7 +3,11 @@
<el-header>
<div class="left-panel"></div>
<div class="right-panel">
<el-select v-model="query.mgroup" clearable>
<el-select
v-model="query.mgroup"
clearable
style="width: 150px"
>
<el-option
v-for="item in mgroupOption"
:key="item.id"
@ -17,7 +21,17 @@
type="date"
placeholder="选择日期"
value-format="YYYY-MM-DD"
style="width: 150px"
/>
<el-input
v-model="query.search"
placeholder="批次号"
clearable
style="width: 150px"
></el-input>
<el-button type="primary" @click="materialsChoses()"
>选择物料</el-button
>
<el-button
type="primary"
icon="el-icon-search"
@ -110,17 +124,30 @@
</el-table-column>
</scTable>
</el-main>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</el-container>
</template>
<script>
import materials from "./../mtm/materials.vue";
export default {
components: {
materials,
},
name: "rparty",
data() {
return {
apiObj: this.$API.wpm.mlog.list,
query: {
page: 1,
page_size: 20,
search: "",
material: "",
mgroup: "",
handle_date: "",
},
selection: [],
state_: {
@ -128,12 +155,21 @@ export default {
20: "",
},
mgroupOption: [],
materialsVisible: false,
};
},
mounted() {
this.getMgroup();
},
methods: {
materialsChoses() {
this.materialsVisible = true;
},
choseChange(data) {
this.query.material = data;
this.$refs.table.queryData(this.query);
this.materialsVisible = false;
},
getMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
this.mgroupOption = res;

View File

@ -426,6 +426,24 @@
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
<div class="right-panel">
<el-input
v-model="queryHandover.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="queryHandoverChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('handover')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable
@ -507,6 +525,22 @@
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-input
v-model="queryWm.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="paramsWmChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('wm')"
>选择物料</el-button
>
<el-button
type="primary"
@click="tomio"
@ -610,16 +644,26 @@
<el-button @click="addMtaskInfoVisible = false">取消</el-button>
</el-footer>
</el-dialog>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</el-container>
</template>
<script>
import saveDialog from "./worktask_form.vue";
import showDrawer from "./mlog_drawer.vue";
import materials from "./../mtm/materials.vue";
export default {
components: {
saveDialog,
showDrawer,
materials,
},
data() {
return {
@ -647,19 +691,50 @@ export default {
visibleDrawer: false,
dialogSave: false,
paramsHandover: {},
queryHandover: {
search: "",
material: "",
},
paramsWm: {},
queryWm: {
search: "",
material: "",
},
materialType: "wm",
mgroup: "",
mlogId: "",
mtaskDate: "",
material_out: "",
material_model: "",
queryMtaskState: false,
materialsVisible: false,
};
},
mounted() {
this.initDept();
},
methods: {
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
if (this.materialType == "wm") {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
} else {
this.queryHandover.material = data;
this.$refs.table_handover.queryData(this.queryHandover);
}
this.materialsVisible = false;
},
queryHandoverChange() {
this.$refs.table_handover.queryData(this.queryHandover);
},
paramsWmChange() {
this.$refs.table_wm.queryData(this.queryWm);
},
mlog_revert(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert

View File

@ -159,6 +159,24 @@
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
<div class="right-panel">
<el-input
v-model="queryHandover.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="queryHandoverChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('handover')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable
@ -167,6 +185,7 @@
row-key="id"
stripe
:params="paramsHandover"
:query="queryHandover"
>
<el-table-column
label="送料日期"
@ -235,6 +254,22 @@
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-input
v-model="queryWm.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="paramsWmChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('wm')"
>选择物料</el-button
>
<el-button
type="primary"
@click="tomio"
@ -255,6 +290,7 @@
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
:query="queryWm"
stripe
hidePagination
>
@ -303,13 +339,23 @@
@closed="visibleDrawer = false"
>
</showDrawer>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</template>
<script>
import showDrawer from "./mlog_dept6_detail.vue";
import materials from "./../mtm/materials.vue";
export default {
components: {
showDrawer,
materials,
},
data() {
return {
@ -326,7 +372,9 @@ export default {
34: "已终止",
40: "已提交",
},
wmaterials: [],
hideDo: true,
materialsVisible: false,
queryMtaskState: false,
apiObjWm: this.$API.wpm.wmaterial.list,
paramsMlog: {
@ -336,9 +384,18 @@ export default {
paramsHandover: {
recive_dept__name: "6车间",
},
queryHandover: {
search: "",
material: "",
},
paramsWm: {
belong_dept__name: "6车间",
count__gte: 1,
page: 0,
},
queryWm: {
search: "",
material: "",
},
paramsMtask: {
mgroup__belong_dept__name: "6车间",
@ -349,6 +406,9 @@ export default {
state__in: "",
},
mtaskId: "",
dataWm: [],
dataWmOrigin: [],
materialType: "wm",
visibleDrawer: false,
};
},
@ -361,6 +421,27 @@ export default {
tomio() {
this.$router.push({ name: "halfgood_mio" });
},
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
if (this.materialType == "wm") {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
} else {
this.queryHandover.material = data;
this.$refs.table_handover.queryData(this.queryHandover);
}
this.materialsVisible = false;
},
queryHandoverChange() {
this.$refs.table_handover.queryData(this.queryHandover);
},
paramsWmChange() {
this.$refs.table_wm.queryData(this.queryWm);
},
//
rowClick(row) {
let that = this;
@ -392,6 +473,7 @@ export default {
this.$refs.table.queryData(this.queryMtask);
},
table_submit(row) {
let that = this;
let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) {
@ -399,26 +481,27 @@ export default {
} else {
infoText = "该任务没有日志,确定提交吗?";
}
this.$confirm(infoText, "提示", {
that.$confirm(infoText, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.mtask.submit
that.$API.pm.mtask.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
that.$message.success("操作成功");
that.$refs.table_mtask.refresh();
that.mtaskClick(that.currentMtask);
})
.catch((err) => {});
});
},
handover_submit(row) {
this.$API.wpm.handover.submit
let that = this;
that.$API.wpm.handover.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_handover.refresh();
this.$refs.table_wm.refresh();
that.$message.success("操作成功");
that.$refs.table_handover.refresh();
that.$refs.table_wm.refresh();
})
.catch((err) => {});
},

View File

@ -396,6 +396,24 @@
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
<div class="right-panel">
<el-input
v-model="queryHandover.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="queryHandoverChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('handover')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable
@ -477,6 +495,22 @@
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-input
v-model="queryWm.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="paramsWmChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('wm')"
>选择物料</el-button
>
<el-button
type="primary"
@click="tomio"
@ -557,15 +591,25 @@
@closed="visibleDrawer = false"
>
</showDrawer>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</el-container>
</template>
<script>
import saveDialog from "./worktask_form.vue";
import showDrawer from "./mlog_drawer.vue";
import materials from "./../mtm/materials.vue";
export default {
components: {
saveDialog,
showDrawer,
materials,
},
data() {
return {
@ -588,19 +632,50 @@ export default {
queryMtaskState: false,
apiObjHandover: null,
paramsHandover: {},
queryHandover: {
search: "",
material: "",
},
apiObjWm: null,
paramsWm: {},
queryWm: {
search: "",
material: "",
},
materialType: "wm",
mlogs: [],
mlogId: "",
mgroup: "",
material_out: "",
material_model: "",
materialsVisible: false,
};
},
mounted() {
this.initDept();
},
methods: {
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
if (this.materialType == "wm") {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
} else {
this.queryHandover.material = data;
this.$refs.table_handover.queryData(this.queryHandover);
}
this.materialsVisible = false;
},
queryHandoverChange() {
this.$refs.table_handover.queryData(this.queryHandover);
},
paramsWmChange() {
this.$refs.table_wm.queryData(this.queryWm);
},
mlog_revert(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert

View File

@ -4,55 +4,104 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'mlog.create'">新增</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'mlog.create'"
>新增</el-button
>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
>
<el-table-column type="index" width="50" />
<el-table-column label="配料日期" prop="handle_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{
<el-table-column
label="产物"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
><span v-if="scope.row.material_out_">{{
scope.row.material_out_.full_name
}}</span>
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
<el-table-column
label="每桶重量/kg"
prop="count_real_eweight"
>
<template #default="scope">
<span v-if="scope.row.count_real_eweight"> {{ scope.row.count_real_eweight.toFixed(2)
}}</span>
<span v-if="scope.row.count_real_eweight">
{{
scope.row.count_real_eweight.toFixed(2)
}}</span
>
</template>
</el-table-column>
<el-table-column label="配料人" prop="handle_user_name">
<template #default="scope">
<span v-for="item in scope.row.handle_users_" v-bind:key="item.id">
<span
v-for="item in scope.row.handle_users_"
v-bind:key="item.id"
>
{{ item.name }}/
</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<template #default="scope">
<el-button link type="primary" v-if="scope.row.submit_time == null"
@click="table_edit(scope.row)" v-auth="'mlog.update'">
<el-button
link
type="primary"
v-if="scope.row.submit_time == null"
@click="table_edit(scope.row)"
v-auth="'mlog.update'"
>
编辑
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null">
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null"
>
删除
</el-button>
<el-button link type="success" v-if="scope.row.submit_user == null"
@click="table_submit(scope.row)" v-auth="'mlog.submit'">
<el-button
link
type="success"
v-if="scope.row.submit_user == null"
@click="table_submit(scope.row)"
v-auth="'mlog.submit'"
>
提交
</el-button>
<el-button link type="warning" v-if="scope.row.submit_time != null"
@click="table_revert(scope.row)" v-auth="'mlog.submit'">
<el-button
link
type="warning"
v-if="scope.row.submit_time != null"
@click="table_revert(scope.row)"
v-auth="'mlog.submit'"
>
撤回
</el-button>
</template>
@ -60,7 +109,6 @@
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
@ -69,52 +117,117 @@
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="addHandover" v-auth="'handover.create'">
<el-button
type="primary"
@click="addHandover"
v-auth="'handover.create'"
>
新增
</el-button>
</div>
<div class="right-panel">
<el-input
v-model="queryHandover.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="queryHandoverChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('handover')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable ref="table2" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover">
<scTable
ref="table2"
:apiObj="apiObjHandover"
row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date" width="120">
<el-table-column
label="送料日期"
prop="send_date"
width="120"
>
</el-table-column>
<el-table-column label="产物" prop="material_name" show-overflow-tooltip width="120">
<el-table-column
label="产物"
prop="material_name"
show-overflow-tooltip
width="120"
>
</el-table-column>
<el-table-column label="批次" prop="batch">
</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="每桶/kg" prop="count_eweight">
<el-table-column
label="每桶/kg"
prop="count_eweight"
>
<template #default="scope">
<span v-if="scope.row.count_eweight"> {{ scope.row.count_eweight.toFixed(2)
}}</span>
<span v-if="scope.row.count_eweight">
{{
scope.row.count_eweight.toFixed(
2
)
}}</span
>
</template>
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
<el-table-column
label="交送人"
prop="send_user_name"
>
</el-table-column>
<el-table-column label="接收车间" prop="recive_dept_name">
<el-table-column
label="接收车间"
prop="recive_dept_name"
>
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
<el-table-column
label="接收人"
prop="recive_user_name"
>
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<el-table-column
label="是否确认"
prop="submit_time"
>
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-if="scope.row.submit_time"
></span
>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="100">
<el-table-column
label="操作"
fixed="right"
align="left"
width="100"
>
<template #default="scope">
<!-- <el-button link type="primary" @click="handover_edit(scope.row)"
v-auth="'handover.update'" v-if="scope.row.submit_time == null">
编辑
</el-button> -->
<el-button link type="danger" @click="handover_delete(scope.row)"
v-auth="'handover.delete'" v-if="scope.row.submit_time == null">
<el-button
link
type="danger"
@click="handover_delete(scope.row)"
v-auth="'handover.delete'"
v-if="scope.row.submit_time == null"
>
删除
</el-button>
</template>
@ -129,20 +242,47 @@
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-input
v-model="queryWm.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="paramsWmChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('wm')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination>
<scTable
ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
hidePagination
>
<el-table-column label="物料" prop="material">
<template #default="scope">{{
scope.row.material_name
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </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="每桶/kg" prop="count_eweight"></el-table-column>
<el-table-column
label="每桶/kg"
prop="count_eweight"
></el-table-column>
</scTable>
</el-main>
</el-container>
@ -150,66 +290,141 @@
</el-container>
</el-main>
</el-container>
<el-dialog title="交接单" ref="handoverDialog" v-model="handoverVisible" :size="1000" destroy-on-close
@closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-dialog
title="交接单"
ref="handoverDialog"
v-model="handoverVisible"
:size="1000"
destroy-on-close
@closed="handoverVisible = false"
>
<el-form
ref="dialogForm"
:model="handoverForm"
:rules="rules"
label-width="120px"
>
<el-row>
<el-col :md="24" :sm="24">
<el-form-item label="交送物料" prop="wm">
<el-select v-model="selectWm" placeholder="交送物料" clearable style="width: 100%"
:disabled="handoverType == 'edit'" value-key="id" @change="selectWmChange">
<el-option v-for="item in wmaterialList" :key="item.id"
:label="item.material_name + '---' + item.batch" :value="item">
<span style="float: left">{{ item.material_name }}---{{ item.batch }}</span>
<span style="
<el-select
v-model="selectWm"
placeholder="交送物料"
clearable
style="width: 100%"
:disabled="handoverType == 'edit'"
value-key="id"
@change="selectWmChange"
>
<el-option
v-for="item in wmaterialList"
:key="item.id"
:label="item.material_name + '---' + item.batch"
:value="item"
>
<span style="float: left"
>{{ item.material_name }}---{{
item.batch
}}</span
>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
">{{ item.count }}</span>
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD"
style="width: 100%" />
<el-date-picker
v-model="handoverForm.send_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="接收部门" prop="recive_dept">
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width: 100%"
@change="getUserList2">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
<el-select
v-model="handoverForm.recive_dept"
placeholder="接收部门"
clearable
style="width: 100%"
@change="getUserList2"
>
<el-option
v-for="item in deptOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width: 100%">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="handoverForm.recive_user"
placeholder="接收人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userList2"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="handoverForm.send_user"
placeholder="交送人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="桶数" prop="count">
<el-input-number v-model="handoverForm.count" controls-position="right" :min="0" step="1"
:step-strictly="true" style="width:100%" placeholder="桶数">
<el-input-number
v-model="handoverForm.count"
controls-position="right"
:min="0"
step="1"
:step-strictly="true"
style="width: 100%"
placeholder="桶数"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="每桶(kg)" prop="count_eweight">
<el-input-number v-model="handoverForm.count_eweight" controls-position="right" :min="0"
:precision="2" style="width:100%" placeholder="每桶kg">
<el-input-number
v-model="handoverForm.count_eweight"
controls-position="right"
:min="0"
:precision="2"
style="width: 100%"
placeholder="每桶kg"
>
</el-input-number>
</el-form-item>
</el-col>
@ -220,28 +435,53 @@
<el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer>
</el-dialog>
<save-dialog v-if="dialogSave" ref="saveDialog" :mgroup="currentMgroup.id"
:mgroupShiftRule="currentMgroup.shift_rule" :activeType="activeName" @success="handleSaveSuccess"
@closed="dialogSave = false">
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mgroup="currentMgroup.id"
:mgroupShiftRule="currentMgroup.shift_rule"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false"
>
</save-dialog>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</template>
<script>
import saveDialog from "./worktask_form.vue";
import materials from "./../mtm/materials.vue";
export default {
components: {
saveDialog,
materials,
},
data() {
return {
activeName: '8车间',
activeName: "8车间",
currentMgroup: {},
apiObj: null,
params: {},
apiObjHandover: null,
paramsHandover: {},
queryHandover: {
search: "",
material: "",
},
apiObjWm: null,
paramsWm: {},
queryWm: {
search: "",
material: "",
},
materialType: "wm",
handoverForm: {},
handoverVisible: false,
dialogSave: false,
@ -249,27 +489,52 @@ export default {
userList: [],
userList2: [],
wmaterialList: [],
selectWm: null
}
selectWm: null,
materialsVisible: false,
};
},
mounted() {
this.initMgroup()
this.getDepts()
this.initMgroup();
this.getDepts();
},
methods: {
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
if (this.materialType == "wm") {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
} else {
this.queryHandover.material = data;
this.$refs.table2.queryData(this.queryHandover);
}
this.materialsVisible = false;
},
queryHandoverChange() {
this.$refs.table2.queryData(this.queryHandover);
},
paramsWmChange() {
this.$refs.table_wm.queryData(this.queryWm);
},
table_revert(row) {
this.$API.wpm.mlog.revert.req(row.id).then(res => {
this.$API.wpm.mlog.revert
.req(row.id)
.then((res) => {
this.$message.success("撤回成功");
this.$refs.table.refresh();
this.$refs.table_wm.refresh();
}).catch(e => { })
})
.catch((e) => {});
},
table_submit(row) {
this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$API.wpm.mlog.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.$refs.table.refresh();
this.$refs.table_wm.refresh();
})
});
},
add() {
this.dialogSave = true;
@ -287,79 +552,96 @@ export default {
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
})
.then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
})
.catch((err) => {
return err;
});
}).catch(() => { });
})
.catch(() => {});
},
handleSaveSuccess() {
this.$refs.table.refresh();
},
getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,8车间,10车间' }).then(res => {
this.$API.system.dept.list
.req({ page: 0, name__in: "7车间,8车间,10车间" })
.then((res) => {
this.deptOptions = res;
})
});
},
getUserList2(val) {
this.$API.system.user.list.req({ belong_dept: val, page: 0 }).then(res => {
this.userList2 = res
})
this.$API.system.user.list
.req({ belong_dept: val, page: 0 })
.then((res) => {
this.userList2 = res;
});
},
initMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0, name: '混料' }).then(res => {
this.$API.mtm.mgroup.list
.req({ page: 0, name: "混料" })
.then((res) => {
if (res.length == 1) {
this.currentMgroup = res[0]
this.params.mgroup = this.currentMgroup.id
this.apiObj = this.$API.wpm.mlog.list
this.currentMgroup = res[0];
this.params.mgroup = this.currentMgroup.id;
this.apiObj = this.$API.wpm.mlog.list;
this.paramsHandover.send_mgroup = this.currentMgroup.id
this.apiObjHandover = this.$API.wpm.handover.list
this.paramsHandover.send_mgroup = this.currentMgroup.id;
this.apiObjHandover = this.$API.wpm.handover.list;
this.paramsWm.belong_dept = this.currentMgroup.belong_dept
this.paramsWm.material__name__contains = '混料'
this.paramsWm.count__gte = 1
this.apiObjWm = this.$API.wpm.wmaterial.list
this.paramsWm.belong_dept =
this.currentMgroup.belong_dept;
this.paramsWm.material__name__contains = "混料";
this.paramsWm.count__gte = 1;
this.apiObjWm = this.$API.wpm.wmaterial.list;
this.$API.system.user.list.req({ page: 0, belong_dept: this.currentMgroup.belong_dept }).then(res => {
this.userList = res
this.$API.system.user.list
.req({
page: 0,
belong_dept: this.currentMgroup.belong_dept,
})
.then((res) => {
this.userList = res;
});
} else {
this.$message.error("未找到工段");
}
})
});
},
//
addHandover() {
this.getWmaterial();
this.handoverForm.wm = '';
this.handoverForm.wm = "";
this.handoverForm.send_date = "";
this.handoverForm.send_user = "";
this.handoverForm.recive_user = '';//
this.handoverForm.recive_dept = '';//
this.handoverForm.recive_user = ""; //
this.handoverForm.recive_dept = ""; //
this.handoverForm.send_dept = this.currentMgroup.belong_dept;
this.handoverForm.send_mgroup = this.currentMgroup.id;
this.handoverType = 'add';
this.handoverType = "add";
this.handoverVisible = true;
},
getWmaterial() {
let obj = {};
obj.belong_dept = this.currentMgroup.belong_dept;
obj.material__name__contains = '混料';
obj.material__name__contains = "混料";
obj.page = 0;
obj.count__gte = 1;
this.$API.wpm.wmaterial.list.req(obj).then(res => {
this.$API.wpm.wmaterial.list.req(obj).then((res) => {
this.wmaterialList = res;
})
});
},
selectWmChange(item) {
this.handoverForm.count = item.count
this.handoverForm.count_eweight = item.count_eweight
this.handoverForm.wm = item.id
this.handoverForm.count = item.count;
this.handoverForm.count_eweight = item.count_eweight;
this.handoverForm.wm = item.id;
this.handoverForm.send_dept = this.currentMgroup.belong_dept;
this.handoverForm.send_mgroup = this.currentMgroup.id;
this.handoverForm.material = item.material;
@ -374,13 +656,14 @@ export default {
},
handover_edit(row) {
Object.assign(this.handoverForm, row);
this.getUserList2(row.recive_dept)
this.getUserList2(row.recive_dept);
this.handoverVisible = true;
},
handover_delete(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
})
.then(() => {
this.$API.wpm.handover.delete
.req(row.id)
.then((res) => {
@ -394,6 +677,6 @@ export default {
})
.catch(() => {});
},
}
}
},
};
</script>

View File

@ -4,13 +4,28 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'mlog.create'">新增</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'mlog.create'"
>新增</el-button
>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
>
<el-table-column type="index" width="50" />
<el-table-column label="物料名" prop="material_out_name">
<el-table-column
label="物料名"
prop="material_out_name"
>
<template #default="scope">
<span v-if="scope.row.material_out_">
{{ scope.row.material_out_.full_name }}
@ -29,23 +44,47 @@
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<el-table-column
label="操作"
fixed="right"
align="center"
width="180"
>
<template #default="scope">
<el-button link type="primary" v-if="scope.row.submit_time == null"
@click="table_edit(scope.row)" v-auth="'mlog.update'">
<el-button
link
type="primary"
v-if="scope.row.submit_time == null"
@click="table_edit(scope.row)"
v-auth="'mlog.update'"
>
编辑
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null">
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null"
>
删除
</el-button>
<el-button link type="success" v-if="scope.row.submit_user == null"
@click="table_submit(scope.row)" v-auth="'mlog.submit'">
<el-button
link
type="success"
v-if="scope.row.submit_user == null"
@click="table_submit(scope.row)"
v-auth="'mlog.submit'"
>
提交
</el-button>
<el-button link type="warning" v-if="scope.row.submit_time != null"
@click="table_revert(scope.row)" v-auth="'mlog.submit'">
<el-button
link
type="warning"
v-if="scope.row.submit_time != null"
@click="table_revert(scope.row)"
v-auth="'mlog.submit'"
>
撤回
</el-button>
</template>
@ -53,7 +92,6 @@
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
@ -62,43 +100,102 @@
<el-header>
<div class="left-panel">
<span style="font-size: 14px">交接记录</span>
<el-button
type="primary"
@click="addHandover"
v-auth="'handover.create'"
>新增</el-button
>
</div>
<div class="right-panel">
<el-button type="primary" @click="addHandover" v-auth="'handover.create'">新增</el-button>
<el-input
v-model="queryHandover.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="queryHandoverChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('handover')"
>选择物料</el-button
>
</div>
</el-header>
<el-main>
<scTable ref="table2" :apiObj="apiObjHandover" row-key="id" stripe :params="paramsHandover">
<scTable
ref="table2"
:apiObj="apiObjHandover"
row-key="id"
stripe
:params="paramsHandover"
>
<el-table-column type="index" width="50" />
<el-table-column label="送料日期" prop="send_date" width="120">
<el-table-column
label="送料日期"
prop="send_date"
width="120"
>
</el-table-column>
<el-table-column label="产物" prop="material_name" show-overflow-tooltip width="120">
<el-table-column
label="产物"
prop="material_name"
show-overflow-tooltip
width="120"
>
</el-table-column>
<el-table-column label="批次" prop="batch">
</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="交送人" prop="send_user_name">
<el-table-column
label="交送人"
prop="send_user_name"
>
</el-table-column>
<el-table-column label="接收部门" prop="recive_dept_name">
<el-table-column
label="接收部门"
prop="recive_dept_name"
>
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
<el-table-column
label="接收人"
prop="recive_user_name"
>
</el-table-column>
<el-table-column label="是否确认" prop="submit_time">
<el-table-column
label="是否确认"
prop="submit_time"
>
<template #default="scope">
<span v-if="scope.row.submit_time"></span>
<span v-if="scope.row.submit_time"
></span
>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="100">
<el-table-column
label="操作"
fixed="right"
align="left"
width="100"
>
<template #default="scope">
<!-- <el-button link type="primary" @click="handover_edit(scope.row)"
v-auth="'handover.update'" v-if="scope.row.submit_time == null">
编辑
</el-button> -->
<el-button link type="danger" @click="handover_delete(scope.row)"
v-auth="'handover.delete'" v-if="scope.row.submit_time == null">
<el-button
link
type="danger"
@click="handover_delete(scope.row)"
v-auth="'handover.delete'"
v-if="scope.row.submit_time == null"
>
删除
</el-button>
</template>
@ -114,17 +211,57 @@
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button>
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button>
<el-input
v-model="queryWm.search"
placeholder="批次号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="paramsWmChange"
></el-button>
<el-button
type="primary"
@click="materialsChoses('wm')"
>选择物料</el-button
>
<el-button
type="primary"
@click="tomio"
v-auth="'mio.do'"
>领料</el-button
>
<el-button
type="primary"
@click="tomio"
v-auth="'mio.do'"
>入库</el-button
>
</div>
</el-header>
<el-main>
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination>
<el-table-column label="物料" prop="material_name">
<scTable
ref="table_wm"
:apiObj="apiObjWm"
row-key="id"
:params="paramsWm"
stripe
hidePagination
>
<el-table-column
label="物料"
prop="material_name"
>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column
label="数量"
prop="count"
width="80"
>
</el-table-column>
</scTable>
</el-main>
@ -133,61 +270,132 @@
</el-container>
</el-main>
</el-container>
<el-dialog :title="titleOptions[handoverType]" ref="handoverDialog" v-model="handoverVisible" :size="1000"
destroy-on-close @closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-dialog
:title="titleOptions[handoverType]"
ref="handoverDialog"
v-model="handoverVisible"
:size="1000"
destroy-on-close
@closed="handoverVisible = false"
>
<el-form
ref="dialogForm"
:model="handoverForm"
:rules="rules"
label-width="120px"
>
<el-row>
<el-col :md="24" :sm="24">
<el-form-item label="交送物料" prop="wm">
<el-select v-model="selectWm" placeholder="交送物料" clearable style="width: 100%"
:disabled="handoverType == 'edit'" value-key="id" @change="selectWmChange">
<el-option v-for="item in wmaterialList" :key="item.id"
:label="item.material_name + '---' + item.batch" :value="item">
<span style="float: left">{{ item.material_name }}---{{ item.batch }}</span>
<span style="
<el-select
v-model="selectWm"
placeholder="交送物料"
clearable
style="width: 100%"
:disabled="handoverType == 'edit'"
value-key="id"
@change="selectWmChange"
>
<el-option
v-for="item in wmaterialList"
:key="item.id"
:label="item.material_name + '---' + item.batch"
:value="item"
>
<span style="float: left"
>{{ item.material_name }}---{{
item.batch
}}</span
>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
">{{ item.count }}</span>
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD"
style="width: 100%" :disabled="handoverType == 'edit'" />
<el-date-picker
v-model="handoverForm.send_date"
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
:disabled="handoverType == 'edit'"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送数量" prop="count">
<el-input-number v-model="handoverForm.count" controls-position="right" :min="0" step="1"
:step-strictly="true" style="width:100%" placeholder="数量">
<el-input-number
v-model="handoverForm.count"
controls-position="right"
:min="0"
step="1"
:step-strictly="true"
style="width: 100%"
placeholder="数量"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width: 100%"
:disabled="handoverType == 'edit'">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="handoverForm.send_user"
placeholder="交送人"
clearable
style="width: 100%"
:disabled="handoverType == 'edit'"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收部门" prop="recive_dept">
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width: 100%"
@change="getUserList2" :disabled="handoverType == 'edit'">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
<el-select
v-model="handoverForm.recive_dept"
placeholder="接收部门"
clearable
style="width: 100%"
@change="getUserList2"
:disabled="handoverType == 'edit'"
>
<el-option
v-for="item in deptOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width: 100%"
:disabled="handoverType == 'edit'">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
<el-select
v-model="handoverForm.recive_user"
placeholder="接收人"
clearable
style="width: 100%"
:disabled="handoverType == 'edit'"
>
<el-option
v-for="item in userList2"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
@ -198,33 +406,58 @@
<el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer>
</el-dialog>
<save-dialog v-if="dialogSave" ref="saveDialog" :belongdept="currentMgroup.belong_dept" :mgroup="currentMgroup.id"
:mgroupShiftRule="currentMgroup.shift_rule" :activeType="activeName" @success="handleSaveSuccess"
@closed="dialogSave = false">
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:belongdept="currentMgroup.belong_dept"
:mgroup="currentMgroup.id"
:mgroupShiftRule="currentMgroup.shift_rule"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false"
>
</save-dialog>
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
<materials
style="height: 500px"
:materialType="materialType"
ref="materialsChose"
@choseChange="choseChange"
></materials>
</el-dialog>
</template>
<script>
import saveDialog from "./worktask_form.vue";
import materials from "./../mtm/materials.vue";
export default {
components: {
saveDialog,
materials,
},
data() {
return {
activeName: '退火',
handoverType: 'add',
activeName: "退火",
handoverType: "add",
titleOptions: {
'add': '新增',
'edit': '编辑',
add: "新增",
edit: "编辑",
},
currentMgroup: {},
apiObj: null,
params: {},
apiObjHandover: null,
paramsHandover: {},
queryHandover: {
search: "",
material: "",
},
apiObjWm: null,
paramsWm: {},
queryWm: {
search: "",
material: "",
},
handoverForm: {},
dialogSave: false,
handoverVisible: false,
@ -233,13 +466,35 @@ export default {
userList2: [],
wmaterialList: [],
selectWm: null,
}
materialsVisible: false,
};
},
mounted() {
this.initMgroup()
this.initMgroup();
this.getDepts();
},
methods: {
materialsChoses(str) {
this.materialType = str;
this.materialsVisible = true;
},
choseChange(data) {
if (this.materialType == "wm") {
this.queryWm.material = data;
this.$refs.table_wm.queryData(this.queryWm);
} else {
this.queryHandover.material = data;
this.$refs.table2.queryData(this.queryHandover);
}
this.materialsVisible = false;
},
queryHandoverChange() {
this.$refs.table2.queryData(this.queryHandover);
},
paramsWmChange() {
this.$refs.table_wm.queryData(this.queryWm);
},
add() {
this.dialogSave = true;
this.$nextTick(() => {
@ -257,24 +512,30 @@ export default {
this.$router.push({ name: "halfgood_mio" });
},
table_submit(row) {
this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$API.wpm.mlog.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.$refs.table.refresh();
this.$refs.table_wm.refresh();
})
});
},
table_revert(row) {
this.$API.wpm.mlog.revert.req(row.id).then(res => {
this.$API.wpm.mlog.revert
.req(row.id)
.then((res) => {
this.$message.success("撤回成功");
this.$refs.table.refresh();
this.$refs.table_wm.refresh();
}).catch(e => { })
})
.catch((e) => {});
},
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
})
.then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
@ -289,55 +550,68 @@ export default {
this.$refs.table.refresh();
},
getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '6车间,7车间,10车间' }).then(res => {
this.deptOptions = res
})
this.$API.system.dept.list
.req({ page: 0, name__in: "6车间,7车间,10车间" })
.then((res) => {
this.deptOptions = res;
});
},
getUserList2() {
this.$API.system.user.list.req({ belong_dept: this.handoverForm.recive_dept, page: 0 }).then(res => {
this.userList2 = res
})
this.$API.system.user.list
.req({ belong_dept: this.handoverForm.recive_dept, page: 0 })
.then((res) => {
this.userList2 = res;
});
},
initMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0, name: '管料退火' }).then(res => {
this.$API.mtm.mgroup.list
.req({ page: 0, name: "管料退火" })
.then((res) => {
if (res.length == 1) {
this.currentMgroup = res[0]
this.params.mgroup = this.currentMgroup.id
this.apiObj = this.$API.wpm.mlog.list
this.currentMgroup = res[0];
this.params.mgroup = this.currentMgroup.id;
this.apiObj = this.$API.wpm.mlog.list;
this.paramsHandover.send_mgroup = this.currentMgroup.id
this.apiObjHandover = this.$API.wpm.handover.list
this.paramsHandover.send_mgroup = this.currentMgroup.id;
this.apiObjHandover = this.$API.wpm.handover.list;
this.paramsWm.belong_dept = this.currentMgroup.belong_dept
this.paramsWm.material__process__name__contains = '管料'
this.paramsWm.count__gte = 1
this.apiObjWm = this.$API.wpm.wmaterial.list
this.paramsWm.belong_dept =
this.currentMgroup.belong_dept;
this.paramsWm.material__process__name__contains =
"管料";
this.paramsWm.count__gte = 1;
this.apiObjWm = this.$API.wpm.wmaterial.list;
this.$API.system.user.list.req({ page: 0, belong_dept: this.currentMgroup.belong_dept }).then(res => {
this.userList = res
this.$API.system.user.list
.req({
page: 0,
belong_dept: this.currentMgroup.belong_dept,
})
.then((res) => {
this.userList = res;
});
} else {
this.$message.error("未找到工段");
}
})
});
},
//
addHandover(row) {
this.getWmaterial();
this.handoverForm.wm = '';
this.handoverForm.wm = "";
this.handoverForm.send_date = "";
this.handoverForm.send_user = "";
this.handoverForm.recive_user = '';//
this.handoverForm.recive_dept = '';//
this.handoverForm.recive_user = ""; //
this.handoverForm.recive_dept = ""; //
this.handoverForm.send_mgroup = this.currentMgroup.id;
this.handoverType = 'add';
this.handoverType = "add";
this.handoverVisible = true;
},
selectWmChange(item) {
this.handoverForm.count = item.count
this.handoverForm.count_eweight = item.count_eweight
this.handoverForm.wm = item.id
this.handoverForm.count = item.count;
this.handoverForm.count_eweight = item.count_eweight;
this.handoverForm.wm = item.id;
this.handoverForm.send_dept = this.currentMgroup.belong_dept;
this.handoverForm.send_mgroup = this.currentMgroup.id;
this.handoverForm.material = item.material;
@ -349,9 +623,9 @@ export default {
obj.material__process = this.currentMgroup.process;
obj.page = 0;
obj.count__gte = 1;
this.$API.wpm.wmaterial.list.req(obj).then(res => {
this.$API.wpm.wmaterial.list.req(obj).then((res) => {
this.wmaterialList = res;
})
});
},
submitHandover() {
this.$API.wpm.handover.create.req(this.handoverForm).then((res) => {
@ -363,7 +637,7 @@ export default {
handover_edit(row) {
Object.assign(this.handoverForm, row);
this.getUserList2(row.recive_dept);
this.handoverType = 'edit';
this.handoverType = "edit";
this.handoverVisible = true;
},
handover_delete(row) {
@ -384,6 +658,6 @@ export default {
})
.catch(() => {});
},
}
}
},
};
</script>