fix:光芯车间出入库改正

This commit is contained in:
shijing 2024-09-24 16:40:22 +08:00
parent 414fad1602
commit 4337fb7d1f
4 changed files with 488 additions and 49 deletions

View File

@ -157,6 +157,7 @@
v-if="dialog.inmRecord"
ref="inmRecordDialog"
:cate = "cate_type"
:process = "process"
:mgroupId = "params.mgroupx"
:deptId = " params.belong_dept"
@success="handleinmSuccess"
@ -208,6 +209,7 @@ export default {
material: "",
},
cate_type:'',
process:'',
materialType: "wm",
visibleDrawer: false,
};
@ -240,6 +242,7 @@ export default {
}
that.mgroupId = res[0].id;
that.$TOOL.data.set('gx_deptID',res[0].belong_dept)
that.process = res[0].process;
that.params.mgroupx = res[0].id;
that.params.belong_dept = res[0].belong_dept;
that.apiObj = that.$API.wpm.wmaterial.list;

View File

@ -2,11 +2,11 @@
<el-drawer
:title="titleMap[mode]"
v-model="visible"
:size="'90%'"
:size="'80%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-container v-if="mode != 'show'">
<el-header>
<el-steps
:active="active"
@ -177,12 +177,101 @@
<el-button @click="table_submit" type="warning">提交</el-button>
</el-footer>
</el-container>
<el-card v-else shadow="never" style="height: 100%;">
<el-descriptions title="基本信息" :column="3" style="width: 100%">
<el-descriptions-item label="编号">
{{form.number}}
</el-descriptions-item>
<el-descriptions-item label="出入库类型">
{{typeDict[form.type]}}
</el-descriptions-item>
<el-descriptions-item label="状态">
{{stateDict[form.state]}}
</el-descriptions-item>
<el-descriptions-item label="部门/车间">
{{form.belong_dept_name}}-{{ form.mgroup_name }}
</el-descriptions-item>
<el-descriptions-item label="执行人">
{{form.do_user_name}}
</el-descriptions-item>
<el-descriptions-item label="创建时间">
{{form.create_time}}
</el-descriptions-item>
</el-descriptions>
<div style="height: 8px"></div>
<scTable
ref="table"
:data="tableData"
row-key="id"
stripe
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<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="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column
label="组合件信息"
v-if="cate == 'good'"
width="300"
>
<template #default="scope">
<div v-if="scope.row.assemb.length > 0">
<div
v-for="item in scope.row.assemb"
:key="item.id"
>
<div>
{{ item.material_name }}
<span
style="
color: gray;
font-size: 12px;
"
>:</span
>{{ item.batch }}
<span
style="
color: gray;
font-size: 12px;
"
>:</span
>{{ item.rate }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="不合格数量" prop="count_notok">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
</scTable>
</el-card>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:cate = "cate"
:mgroupId = 'mgroupId'
:mioId = 'mioId'
:process="process"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
@ -191,19 +280,20 @@
<script>
import saveDialog from "./inm_record_form.vue";
export default {
name: "routepack_form",
name: "inm_record",
components: { saveDialog },
props: {
cate: { type: String, default: "" },
deptId: { type: String, default: "" },
mgroupId: { type: String, default: "" },
process: { type: String, default: "" },
},
data() {
return {
active: 0,
stepSuc: [0],
stepes: ["基本信息", "详情"],
titleMap: { add: "新增出入库", edit: "编辑出入库" },
titleMap: { add: "新增出入库", edit: "编辑出入库",show:"出入库详情" },
mode: "add",
isSaveing: false, //
search: {
@ -222,6 +312,8 @@ export default {
do_user: "",
mio_user: "",
},
stateDict: {10: "创建中",20: "已提交",},
typeDict:{'do_in':'生产入库','do_out':'生产领料'},
apiworkerObj: null,
materials: [],
apiObj: null,
@ -233,6 +325,7 @@ export default {
},
mioId:null,
routepack: "",
tableData:[],
userOption: [],//
userOptions: [],//
deptOptions: [],
@ -244,10 +337,13 @@ export default {
this.form.mgroup = this.mgroupId;
this.form.type = this.cate;
this.form.belong_dept = this.deptId;
this.getDeptOptions();
this.getmgroupOptions();
this.getDeptUsers();//
this.getDeptUser();//
this.$nextTick(() => {
this.getDeptOptions();
this.getmgroupOptions();
this.getDeptUsers();//
this.getDeptUser();//
})
},
methods: {
open(mode) {
@ -255,9 +351,23 @@ export default {
this.visible = true;
return this;
},
setData(data) {
setData(data,type) {
console.log('data',data)
this.mioId = data.id;
if(type){
this.getTableData();
}
Object.assign(this.form, data);
},
getTableData() {
let that = this;
let obj = {};
obj.mio = that.mioId;
obj.page = 0;
that.$API.inm.mioitem.list.req(obj).then((res) => {
that.tableData = res;
});
},
//
getmgroupOptions() {
this.$API.mtm.mgroup.list.req({page: 0}).then(res=>{

View File

@ -12,7 +12,7 @@
:rules="rules"
label-width="120px"
>
<el-form-item label="物料">
<el-form-item label="物料" v-if="cate == 'do_out'">
<el-select
v-model="form.material"
value-key="id"
@ -40,6 +40,30 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="物料批次" v-else>
<el-select
v-model="form.batch"
filterable
style="width: 100%"
@change="selectwmChange"
>
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="display:inline-block;float: left;">{{item.material_.name}}|{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次" v-if="cate == 'do_out'">
<el-select
v-model="selectBatch"
@ -67,32 +91,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次号" v-else>
<el-select
v-model="form.batch"
filterable
allow-create
clearable
style="width: 100%"
>
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库">
<el-select
v-model="form.warehouse"
@ -111,7 +109,7 @@
<el-input-number
v-model="form.count"
:min="0"
:precision="3"
:precision="0"
style="width: 100%"
/>
</el-form-item>
@ -131,6 +129,7 @@ export default {
cate: { type: String, default: "" },
mioId: { type: String, default: "" },
mgroupId: { type: String, default: "" },
process: { type: String, default: "" },
},
data() {
return {
@ -161,12 +160,12 @@ export default {
mounted() {
this.form.type = this.cate ;
this.form.mio = this.mioId ;
this.getMaterialOptions();
if(this.cate == 'do_out'){//---
this.inputBatchDisable = true;
this.getMaterialOptions();
this.getBatchOptions();
}else{//----
this.getWBatchs();
this.getMgroupWmaterial();
}
this.getWarehouseOptions();
},
@ -196,12 +195,14 @@ export default {
});
},
//
getWBatchs() {
getMgroupWmaterial() {
let that = this;
let obj = {};
obj.mgroupx= that.mgroupId;
obj.material= that.form.material;
obj.state = 10;
obj.page= 0;
obj.mgroupx= that.mgroupId;
obj.material__process= that.process;
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.wbatchOptions = res;
@ -211,7 +212,6 @@ export default {
//
getBatchOptions() {
let that = this;
that.getWBatchs();
let obj = {};
obj.page = 0;
obj.material = that.form.material;
@ -220,12 +220,7 @@ export default {
});
},
selectMaterialChange() {
let that = this;
if(that.cate=='do_in'){
that.getWBatchs();
}else{
that.getBatchOptions();
}
this.getBatchOptions();
},
getItem(options, id) {
for (var i = 0; i < options.length; i++) {
@ -238,6 +233,15 @@ export default {
this.form.batch = item.batch;
this.form.warehouse = item.warehouse;
},
//
selectwmChange(val){
let that = this;
that.wbatchOptions.forEach((item) => {
if (item.batch == val) {
that.form.material = item.material;
}
})
},
selectBatchClear() {
this.form.batch = "";
this.form.warehouse = "";

View File

@ -0,0 +1,322 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
>领料</el-button
>
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
>入库</el-button
>
<!-- <el-button
type="primary"
@click="add('do_out')"
v-auth="'mio.do'"
>生产领料</el-button
>
<el-button
type="primary"
@click="add('do_in')"
v-auth="'mio.do'"
>生产入库</el-button
> -->
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.state"
clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:params="params"
:query="query"
row-key="id"
stripe
>
<el-table-column type="index" width="50" />
<el-table-column
label="记录编号"
prop="number"
></el-table-column>
<el-table-column label="出/入库类型">
<template #default="scope">
{{ typeDict[scope.row.type] }}
</template>
</el-table-column>
<el-table-column label="记录状态">
<template #default="scope">
{{ stateDict[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="出/入库日期" prop="inout_date">
</el-table-column>
<el-table-column label="执行部门" prop="belong_dept_name">
<template #default="scope">
{{ scope.row.belong_dept_name }} - {{ scope.row.mgroup_name }}
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="120px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>
查看
</el-button>
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-if="scope.row.state == 10"
>
编辑
</el-button>
<el-button
link
type="primary"
@click="table_submit(scope.row)"
v-auth="'mio.submit'"
v-if="scope.row.state == 10"
>
提交
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'mio.delete'"
v-if="scope.row.state == 10"
>
删除
</el-button>
<el-button
link
type="warning"
@click="revert(scope.row)"
v-auth="'mio.submit'"
v-if="scope.row.state == 20"
>
撤销
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.inmRecord"
ref="inmRecordDialog"
:cate = "cate_type"
:process = "process"
:mgroupId = "params.mgroup"
:deptId = " deptId"
@success="handleinmSuccess"
>
</save-dialog>
</template>
<script>
import saveDialog from "./inm_record.vue";
export default {
name: "mio",
components: {
saveDialog
},
props: {
mgroupName: {
type: String,
default: "",
},
},
data() {
return {
stateDict: {
10: "创建中",
20: "已提交",
},
stateOptions: [
{ id: 10, name: "创建中" },
{ id: 20, name: "已提交" },
],
typeDict: {
do_out: "生产领料",
do_in: "生产入库",
},
cateOptions: [
{ id: "do_out", name: "生产领料" },
{ id: "do_in", name: "生产入库" },
],
dialog: {
save: false,
inmRecord: false,
},
query: {},
params: {
type__in: "do_out,do_in",
mgroup:""
},
form: {},
apiObj: null,
selection: [],
type: "",
deptId:"",
process: "",
cate: "good",
mioId: "",
visibleDrawer: false,
inmRecordDialog:false,
};
},
mounted() {
let that = this;
that.$nextTick(() => {
that.$API.mtm.mgroup.list.req({ page: 0, search: that.mgroupName }).then((res) => {
if (res.length < 1) {
that.$message.error("获取工段错误");
return;
}
that.params.mgroup = res[0].id;
that.deptId = res[0].belong_dept;
that.process = res[0].process;
that.apiObj = that.$API.inm.mio.list;
});
})
},
methods: {
tomio(type) {
let that = this;
that.cate_type=type;
that.dialog.inmRecord = true;
that.$nextTick(() => {
that.$refs.inmRecordDialog.open("add");
});
},
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
let that = this;
that.cate_type=row.type;
that.dialog.inmRecord = true;
that.$nextTick(() => {
that.$refs.inmRecordDialog.open("add").setData(row);
});
},
//
table_detail(row) {
let that = this;
that.cate_type=row.type;
that.dialog.inmRecord = true;
that.$nextTick(() => {
that.$refs.inmRecordDialog.open("show").setData(row,row.type);
});
},
//
revert(row) {
this.$confirm(`确定撤销该操作吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.mio.revert.req(row.id).then((res) => {
this.$message.success("撤销成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
}).catch(() => {});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.$refs.table.refresh();
});
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
handleinmSuccess(){},
handleSaveSuccess() {
this.$refs.table.refresh();
},
},
};
</script>