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

View File

@ -2,11 +2,11 @@
<el-drawer <el-drawer
:title="titleMap[mode]" :title="titleMap[mode]"
v-model="visible" v-model="visible"
:size="'90%'" :size="'80%'"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container> <el-container v-if="mode != 'show'">
<el-header> <el-header>
<el-steps <el-steps
:active="active" :active="active"
@ -177,12 +177,101 @@
<el-button @click="table_submit" type="warning">提交</el-button> <el-button @click="table_submit" type="warning">提交</el-button>
</el-footer> </el-footer>
</el-container> </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 <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
:cate = "cate" :cate = "cate"
:mgroupId = 'mgroupId' :mgroupId = 'mgroupId'
:mioId = 'mioId' :mioId = 'mioId'
:process="process"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
@ -191,19 +280,20 @@
<script> <script>
import saveDialog from "./inm_record_form.vue"; import saveDialog from "./inm_record_form.vue";
export default { export default {
name: "routepack_form", name: "inm_record",
components: { saveDialog }, components: { saveDialog },
props: { props: {
cate: { type: String, default: "" }, cate: { type: String, default: "" },
deptId: { type: String, default: "" }, deptId: { type: String, default: "" },
mgroupId: { type: String, default: "" }, mgroupId: { type: String, default: "" },
process: { type: String, default: "" },
}, },
data() { data() {
return { return {
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepes: ["基本信息", "详情"], stepes: ["基本信息", "详情"],
titleMap: { add: "新增出入库", edit: "编辑出入库" }, titleMap: { add: "新增出入库", edit: "编辑出入库",show:"出入库详情" },
mode: "add", mode: "add",
isSaveing: false, // isSaveing: false, //
search: { search: {
@ -222,6 +312,8 @@ export default {
do_user: "", do_user: "",
mio_user: "", mio_user: "",
}, },
stateDict: {10: "创建中",20: "已提交",},
typeDict:{'do_in':'生产入库','do_out':'生产领料'},
apiworkerObj: null, apiworkerObj: null,
materials: [], materials: [],
apiObj: null, apiObj: null,
@ -233,6 +325,7 @@ export default {
}, },
mioId:null, mioId:null,
routepack: "", routepack: "",
tableData:[],
userOption: [],// userOption: [],//
userOptions: [],// userOptions: [],//
deptOptions: [], deptOptions: [],
@ -244,10 +337,13 @@ export default {
this.form.mgroup = this.mgroupId; this.form.mgroup = this.mgroupId;
this.form.type = this.cate; this.form.type = this.cate;
this.form.belong_dept = this.deptId; this.form.belong_dept = this.deptId;
this.getDeptOptions(); this.$nextTick(() => {
this.getmgroupOptions(); this.getDeptOptions();
this.getDeptUsers();// this.getmgroupOptions();
this.getDeptUser();// this.getDeptUsers();//
this.getDeptUser();//
})
}, },
methods: { methods: {
open(mode) { open(mode) {
@ -255,9 +351,23 @@ export default {
this.visible = true; this.visible = true;
return this; return this;
}, },
setData(data) { setData(data,type) {
console.log('data',data)
this.mioId = data.id;
if(type){
this.getTableData();
}
Object.assign(this.form, data); 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() { getmgroupOptions() {
this.$API.mtm.mgroup.list.req({page: 0}).then(res=>{ this.$API.mtm.mgroup.list.req({page: 0}).then(res=>{

View File

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