库存改动

This commit is contained in:
shijing 2023-12-11 13:41:47 +08:00
parent 700f04aa13
commit ba2d621214
16 changed files with 1025 additions and 163 deletions

View File

@ -9,6 +9,13 @@ export default {
req: async function(data){
return await http.get(this.url, data);
}
},
audit: {
url: `${config.API_URL}/monitor/auditlog/`,
name: "审计日志",
req: async function(data){
return await http.get(this.url, data);
}
}
},
dbbackup: {

View File

@ -38,22 +38,21 @@ export default {
gantt.plugins({ tooltip: true });
gantt.config.bar_height = 20; //task
gantt.config.duration_unit = "day";//
//
// gantt.plugins({marker: true});
// gantt.addMarker({start_date: new Date(),text: ''});
//
// gantt.config.work_time = true;
// gantt.setWorkTime({ hours:["20:00-20:00"] });
// gantt.setWorkTime({ day:7, hours:false });
// gantt.setWorkTime({ hours:["0-24"] });
// gantt.config.start_date = new Date(2023, 9, 1);
// gantt.config.end_date = new Date(2023, 9, 10);
//
// gantt.templates.grid_folder = (item) => {
// return ""
// }
// gantt.templates.grid_folder = (item) => { return "" }
//
// gantt.templates.grid_file = (item) => {
// return ""
// }
// gantt.templates.grid_file = (item) => { return "" }
gantt.config.columns = [
{ name: 'number', label: '任务编号', tree: true, width: '200', align: 'left' },
{ name: 'material_name', label: '产品名称', width: '70', align: 'left' },
@ -131,7 +130,24 @@ export default {
//
gantt.init(this.$refs.ganttContainer);
gantt.parse(this.$props.tasks);
}
},
// methods:{
// setBarColor() {
// this.tasks.map(v => {
// var newObj = {};
// if (v.status === "CJ") {
// newObj = Object.assign(v, {
// 'color': '#aaa8eb'
// });
// } else if (v.status === "SX") {
// newObj = Object.assign(v, {
// 'color': '#7cbbff'
// });
// }
// return newObj;
// });
// },
// },
}
</script>
<style>

View File

@ -970,7 +970,28 @@ const routes = [
"icon": "el-icon-cellphone",
"perms": ["good"]
},
"component": "inm/good"
"children": [
{
"name": "good",
"path": "/inm/good",
"meta": {
"title": "成品库",
"icon": "el-icon-cellphone",
"perms": ["good"]
},
"component": "inm/good"
},
{
"name": "good_mio",
"path": "/inm/good_mio",
"meta": {
"title": "出入库记录",
"icon": "el-icon-cellphone",
"perms": ["good"]
},
"component": "inm/good_mio"
},
]
},
{
"name": "halfgood",
@ -980,7 +1001,28 @@ const routes = [
"icon": "el-icon-cellphone",
"perms": ["halfgood"]
},
"component": "inm/halfgood"
"children": [
{
"name": "halfgood",
"path": "/inm/halfgood",
"meta": {
"title": "半成品库",
"icon": "el-icon-cellphone",
"perms": ["halfgood"]
},
"component": "inm/halfgood"
},
{
"name": "halfgood_mio",
"path": "/inm/halfgood_mio",
"meta": {
"title": "出入库记录",
"icon": "el-icon-cellphone",
"perms": ["halfgood"]
},
"component": "inm/halfgood_mio"
},
]
},
{
"name": "mainso",
@ -990,7 +1032,28 @@ const routes = [
"icon": "el-icon-cellphone",
"perms": ["mainso"]
},
"component": "inm/mainso"
"children": [
{
"name": "mainso",
"path": "/inm/mainso",
"meta": {
"title": "原料库",
"icon": "el-icon-cellphone",
"perms": ["mainso"]
},
"component": "inm/mainso"
},
{
"name": "mainso_mio",
"path": "/inm/mainso_mio",
"meta": {
"title": "出入库记录",
"icon": "el-icon-cellphone",
"perms": ["mainso"]
},
"component": "inm/mainso_mio"
},
]
},
{
"name": "helpso",
@ -1000,7 +1063,29 @@ const routes = [
"icon": "el-icon-cellphone",
"perms": ["helpso"]
},
"component": "inm/helpso"
"children": [
{
"name": "helpso",
"path": "/inm/helpso",
"meta": {
"title": "辅料库",
"icon": "el-icon-cellphone",
"perms": ["helpso"]
},
"component": "inm/helpso"
},
{
"name": "helpso_mio",
"path": "/inm/helpso_mio",
"meta": {
"title": "出入库记录",
"icon": "el-icon-cellphone",
"perms": ["helpso"]
},
"component": "inm/helpso_mio"
},
]
},
{
"name": "materialbatch",

158
src/views/inm/good_mio.vue Normal file
View File

@ -0,0 +1,158 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('do_in')">生产入库</el-button>
<el-button type="primary" @click="add('sale_out')">销售发货</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="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="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="150px">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
查看
</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>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./mio_form.vue";
export default {
name: "mio",
components: {
saveDialog
},
data() {
return {
stateDict: {
10: '创建中',
20: '已提交'
},
stateOptions: [
{ id: 10, name: '创建中' },
{ id: 20, name: '已提交' },
],
typeDict: {
'sale_out': '销售发货',
'do_in': '生产入库',
'other_in': '其他出库',
},
cateOptions: [
{ id: 'sale_out', name: '销售发货' },
{ id: 'do_in', name: '生产入库' },
{ id: 'other_out', name: '其他出库' },
],
dialog: {
save: false,
},
query: {
type: 'sale_out'
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit", type).setData(row);
});
},
//
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id ,type:row.type}
});
},
//
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 = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
};
</script>

View File

@ -0,0 +1,156 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('do_in')">生产入库</el-button>
<el-button type="primary" @click="add('do_out')">生产领料</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" row-key="id" :params="query" 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="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="150px">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
查看
</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>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./mio_form.vue";
export default {
name: "mio",
components: {
saveDialog
},
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,
},
query: {
type: 'do_in'
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit", type).setData(row);
});
},
//
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id ,type:row.type,cate:'halfgood'}
});
},
//
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 = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
};
</script>

View File

@ -0,0 +1,144 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('pur_in')">采购入库</el-button>
<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" row-key="id" :params="query" 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="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="150px">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
查看
</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>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./mio_form.vue";
export default {
name: "mio",
components: {
saveDialog
},
data() {
return {
stateDict: {
10: '创建中',
20: '已提交'
},
stateOptions: [
{ id: 10, name: '创建中' },
{ id: 20, name: '已提交' },
],
typeDict: {'pur_in': '采购入库'},
dialog: {
save: false,
},
query: {
type: 'pur_in'
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit", type).setData(row);
});
},
//
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id,type:row.type,cate:'helpso' }
});
},
//
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 = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
};
</script>

View File

@ -0,0 +1,156 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('do_out')">生产领料</el-button>
<el-button type="primary" @click="add('pur_in')">采购入库</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" row-key="id" :params="query" 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="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="150px">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
查看
</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>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
</template>
<script>
import saveDialog from "./mio_form.vue";
export default {
name: "mio",
components: {
saveDialog
},
data() {
return {
stateDict: {
10: '创建中',
20: '已提交'
},
stateOptions: [
{ id: 10, name: '创建中' },
{ id: 20, name: '已提交' },
],
typeDict: {
'do_out': '生产领料',
'pur_in': '采购入库'
},
cateOptions: [
{ id: 'do_out', name: '生产领料' },
{ id: 'pur_in', name: '采购入库' }
],
dialog: {
save: false,
},
query: {
type: 'do_out'
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
add(type) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", type);
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit", type).setData(row);
});
},
//
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id ,type:row.type,cate:'mainso'}
});
},
//
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 = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
};
</script>

View File

@ -2,12 +2,12 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('do_in')">生产入库</el-button>
<!-- <el-button type="primary" @click="add('do_in')">生产入库</el-button>
<el-button type="primary" @click="add('do_out')">生产领料</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="primary" @click="add('pur_in')">采购入库</el-button>
<el-button type="primary" @click="add('sale_out')">销售发货</el-button>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical"></el-divider> -->
<el-button type="primary" @click="add('other_in')">其他入库</el-button>
<el-button type="primary" @click="add('other_out')">其他出库</el-button>
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型"
@ -93,10 +93,10 @@ export default {
'other_out': '其他出库',
},
cateOptions: [
{ id: 'do_out', name: '生产领料' },
{ id: 'sale_out', name: '销售发货' },
{ id: 'pur_in', name: '采购入库' },
{ id: 'do_in', name: '生产入库' },
// { id: 'do_out', name: '' },
// { id: 'sale_out', name: '' },
// { id: 'pur_in', name: '' },
// { id: 'do_in', name: '' },
{ id: 'other_in', name: '其他入库' },
{ id: 'other_out', name: '其他出库' },
],
@ -132,7 +132,7 @@ export default {
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id }
query: { mio: row.id ,type:row.type}
});
},

View File

@ -57,7 +57,10 @@
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" :mioId="mioId" :belongDeptId="belongDeptId" :belongDeptName="mioObj.belong_dept_name" :mioObj="mioObj"
<save-dialog v-if="dialog.save" ref="saveDialog"
:mioId="mioId" :belongDeptId="belongDeptId"
:belongDeptName="mioObj.belong_dept_name"
:mioObj="mioObj" :cate="cate"
@success="handleSaveSuccess" @closed="dialog.save = false">
</save-dialog>
<check-dialog v-if="dialog.check" ref="checkDialog" :mioitemId="mioitemId"
@ -95,10 +98,13 @@ export default {
'other_in': '其他入库',
'other_out': '其他出库',
},
mioitemId:''
mioitemId:'',
type:'',
cate:'',
};
},
mounted() {
this.cate = this.$route.query.cate;
this.mioId = this.$route.query.mio;
this.params.mio = this.$route.query.mio;
this.apiObj = this.$API.inm.mioitem.list;

View File

@ -80,6 +80,7 @@ const defaultForm = {
export default {
emits: ["success", "closed"],
props: {
cate: { type: String, default: '' },
mioId: { type: String, default: '' },
belongDeptName:{type: String, default: ''},
belongDeptId: { type: String, default: null },
@ -138,8 +139,33 @@ export default {
});
},
getMaterialOptions() {
var type = this.form.type
var type = this.form.type;
var cate = this.cate;
var query
// if(cate=='good'){
// query={ page: 0, is_hidden: false,count__gte:1,material__type:10}
// }else if(cate=='halfgood'){
// if(type == 'do_in'){
// query={ page: 0, is_hidden: false,count__gte:1}
// }else if(type == 'do_out'){
// query={ page: 0, is_hidden: false,count__gte:1,material__type:20}
// }
// }else if(cate=='mainso'){//
// query={ page: 0, is_hidden: false,count__gte:1,material__type__in:30}
// }else if(cate=='helpso'){
// query={ page: 0, is_hidden: false,count__gte:1,material__type__in:40}
// }else{
// }
// if(type == 'do_in'){
// this.$API.inm.warehouse.batch.req(query).then(res => {
// this.materialOptions = res
// })
// }else{
// this.$API.wpm.wmaterial.list.req(query).then(res => {
// this.materialOptions = res
// })
// }
if (type == 'do_out') {
query = { page: 0, type__in: '10, 20, 30', is_hidden: false, is_assemb: false }
this.inputBatchDisable = true

View File

@ -41,6 +41,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务类型" prop="type">
<template #default="scope">
<el-link v-if="scope.row.type == 'mass'" type="primary">量产</el-link>
<el-link v-else type="success">中试</el-link>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
@ -202,6 +208,7 @@ export default {
objItem.count_notok = item.count_notok;
objItem.state = item.state;
objItem.start_date = start_date;
objItem.utaskType = item.type;
objItem.mgroup_name = item.mgroup_name;
objItem.open = true;
let oneDay = 24 * 60 * 60 * 1000; //

View File

@ -43,6 +43,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务类型" prop="type">
<template #default="scope">
<el-link v-if="scope.row.type == 'mass'" type="primary">量产</el-link>
<el-link v-else type="success">中试</el-link>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
@ -177,6 +183,7 @@ export default {
objItem.count_notok = item.count_notok;
objItem.state = item.state;
objItem.start_date = start_date;
objItem.utaskType = item.type;
objItem.mgroup_name = item.mgroup_name;
objItem.open = true;
let oneDay = 24 * 60 * 60 * 1000; //

View File

@ -41,6 +41,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务类型" prop="type">
<template #default="scope">
<el-link v-if="scope.row.type == 'mass'" type="primary">量产</el-link>
<el-link v-else type="success">中试</el-link>
</template>
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
@ -201,6 +207,7 @@ export default {
objItem.count_notok = item.count_notok;
objItem.state = item.state;
objItem.start_date = start_date;
objItem.utaskType = item.type;
objItem.mgroup_name = item.mgroup_name;
objItem.open = true;
let oneDay = 24 * 60 * 60 * 1000; //

View File

@ -14,51 +14,38 @@
label-width="120px"
>
<el-row>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="工段" prop="material">
<el-select
v-model="form.mgroup"
placeholder="工段"
clearable
<el-col :md="12" :sm="24">
<el-form-item label="批次号">
<el-input disabled v-if="mode=='edit'" v-model="form.batch"></el-input>
<el-select
v-else
v-model="form.batch"
style="width: 100%"
@change="getRouteOptions"
>
:disabled="mode=='edit'">
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
v-for="item in wmaterialOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="生产路线" prop="material_out">
<el-form-item prop="type" label="操作人">
<el-input disabled v-if="mode=='edit'" v-model="form.handle_user_name"></el-input>
<el-select
v-model="form.material_out"
placeholder="生产路线"
v-else
v-model="form.handle_user"
placeholder="操作人"
clearable
style="width: 100%"
>
<el-option
v-for="item in routeOptions"
v-for="item in userList"
:key="item.id"
:label="item.label"
: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="产品编号">
<el-select
v-model="form.batch"
style="width: 100%">
<el-option
v-for="item in batchOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
@ -77,23 +64,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item prop="type" label="操作人">
<el-select
v-model="form.handle_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="领用数量">
<el-input-number
@ -153,7 +123,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<!-- <el-col :md="12" :sm="24">
<el-form-item label="操作日期" prop="handle_date">
<el-date-picker
v-model="form.handle_date"
@ -164,7 +134,7 @@
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<div class="formTitle">不合格原因及数量:</div>
<el-row>
@ -307,8 +277,7 @@
</el-form>
<el-footer>
<el-button type="primary" v-loading="isSaveing" @click="submit"
>确定</el-button
>
>确定</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-dialog>
@ -319,7 +288,7 @@ export default {
props: {
mgroup:{ type: String, default: "" },
mtask: { type: String, default: "" },
mgroupId: { type: String, default: "" },
handledate: { type: String, default: "" },
material_out: { type: String, default: "" },
},
data() {
@ -338,23 +307,22 @@ export default {
count_use: 0,
count_notok: 0,
handle_date:'',
count_n_zw:'',
count_n_tw:'',
count_n_qp:'',
count_n_wq:'',
count_n_dl:'',
count_n_pb:'',
count_n_dxt:'',
count_n_jsqx:'',
count_n_qt:'',
count_n_zw:0,
count_n_tw:0,
count_n_qp:0,
count_n_wq:0,
count_n_dl:0,
count_n_pb:0,
count_n_dxt:0,
count_n_jsqx:0,
count_n_qt:0,
handle_user:''
},
mlogb: [],
userList: [],
batchOptions:[],
mgroupOptions: [],
materialOptions: [],
equipmentOptions: [],
wmaterialOptions: [],
shiftOptions: [],
routeOptions:[],
visible: false,
@ -372,6 +340,7 @@ export default {
this.getBatchs();
this.getUserList();
this.getEquipment();
this.getWMaterial();
this.getShiftOptions();
// let date = new Date();
// let year = date.getFullYear();
@ -379,11 +348,12 @@ export default {
// let day = date.getDate();
// this.form.handle_date = year + "-" + month + "-" + day;
this.form.material_out = this.material_out;
this.form.handle_date = this.handle_date;
this.form.mgroup = this.mgroup;
},
methods: {
getRouteOptions() {
this.$API.mtm.route.list.req({ page: 0, mgroup: this.form.mgroup}).then(res => {
this.$API.mtm.route.list.req({ page: 0, mgroup: this.mgroup}).then(res => {
for (var i = 0; i < res.length; i++) {
if (res[i].material_in == null) {
res[i].material_in_name = ''
@ -394,8 +364,6 @@ export default {
res[i].label = res[i].material_in_name + '->' + res[i].material_out_name
}
this.routeOptions = res;
console.log(this.routeOptions);
debugger;
})
},
getShiftOptions() {
@ -403,6 +371,25 @@ export default {
this.shiftOptions = res;
});
},
getWMaterial(){
this.$API.wpm.wmaterial.list.req({belong_dept__name: '6车间',page:0}).then(res=>{
if(res.length>0){
let arr = [];
res.forEach(item => {
// if(item.count>0){}
arr.push(item.batch)
});
this.wmaterialOptions = arr;
}
})
},
//
getBatchs() {
let that = this;
this.$API.wpm.wmaterial.batchs.req({belong_dept_name:"6车间"}).then(res=>{
that.batchOptions = res;
});
},
getUserList() {
let that = this;
this.$API.system.user.list
@ -411,52 +398,13 @@ export default {
that.userList = res;
});
},
//
getBatchs() {
let that = this;
this.$API.wpm.wmaterial.batchs
.req({ belong_dept_name: "6车间" })
.then((res) => {
that.batchOptions = res;
});
},
//
getEquipment() {
this.$API.em.equipment.list.req({ page: 0, type: 10 }).then((res) => {
this.equipmentOptions = res;
});
},
getMaterial(mgroupId) {
if (mgroupId != 0) {
this.$API.mtm.route.list
.req({ page: 0, mgroup: mgroupId })
.then((res) => {
let mOptions = [];
for (var i = 0; i < res.length; i++) {
mOptions.push({
id: res[i].material_out,
name: res[i].material_out_name,
material_in: res[i].material_in
});
}
this.materialOptions = mOptions;
});
} else {
let obj = {};
obj.page = 0;
obj.is_hidden = false;
this.$API.mtm.material.list.req(obj).then((res) => {
this.materialOptions = res;
});
}
},
//
// getMaterial(){
// let that = this;
// this.$API.wpm.wmaterial.list.req({belong_dept_name:'8',page:0}).then(res=>{
// that.materialOptions = res;
// });
// },
//
open(mode = "add") {
this.mode = mode;
@ -477,13 +425,12 @@ export default {
},
//
submit() {
console.log(this.form)
debugger;
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
this.form.mtask = this.mtask;
if (this.mode == "add") {
this.form.mtask = this.mtask;
this.form.handle_date = this.handledate;
this.$API.wpm.mlog.create
.req(this.form)
.then((res) => {
@ -505,8 +452,7 @@ export default {
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
.catch((err) => {
}).catch((err) => {
//
this.isSaveing = false;
return err;
@ -546,14 +492,6 @@ export default {
this.form.rate = null;
}
},
//
materialInChange(val) {
for(let i=0;i<this.materialOptions.length;i++){
if(this.materialOptions[i].id==val){
this.form.material_out = data[0].material_out;
}
}
},
},
};
</script>

View File

@ -2,6 +2,7 @@
<el-container>
<el-aside style="width: 50%">
<el-container>
<!-- 当天任务列表 -->
<el-header style="height:50%; padding: 0">
<el-container>
<el-header>
@ -49,6 +50,7 @@
</el-main>
</el-container>
</el-header>
<!-- 各工序进度 -->
<el-main class="nopadding">
<el-container>
<el-header>
@ -79,8 +81,10 @@
</el-aside>
<el-main class="nopadding">
<el-container>
<!-- 任务信息&&日志 -->
<el-header style="height: 60%; padding: 0">
<el-container>
<!-- 任务信息 -->
<el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
@ -101,6 +105,7 @@
</el-descriptions>
</el-card>
</el-header>
<!-- 日志 -->
<el-main style="padding: 0;">
<el-container>
<el-header>
@ -123,16 +128,25 @@
<el-table-column label="加工数量" prop="count_real"> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="count_notok" label="原因一"/>
<el-table-column prop="count_notok" label="原因二"/>
<el-table-column prop="count_notok" label="原因三"/>
<el-table-column prop="count_n_wq" label="弯曲"/>
<el-table-column prop="count_n_zw" label="炸纹"/>
<el-table-column prop="count_n_tw" label="条纹"/>
<el-table-column prop="count_n_qp" label="气泡"/>
<el-table-column prop="count_n_dl" label="断裂"/>
<el-table-column prop="count_n_pb" label="偏壁"/>
<el-table-column prop="count_n_dxt" label="大小头"/>
<el-table-column prop="count_n_jsqx" label="结石气绒"/>
<el-table-column prop="count_n_qt" label="其他"/>
</el-table-column>
<el-table-column label="操作人" prop="count_ok"></el-table-column>
<el-table-column label="操作" fixed="right" width="80">
<el-table-column label="操作" fixed="right" width="130">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)">
编辑
</el-button>
<el-button link type="success" @click="table_show(scope.row)">
日志记录
</el-button>
</template>
</el-table-column>
</scTable>
@ -141,10 +155,9 @@
</el-main>
</el-container>
</el-header>
<!-- 车间库存 -->
<el-main style="padding: 0;">
<el-container>
<el-main style="padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
@ -177,8 +190,6 @@
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
@ -188,17 +199,23 @@
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:handledate="handledate"
:material_out="material_out"
@success="handleSaveSuccess"
@closed="dialogSave = false"
></save-dialog>
<showDrawer ref="showDrawer"
v-if="visibleDrawer"
@closed="visibleDrawer = false">
</showDrawer>
</el-container>
</template>
<script>
import saveDialog from "./mlog6_form.vue";
import showDrawer from "./mlog_drawer.vue";
export default {
components: {
saveDialog,
saveDialog,showDrawer
},
data() {
return {
@ -231,7 +248,9 @@ export default {
paramsWm: {
belong_dept__name: '6车间'
},
handledate:'',
dialogSave:false,
visibleDrawer:false,
}
},
mounted() {
@ -243,6 +262,12 @@ export default {
tomio() {
this.$router.push({ name: "mio" });
},
table_show(row) {
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
rowClick(row) {
let that = this;
@ -256,10 +281,13 @@ export default {
this.mgroup = row.mgroup;
this.mtask = row.id;
this.material_out = row.material_out_.id;
this.handledate = row.start_date;
this.paramsMlog.mtask = this.mtask;
this.apiObjMlog = this.$API.wpm.mlog.list;
},
handleQueryMtask(){},
handleQueryMtask(){
this.$refs.table.refresh();
},
//
addMlog() {
let that = this;
@ -281,15 +309,6 @@ export default {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_show(row) {
this.$nextTick(() => {
this.$router.push({
name: "worktaskFlog",
query: { mtask: row.id }
});
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {

View File

@ -0,0 +1,130 @@
<template>
<el-drawer v-model="visible" title="日志记录" :size="1000" destroy-on-close @closed="$emit('closed')">
<el-container>
<el-main>
<scTable ref="drawer_table" :apiObj="apiObj" row-key="id" stripe :params="paramsObj">
<el-table-column type="index" fixed="left" width="40" />
<el-table-column label="变更时间" fixed="left">
<template #default="scope">
<span>{{scope.row.change_time.slice(0, -3)}}</span>
</template>
</el-table-column>
<el-table-column label="工序">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.mgroup_name}}</span>
</template>
</el-table-column>
<el-table-column label="产品编号">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.batch}}</span>
</template>
</el-table-column>
<el-table-column label="加工设备">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.equipment_name}}</span>
</template>
</el-table-column>
<el-table-column label="领用数量">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_use}}</span>
</template>
</el-table-column>
<el-table-column label="加工数量">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_real}}</span>
</template>
</el-table-column>
<el-table-column label="合格数量">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_ok}}</span>
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column label="弯曲">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_wq}}</span>
</template>
</el-table-column>
<el-table-column label="炸纹">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_zw}}</span>
</template>
</el-table-column>
<el-table-column label="条纹">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_tw}}</span>
</template>
</el-table-column>
<el-table-column prop="" label="气泡">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_qp}}</span>
</template>
</el-table-column>
<el-table-column label="断裂">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_dl}}</span>
</template>
</el-table-column>
<el-table-column label="偏壁">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_pb}}</span>
</template>
</el-table-column>
<el-table-column prop="" label="大小头">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_dxt}}</span>
</template>
</el-table-column>
<el-table-column label="结石气绒">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_jsqx}}</span>
</template>
</el-table-column>
<el-table-column label="其他">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.count_n_qt}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作人">
<template #default="scope">
<span v-if="scope.row.val_new">{{scope.row.val_new.handle_user_name}}</span>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
},
data() {
return {
visible: false,
apiObj: this.$API.ops.logs.audit,
paramsObj: {},
state_: {
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
}
},
mounted() {
},
methods: {
handleMtaskQuery() {
this.$refs.drawer_table.queryData(this.paramsObj)
},
open() {
this.visible = true;
return this;
},
}
}
</script>