10.26日要修改内容以及检验页面

This commit is contained in:
shijing 2023-10-27 17:15:36 +08:00
parent e246e6f33b
commit 9fb27aa062
15 changed files with 1338 additions and 590 deletions

View File

@ -164,5 +164,13 @@ export default {
);
}
},
stop:{
name: "停止任务",
req: async function(id){
return await http.post(
`${config.API_URL}/pm/utask/${id}/stop/`
);
}
},
}
}

View File

@ -9,7 +9,7 @@
<template>
<div class="sc-form-table" ref="scFormTable">
<el-table :data="data" ref="table" border stripe>
<el-table :data="data" ref="table" border >
<el-table-column type="index" width="50" fixed="left">
<template #header>
<el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>

View File

@ -767,8 +767,8 @@ const routes = [
// }
]
},
//生产执行 wpm
{
//生产执行 wpm
{
"name": "wpm",
"path": "/wpm",
"meta": {
@ -811,6 +811,69 @@ const routes = [
}
]
},
//检验管理 qm
{
"name": "qm",
"path": "/qm",
"meta": {
"title": "检验管理",
"icon": "el-icon-grid",
"type": "menu",
"perms": ["qm"]
},
"children": [
{
"name": "income",
"path": "/qm/income",
"meta": {
"title": "入厂检验",
"icon": "el-icon-cellphone",
"perms": ["qm"]
},
"component": "qm/income"
},
{
"name": "first",
"path": "/qm/first",
"meta": {
"title": "首件检验",
"icon": "el-icon-cellphone",
"perms": ["qm"]
},
"component": "qm/first"
},
{
"name": "qmProcess",
"path": "/qm/qmProcess",
"meta": {
"title": "过程检验",
"icon": "el-icon-cellphone",
"perms": ["qm"]
},
"component": "qm/process"
},
{
"name": "behavior",
"path": "/qm/behavior",
"meta": {
"title": "性能检验",
"icon": "el-icon-cellphone",
"perms": ["qm"]
},
"component": "qm/behavior"
},
{
"name": "product",
"path": "/qm/product",
"meta": {
"title": "成品检验",
"icon": "el-icon-cellphone",
"perms": ["qm"]
},
"component": "qm/product"
}
]
},
//库存 inm
{
"name": "inm",

View File

@ -24,15 +24,12 @@
</div>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="table_add"
v-auth="'route.create'"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'route.create'"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -72,10 +69,8 @@
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
<el-dialog :title="dialogTitle" v-model="dialogVisible" width="30%">
@ -85,13 +80,20 @@
</el-form-item>
<el-form-item label="工序" prop="process">
<el-select v-model="form.process" placeholder="工序" clearable style="width: 100%;" :disabled="updateDisable">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
<el-option
v-for="item in processOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="出材率" prop="out_rate">
<el-input-number v-model="form.out_rate" :max="100" :precision="1" :step="0.1" />
</el-form-item>
<el-form-item label="统计工序">
<el-switch v-model="form.is_count_utask" />
</el-form-item>
<el-form-item label="自动排产" prop="is_autotask">
<el-switch v-model="form.is_autotask" />
</el-form-item>
@ -99,23 +101,15 @@
<el-select v-model="form.material_in" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="
float: right;
color: '#E6A23C';
font-size: 13px;
" v-if="item.is_hidden">{{ item.process_name }}-</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{ item.process_name }}-隐</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="主要输出" prop="material_out">
<el-select v-model="form.material_out" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id"><span
style="float: left">{{ item.name }}</span>
<span style="
float: right;
color: '#E6A23C';
font-size: 13px;
" v-if="item.is_hidden">{{ item.process_name }}-</span></el-option>
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{ item.process_name }}-隐</span></el-option>
</el-select>
</el-form-item>
</el-form>
@ -126,112 +120,112 @@
</el-dialog>
</template>
<script>
const defaultForm = {
process: null,
sort: 1,
out_rate: 100,
is_autotask: true,
};
export default {
name: "route",
components: {},
data() {
return {
apiObj: null,
query: {},
productOptions: [],
dialogVisible: false,
form: {},
rules: {
process: [{ required: true, trigger: "blur" }],
sort: [{ required: true, trigger: "blur" }],
out_rate: [{ required: true, trigger: "blur" }]
const defaultForm = {
process: null,
sort: 1,
out_rate: 100,
is_autotask: true,
is_count_utask:false
};
export default {
name: "route",
components: {},
data() {
return {
apiObj: null,
query: {},
productOptions: [],
dialogVisible: false,
form: {},
rules: {
process: [{ required: true, trigger: "blur" }],
sort: [{ required: true, trigger: "blur" }],
out_rate: [{ required: true, trigger: "blur" }]
},
processOptions: [],
materialOptions: [],
selectedProduct: { id: 0 },
dialogTitle: '新增',
updateDisable: false,
currentRoute: [],
}
},
mounted() {
this.getProducts()
this.getProcess()
this.getMaterial()
},
methods: {
getRoute() {
this.$API.mtm.route.list({ material: this.selectedProduct.id, page: 0 }).then(res => {
this.currentRoute = res
})
},
processOptions: [],
materialOptions: [],
selectedProduct: { id: 0 },
dialogTitle: '新增',
updateDisable: false,
currentRoute: [],
}
},
mounted() {
this.getProducts()
this.getProcess()
this.getMaterial()
},
methods: {
getRoute() {
this.$API.mtm.route.list({ material: this.selectedProduct.id, page: 0 }).then(res => {
this.currentRoute = res
})
},
//
getProcess() {
var res = this.$API.mtm.process.list.req({ page: 0 }).then(res => {
this.processOptions = res;
});
},
getMaterial() {
this.$API.mtm.material.list.req({ page: 0, type__in: "10,20" }).then(res => {
this.materialOptions = res
})
},
getProducts() {
this.$API.mtm.material.list.req({ page: 0, need_route: true }).then(res => {
res.forEach(m => {
m.label = m.name
//
getProcess() {
var res = this.$API.mtm.process.list.req({ page: 0 }).then(res => {
this.processOptions = res;
});
},
getMaterial() {
this.$API.mtm.material.list.req({ page: 0, type__in: "10,20" }).then(res => {
this.materialOptions = res
})
this.productOptions = res
})
},
table_add() {
if (this.selectedProduct.id === 0) {
this.$message.error('请先选择左侧产品');
return
}
this.dialogTitle = '新增'
this.updateDisable = false;
this.form = Object.assign({}, defaultForm);
this.form.material = this.selectedProduct.id
this.dialogVisible = true;
},
table_edit(row) {
this.dialogTitle = '编辑'
this.updateDisable = true;
this.form = Object.assign({}, row);
this.dialogVisible = true;
},
table_del(row) {
this.$API.mtm.route.delete.req(row.id).then(res => {
this.productClick()
})
},
form_save() {
if (this.dialogTitle == '新增') {
this.$API.mtm.route.create.req(this.form).then(res => {
},
getProducts() {
this.$API.mtm.material.list.req({ page: 0, need_route: true }).then(res => {
res.forEach(m => {
m.label = m.name
})
this.productOptions = res
})
},
table_add() {
if (this.selectedProduct.id === 0) {
this.$message.error('请先选择左侧产品');
return
}
this.dialogTitle = '新增'
this.updateDisable = false;
this.form = Object.assign({}, defaultForm);
this.form.material = this.selectedProduct.id
this.dialogVisible = true;
},
table_edit(row) {
this.dialogTitle = '编辑'
this.updateDisable = true;
this.form = Object.assign({}, row);
this.dialogVisible = true;
},
table_del(row) {
this.$API.mtm.route.delete.req(row.id).then(res => {
this.productClick()
this.dialogVisible = false
this.getMaterial()
})
} else if (this.dialogTitle == '编辑') {
this.$API.mtm.route.update.req(this.form.id, this.form).then(res => {
this.productClick()
this.dialogVisible = false
},
form_save() {
if (this.dialogTitle == '新增') {
this.$API.mtm.route.create.req(this.form).then(res => {
this.productClick()
this.dialogVisible = false
this.getMaterial()
})
} else if (this.dialogTitle == '编辑') {
this.$API.mtm.route.update.req(this.form.id, this.form).then(res => {
this.productClick()
this.dialogVisible = false
})
}
},
productClick(data) {
let materialId = this.selectedProduct.id
if (data) {
this.selectedProduct = data
materialId = data.id
}
this.$API.mtm.route.list.req({ page: 0, material: materialId }).then(res => {
this.currentRoute = res
})
}
},
productClick(data) {
let materialId = this.selectedProduct.id
if (data) {
this.selectedProduct = data
materialId = data.id
}
this.$API.mtm.route.list.req({ page: 0, material: materialId }).then(res => {
this.currentRoute = res
})
}
}
}
</script>

View File

@ -1,297 +1,32 @@
<template>
<el-container style="flex-direction: column">
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
<div class="right-panel btnsContainer">
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button>
<el-button type="primary" @click="utaskAssgin" v-loading="isloading">任务下达</el-button>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间">
<scTable
ref="table8"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask8"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="成型7车间" name="7车间">
<scTable
ref="table7"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask7"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="成型10车间" name="10车间">
<scTable
ref="table10"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask10"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</el-main>
<el-main class="nopadding" style="position: relative;">
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
</div>
</el-header>
<scTable
ref="table2"
:data="dataList"
row-key="id"
stripe
:height="bottomHeight"
:hideDo="hideDo"
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
</el-table-column>
<el-table-column label="产品名称" prop="name" width="100" show-overflow-tooltip fixed="left">
</el-table-column>
<el-table-column label="型号" prop="xh" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划量" prop="count" width="100" fixed="left">
</el-table-column>
<el-table-column label="日均产量" prop="count1" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="100" fixed="left">
</el-table-column>
<el-table-column v-for="item in columList" :label="item" :key="item">
<template #default="scope">
<div :class="bindClass(scope.row)">
<div v-if="activeName=='10车间'">{{ scope.row.count01 }}</div>
<div>{{ scope.row.count02 }}</div>
<div>{{ scope.row.count03 }}</div>
</div>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:activeName="activeName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="任务详情"
v-model="visibleRecord"
:size="800"
destroy-on-close
@closed="visibleRecord=false"
>
<div class="right-panel tabsHeader">
<el-date-picker
v-model="paramsObj.start_date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleDetailQuery"
>查询</el-button>
</div>
<el-container v-loading="isloading">
<el-main style="padding: 0 20px 20px 20px">
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<el-table-column type="index" width="50"/>
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="工作日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state" show-overflow-tooltip>
<template #default="scope">
<el-container style="flex-direction: column">
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
<div class="right-panel btnsContainer">
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button>
<el-button type="primary" @click="utaskAssgin" v-loading="isloading">任务下达</el-button>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间">
<scTable
ref="table8"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask8"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
@ -299,11 +34,282 @@
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==20"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==20">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="成型7车间" name="7车间">
<scTable
ref="table7"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask7"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="成型10车间" name="10车间">
<scTable
ref="table10"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask10"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</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="start_date">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</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">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</el-main>
<el-main class="nopadding" style="position: relative;">
<el-header style="justify-content: flex-end;">
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
</div>
</el-header>
<scTable
ref="table2"
:data="dataList"
row-key="id"
stripe
:height="bottomHeight"
:hideDo="hideDo"
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
</el-table-column>
<el-table-column label="产品名称" prop="name" width="100" show-overflow-tooltip fixed="left">
</el-table-column>
<el-table-column label="型号" prop="xh" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划量" prop="count" width="100" fixed="left">
</el-table-column>
<el-table-column label="日均产量" prop="count1" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="100" fixed="left">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="100" fixed="left">
</el-table-column>
<el-table-column v-for="item in columList" :label="item" :key="item">
<template #default="scope">
<div :class="bindClass(scope.row)">
<div v-if="activeName=='10车间'">{{ scope.row.count01 }}</div>
<div>{{ scope.row.count02 }}</div>
<div>{{ scope.row.count03 }}</div>
</div>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:activeName="activeName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="任务详情"
v-model="visibleRecord"
:size="800"
destroy-on-close
@closed="visibleRecord=false"
>
<div class="right-panel tabsHeader">
<el-date-picker
v-model="paramsObj.start_date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleDetailQuery"
>查询</el-button>
</div>
<el-container v-loading="isloading">
<el-main style="padding: 0 20px 20px 20px">
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<el-table-column type="index" width="50"/>
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="工作日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.state!==40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
import saveDialog from "./mtask_form.vue";
@ -337,15 +343,6 @@ export default {
dataList:[
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:250, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
],
columList:['10.15','10.16','10.17'],
selection: [],
@ -424,6 +421,20 @@ export default {
});
}).catch(() => {});
},
//
table_end(row){
this.$confirm(`确定终止该任务吗?`, "提示", {
type: "warning",
}).then(() => {
// this.$API.pm.utask.delete.req(row.id).then((res) => {
// this.$message.success("");
// this.$refs.table7.refresh();
// return res;
// }).catch((err) => {
// return err;
// });
}).catch(() => {});
},
//
handleSaveSuccess(data, mode) {
this.$refs.table7.refresh();
@ -508,28 +519,31 @@ export default {
};
</script>
<style scoped>
.countBlock{
width: 80px;
color: #ffffff;
text-align: center;
}
.redColor{
background-color: brown;
}
.greenColor{
background-color: green;
}
.orangeColor{
background-color: orange;
}
.el-main.nopadding{
padding:0 20px 0 20px
}
.btnsContainer{
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
}
.right-panel > * + * {
margin-left: 10px;
}
.countBlock{
width: 80px;
color: #ffffff;
text-align: center;
}
.redColor{
background-color: brown;
}
.greenColor{
background-color: green;
}
.orangeColor{
background-color: orange;
}
.el-main.nopadding{
padding:0 20px 0 20px
}
.btnsContainer{
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
}
</style>

View File

@ -42,8 +42,10 @@
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==20"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==20">
删除
</el-link>
</template>
@ -290,6 +292,20 @@ export default {
this.$message.error('未选择任何任务')
}
},
//
table_end(row){
this.$confirm(`确定终止该任务吗?`, "提示", {
type: "warning",
}).then(() => {
// this.$API.pm.utask.delete.req(row.id).then((res) => {
// this.$message.success("");
// this.$refs.table7.refresh();
// return res;
// }).catch((err) => {
// return err;
// });
}).catch(() => {});
},
utaskAssgin(){
let that = this;
if(that.selectedIds.length>0){
@ -382,11 +398,12 @@ export default {
},
//
async table_del(row) {
let that = this;
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.utask.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
that.$message.success("删除成功");
that.$refs.table1.refresh();
return res;
}).catch((err) => {
@ -394,14 +411,9 @@ export default {
});
}).catch(() => { });
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
handleSaveSuccess() {
this.$refs.table1.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
@ -433,6 +445,9 @@ export default {
};
</script>
<style scoped>
.right-panel > * + * {
margin-left: 10px;
}
.el-main.nopadding {
padding: 0 20px 0 20px
}

View File

@ -20,11 +20,6 @@
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode=='edit'"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="activeName!=='6车间'">
<el-form-item label="任务数">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right" placeholder="任务数"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="activeName!=='6车间'">
<el-form-item label="工段" prop="mgroup">
<el-select
@ -61,6 +56,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right" placeholder="任务数"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="开工日期" prop="start_date">
<el-date-picker
@ -112,6 +112,8 @@ export default {
},
form: {},
rules: {
mgroup:[{required:true, message:'请选择工段', trigger: "blur"}],
count:[{required:true, message:'请输入任务数', trigger: "blur"}],
start_date: [{required: true, message: "请选择开始时间", trigger: "blur"}],
end_date: [{required: true, message: "请选择结束时间", trigger: "blur"}],
number: [{required: true, message: "请输入任务编号", trigger: "blur"}],
@ -151,6 +153,7 @@ export default {
if(this.activeName=='6车间'){
obj.type = 10;
obj.is_hidden = false;
obj.is_assemb = false;
}else{
obj.type = 20;
obj.is_hidden = false;
@ -181,7 +184,7 @@ export default {
res = await this.$API.pm.utask.update.req(this.form.id,this.form);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.$emit("success");
this.visible = false;
this.$message.success("操作成功");
} catch (err) {

119
src/views/qm/behavior.vue Normal file
View File

@ -0,0 +1,119 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
<el-button type="primary" icon="el-icon-bottom-left" @click="importInspect">导入</el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="检测内容" prop="model">
</el-table-column>
<el-table-column label="检验员" prop="factory" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">查看</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)">删除</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)">下载</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
<el-dialog
title="导入"
destroy-on-close
v-model="visible"
@closed="closeVisible"
>
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
<el-form-item label="模板文件">
<el-link href="" target="_blank" type="primary" style="margin-right:10px">模板一</el-link>
<el-link href="" target="_blank" type="primary">模板二</el-link>
</el-form-item>
<el-form-item label="导入文件" prop="file">
<el-input><span>{{ form.fileName }}</span></el-input>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submitFile">提交</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-dialog>
</el-container>
</template>
<script>
export default {
name: "rparty",
data() {
return {
// apiObj: this.$API.qm.list,
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
state_: {
10: '',
20: '',
},
form:{
file:'',
fileName:'',
},
rules: {
file:[{required:true, message:'请上传导入文件', trigger: "blur"}]
},
visible:true,
isSaveing:false,
selection: [],
};
},
methods: {
submitFile(){
},
closeVisible(){
this.visible = false;
},
//
table_show(row) {
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

102
src/views/qm/first.vue Normal file
View File

@ -0,0 +1,102 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
</el-table-column>
<el-table-column label="检测内容" prop="model">
</el-table-column>
<el-table-column label="检测标准" prop="factory" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作人测量值" prop="production_date">
</el-table-column>
<el-table-column label="操作人" prop="production_date">
</el-table-column>
<el-table-column label="专检人测量值" prop="buy_date">
</el-table-column>
<el-table-column label="专检人" prop="production_date">
</el-table-column>
<el-table-column label="结论" prop="production_date">
</el-table-column>
<!-- <el-table-column label="结论">
<template #default="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "rparty",
data() {
return {
// apiObj: this.$API.qm.list,
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
selection: [],
state_: {
10: '',
20: '',
},
};
},
methods: {
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

102
src/views/qm/income.vue Normal file
View File

@ -0,0 +1,102 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
</el-table-column>
<el-table-column label="检测内容" prop="model">
</el-table-column>
<el-table-column label="检测标准" prop="factory" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作人测量值" prop="production_date">
</el-table-column>
<el-table-column label="操作人" prop="production_date">
</el-table-column>
<el-table-column label="专检人测量值" prop="buy_date">
</el-table-column>
<el-table-column label="专检人" prop="production_date">
</el-table-column>
<el-table-column label="结论" prop="production_date">
</el-table-column>
<!-- <el-table-column label="结论">
<template #default="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "rparty",
data() {
return {
// apiObj: this.$API.qm.list,
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
selection: [],
state_: {
10: '',
20: '',
},
};
},
methods: {
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

102
src/views/qm/process.vue Normal file
View File

@ -0,0 +1,102 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
</el-table-column>
<el-table-column label="检测内容" prop="model">
</el-table-column>
<el-table-column label="检测标准" prop="factory" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作人测量值" prop="production_date">
</el-table-column>
<el-table-column label="操作人" prop="production_date">
</el-table-column>
<el-table-column label="专检人测量值" prop="buy_date">
</el-table-column>
<el-table-column label="专检人" prop="production_date">
</el-table-column>
<el-table-column label="结论" prop="production_date">
</el-table-column>
<!-- <el-table-column label="结论">
<template #default="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "rparty",
data() {
return {
// apiObj: this.$API.qm.list,
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
selection: [],
state_: {
10: '',
20: '',
},
};
},
methods: {
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

102
src/views/qm/product.vue Normal file
View File

@ -0,0 +1,102 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="工序" prop="number">
</el-table-column>
<el-table-column label="检测内容" prop="model">
</el-table-column>
<el-table-column label="检测标准" prop="factory" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作人测量值" prop="production_date">
</el-table-column>
<el-table-column label="操作人" prop="production_date">
</el-table-column>
<el-table-column label="专检人测量值" prop="buy_date">
</el-table-column>
<el-table-column label="专检人" prop="production_date">
</el-table-column>
<el-table-column label="结论" prop="production_date">
</el-table-column>
<!-- <el-table-column label="结论">
<template #default="scope">
<el-tag v-if="scope.row.state===10" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===20" type="warning">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else-if="scope.row.state===30">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="danger">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "rparty",
data() {
return {
// apiObj: this.$API.qm.list,
apiObj:null,
query: {
page:1,
page_size:20,
type:10
},
selection: [],
state_: {
10: '',
20: '',
},
};
},
methods: {
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -28,7 +28,7 @@
<template #default="scope">
<span v-if="!scope.row.change">{{ scope.row.mgroup_name }}</span>
<el-select v-else v-model="scope.row.batch" placeholder="请选择">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-option v-for="item in options" :key="item" :label="item" :value="item"></el-option>
</el-select>
</template>
</el-table-column>
@ -120,7 +120,6 @@
related:[],
userList:[],
formList: [],
processOptions:[],
recordId:'',
visible: false,
isSaveing: false,
@ -137,7 +136,6 @@
this.getBatchs();
this.getFormList();
this.getUserList();
this.getProcess();
},
methods: {
//
@ -173,12 +171,7 @@
})
})
},
//
getProcess(){
var res = this.$API.mtm.process.list.req({page:0}).then(res=>{
this.processOptions = res;
});
},
//
getBatchs(){
let that = this;
@ -206,6 +199,12 @@
deleteRow(){
this.$refs.table.deleteRow(0)
},
getList(){
this.$API.mtm.material.list.req({page:0}).then(res=>{
this.options = res;
})
},
getReceptionist(data) {
//
console.log(data);

View File

@ -3,16 +3,16 @@
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
<div class="right-panel tabsHeader">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
</div>
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="粗加工6车间" name="first">
<scTable
@ -106,7 +106,7 @@
<el-col :span="11">
<div class="tableTitle" style="display:flex;justify-content: space-between;">
<div>车间物料</div>
<div class="btnsContainer" style=" ">
<div class="btnsContainer right-panel">
<el-button type="primary" @click="tomio">车间入库</el-button>
<el-button type="primary" @click="tomio">车间出库</el-button>
</div>
@ -275,21 +275,24 @@ export default {
};
</script>
<style scoped>
.tabsHeader{
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index:100
}
.el-main.nopadding{
padding:0 20px 0 20px
}
.tableTitle{
height: 40px;
.tabsHeader{
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index:100
}
.right-panel > * + * {
margin-left: 10px;
}
.el-main.nopadding{
padding:0 20px 0 20px
}
.tableTitle{
height: 40px;
line-height: 40px;
font-size: 14px;
box-sizing: border-box;
border-bottom: 1px solid #eeeeee;
}
}
</style>

View File

@ -18,62 +18,84 @@
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="计划日期:">{{ orderObj.start_date }}</el-form-item>
</el-col>
<el-button v-if="orderObj.state!==40" type="primary" @click="submitForm">提交</el-button>
<el-button v-if="orderObj.state!==40" type="primary" @click="submit">提交</el-button>
</el-row>
</el-form>
</el-card>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" :disabled="orderObj.state==40">新增记录</el-button>
<el-button type="primary" icon="el-icon-plus" @click="addRow" :disabled="orderObj.state==40">新增记录</el-button>
</div>
<div class="right-panel"></div>
</el-header>
<el-main class="nopadding">
<scTable
ref="mlogTable"
:apiObj="apiObj"
row-key="id"
stripe
:hidePagination="true"
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="产品编号" prop="batch">
</el-table-column>
<el-table-column label="产品名称" prop="number">
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="规格" prop="number">
</el-table-column>
<el-table-column label="领料数量" prop="count_use">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-if="orderObj.state==10||orderObj.state==20"
v-auth="'equipment'"
>编辑
</el-link>
<!-- 提交后变查看 -->
<el-link
v-else
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment'"
>查看
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
>删除
</el-link>
</template>
</el-table-column>
</scTable>
<sc-form-table ref="table" v-model="relatedList" hideAdd drag-sort placeholder="暂无数据">
<el-table-column prop="type" label="工序" min-width="100">
<template #default="scope">
<span v-if="!scope.row.change">{{ scope.row.mgroup_name }}</span>
<el-select v-else v-model="scope.row.mtask" placeholder="请选择">
<el-option v-for="item in related" :key="item.id" :label="item.mgroup_name" :value="item.id"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="type" label="产品编号" min-width="120" align="center">
<template #default="scope">
<el-select v-model="scope.row.batch" style="width: 100%" :disabled="!scope.row.isedit">
<el-option
v-for="item in batchOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="加工数量" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.count_use" placeholder="加工数量" :disabled="!scope.row.isedit"></el-input>
</template>
</el-table-column>
<el-table-column prop="val" label="合格数量" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.count_ok" placeholder="合格数量" :disabled="!scope.row.isedit"></el-input>
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="val" label="原因1" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.count_notok" placeholder="原因1" :disabled="!scope.row.isedit"></el-input>
</template>
</el-table-column>
<el-table-column prop="val" label="原因2" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.count_notok" placeholder="原因2" :disabled="!scope.row.isedit"></el-input>
</template>
</el-table-column>
<el-table-column prop="val" label="原因3" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.count_notok" placeholder="原因3" :disabled="!scope.row.isedit"></el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="type" label="操作人" min-width="120" align="center">
<template #default="scope">
<el-select v-model="scope.row.handle_user" filterable style="width: 100%" :disabled="!scope.row.isedit">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="type" label="操作" min-width="80" align="center">
<template #default="scope">
<el-button type="primary" v-if="scope.row.isedit" @click="submitForm(scope.row,scope.$index)">确定</el-button>
<el-button type="warning" v-else @click="editForm(scope.row,scope.$index)">编辑</el-button>
</template>
</el-table-column>
</sc-form-table>
</el-main>
</el-container>
<save-dialog
@ -104,7 +126,12 @@
page:0,
mtask:''
},
materialId:'',
related:[],
userList:[],
formList: [],
relatedList:[],
batchOptions:[],
processOptions:[],
};
},
mounted(){
@ -112,50 +139,140 @@
this.query.mtask = this.$route.query.mtask;
this.apiObj = this.$API.wpm.mlog.relatedFirst;
this.getTask();//
this.getUserList();
this.getBatchs();
this.getProcess()
},
methods: {
//
getTask(){
this.$API.pm.mtask.item.req(this.mtask).then((res) => {
this.orderObj = res;
let that = this;
that.$API.pm.mtask.item.req(that.mtask).then((res) => {
that.orderObj = res;
that.getFormList();
})
},
//
getProcess(){
var res = this.$API.mtm.process.list.req({page:0}).then(res=>{
res.forEach(item=>{
if(item.belong_dept_name=='6车间'){
this.processOptions.push(item)
}
})
});
},
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
addRow() {
let obj = {
mtask:'',
batch: '',
count_use:null,
count_real:null,
count_ok: null,
count_notok: null,
handle_date:'',
handle_user:'',
mgroup_name:"",
isedit:true,
change:true
}
this.formList.push(obj);
// this.dialog.save = true;
// this.$nextTick(() => {
// this.$refs.saveDialog.open("add");
// });
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
getFormList(){
let that = this;
that.$API.pm.mtask.related.req(that.orderObj.id).then(res=>{
that.related = res;
let ids = [];
res.forEach(item=>{
ids.push(item.id)
let obj = {
mtask:item.id,
batch: '',
count_use:null,
count_ok: null,
count_notok: null,
handle_date:'',
handle_user:'',
mgroup_name: item.mgroup_name,
isedit:true,
change:false
}
that.formList.push(obj)
})
this.setData(ids);
})
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
getUserList(){
let that = this;
this.$API.system.user.list.req({belong_dept:'3423857962907983872',page:0}).then(res=>{
that.userList = res;
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
//
getBatchs(){
let that = this;
this.$API.wpm.wmaterial.batchs.req({belong_dept_name:'6车间'}).then(res=>{
that.batchOptions = res;
});
},
editForm(row,index){
debugger;
console.log(index)
console.log(this.relatedList[index].isedit)
this.relatedList[index].isedit = true;
console.log(this.relatedList)
},
//
submitForm(row,index) {
if(row.id){
debugger;
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.mlogTable.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => {});
console.log(row)
this.$API.wpm.mlog.update.req(row.id,row).then(res=>{
this.relatedList[index].isedit = false;
})
}else{
debugger;
let obj = row;
obj.handle_date = this.orderObj.start_date;
obj.count_real = obj.count_use;
this.$API.wpm.mlog.create.req(obj).then(res=>{
this.relatedList[index].isedit = false;
this.relatedList[index].change = false;
})
}
},
//
setData(data) {
let obj = {};
let ids = data.join(',')
obj.mtask__in = ids;
obj.handle_date = this.orderObj.start_date;
obj.mtask__mgroup__belong_dept__name = '6车间';
this.$API.wpm.mlog.list.req(obj).then(res=>{
let data = res.results;
let arrAll = [];
for(let i=0;i<this.formList.length;i++){
let arr = [];
data.forEach(item=>{
if(item.mtask==this.formList[i].mtask){
item.isedit = false;
// let arritem = Object.assign(this.formList[i],item);
arr.push(item);
arrAll.push(item);
}
})
if(arr.length==0){
arrAll.push(this.formList[i])
}
}
this.relatedList = arrAll;
console.log(arrAll)
})
},
//
@ -168,10 +285,15 @@
resetQuery() {
this.query = {};
},
submitForm(){
this.$API.pm.mtask.submitSameDay.req(this.orderObj.id).then(re=>{
// console.log(res)
})
submit(){
let that = this;
that.$confirm(`确定删除吗?`, "提示", {type: "warning"}).then(() => {
that.$API.pm.mtask.submitSameDay.req(that.orderObj.id).then(re=>{
that.$message.success("提交成功");
}).catch((err) => {
return err;
});
}).catch(() => {});
},
},
};