生产执行页面
This commit is contained in:
parent
6bae3795da
commit
355dfc5250
|
|
@ -2,15 +2,16 @@
|
||||||
NODE_ENV = development
|
NODE_ENV = development
|
||||||
|
|
||||||
# 标题
|
# 标题
|
||||||
VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
# VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
||||||
# VUE_APP_TITLE = '托克逊能源管理平台'
|
# VUE_APP_TITLE = '托克逊能源管理平台'
|
||||||
|
VUE_APP_TITLE = '中建材光子科技有限公司'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
#VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
|
#VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
|
||||||
#VUE_APP_WS_API = 'ws://localhost:8000'
|
#VUE_APP_WS_API = 'ws://localhost:8000'
|
||||||
VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
||||||
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
|
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
|
||||||
# VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
||||||
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
||||||
VUE_APP_BASEURL = http://49.232.14.174:2226
|
VUE_APP_BASEURL = http://49.232.14.174:2226
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,14 @@ NODE_ENV = production
|
||||||
# 标题
|
# 标题
|
||||||
VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
||||||
# VUE_APP_TITLE = '托克逊能源管理平台'
|
# VUE_APP_TITLE = '托克逊能源管理平台'
|
||||||
|
# VUE_APP_TITLE = '中建材光子科技有限公司'
|
||||||
|
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
||||||
VUE_APP_BASEURL = http://222.222.144.147:6013
|
# VUE_APP_BASEURL = http://222.222.144.147:6013
|
||||||
# VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
||||||
# VUE_APP_BASEURL = http://49.232.14.174:2226
|
VUE_APP_BASEURL = http://49.232.14.174:2226
|
||||||
|
|
||||||
# VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
|
# VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
|
||||||
# VUE_APP_BASEURL = http://1.203.161.103:2800
|
# VUE_APP_BASEURL = http://1.203.161.103:2800
|
||||||
|
|
@ -138,6 +138,66 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mlog:{
|
||||||
|
list: {
|
||||||
|
name: "值班记录列表",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/wpm/mlog/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "获取详情",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/wpm/mlog/${id}/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cquery: {
|
||||||
|
name: "复杂查询",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/wpm/mlog/cquery/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function(id, data){
|
||||||
|
return await http.put(
|
||||||
|
`${config.API_URL}/wpm/mlog/${id}/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/wpm/mlog/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.delete(
|
||||||
|
`${config.API_URL}/wpm/mlog/${id}/`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//车间库存
|
||||||
|
wmaterial: {
|
||||||
|
name: "车间库存",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/wpm/wmaterial/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
// //值班停机关系
|
// //值班停机关系
|
||||||
// stsflog: {
|
// stsflog: {
|
||||||
// list: {
|
// list: {
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,13 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
listIndex:{
|
||||||
|
// index
|
||||||
|
type: Number,
|
||||||
|
default: () => {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
},
|
||||||
multiple: {
|
multiple: {
|
||||||
// 是否多选,默认可以多选
|
// 是否多选,默认可以多选
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|
@ -252,6 +259,9 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
debugger;
|
||||||
|
console.log('this.listIndex')
|
||||||
|
console.log(this.listIndex)
|
||||||
this.getDept();
|
this.getDept();
|
||||||
this.getPost();
|
this.getPost();
|
||||||
},
|
},
|
||||||
|
|
@ -372,7 +382,17 @@ export default {
|
||||||
this.dialoguser = false;
|
this.dialoguser = false;
|
||||||
// this.change(); // 触发值变化
|
// this.change(); // 触发值变化
|
||||||
// this.dataValue = this.userData.map((e) => e.id).join(",");
|
// this.dataValue = this.userData.map((e) => e.id).join(",");
|
||||||
this.$emit("submit", this.selection);
|
let data = this.selection;
|
||||||
|
if(this.listIndex!==null){
|
||||||
|
data.listIndex = this.listIndex;
|
||||||
|
debugger;
|
||||||
|
console.log(this.listIndex);
|
||||||
|
console.log(data);
|
||||||
|
this.$emit("submit",data);
|
||||||
|
}else{
|
||||||
|
this.$emit("submit",data);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
//权限设置
|
//权限设置
|
||||||
// permission() {
|
// permission() {
|
||||||
|
|
|
||||||
|
|
@ -703,15 +703,25 @@ const routes = [
|
||||||
"component": "mtm/products"
|
"component": "mtm/products"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "process",
|
"name": "mgruops",
|
||||||
"path": "/mtm/process",
|
"path": "/mtm/mgruops",
|
||||||
"meta": {
|
"meta": {
|
||||||
"title": "工序管理",
|
"title": "工段管理",
|
||||||
"icon": "el-icon-cellphone",
|
"icon": "el-icon-grid",
|
||||||
"perms": ["mtm"]
|
"perms": ["mtm"]
|
||||||
},
|
},
|
||||||
"component": "mtm/process"
|
"component": "mtm/mgroup"
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// "name": "process",
|
||||||
|
// "path": "/mtm/process",
|
||||||
|
// "meta": {
|
||||||
|
// "title": "工序管理",
|
||||||
|
// "icon": "el-icon-cellphone",
|
||||||
|
// "perms": ["mtm"]
|
||||||
|
// },
|
||||||
|
// "component": "mtm/process"
|
||||||
|
// },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
//生产管理 pm
|
//生产管理 pm
|
||||||
|
|
@ -746,6 +756,49 @@ const routes = [
|
||||||
"component": "pm/mtask2"
|
"component": "pm/mtask2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
//生产执行 wpm
|
||||||
|
{
|
||||||
|
"name": "wpm",
|
||||||
|
"path": "/wpm",
|
||||||
|
"meta": {
|
||||||
|
"title": "生产执行",
|
||||||
|
"icon": "el-icon-grid",
|
||||||
|
"type": "menu",
|
||||||
|
"perms": ["wpm"]
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "worktask",
|
||||||
|
"path": "/wpm/worktask",
|
||||||
|
"meta": {
|
||||||
|
"title": "生产一部",
|
||||||
|
"icon": "el-icon-cellphone",
|
||||||
|
"perms": ["wpm"]
|
||||||
|
},
|
||||||
|
"component": "wpm/worktask"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "worktaskFlog",
|
||||||
|
"path": "/wpm/worktaskFlog",
|
||||||
|
"meta": {
|
||||||
|
"title": "生产一部记录",
|
||||||
|
"icon": "el-icon-cellphone",
|
||||||
|
"perms": ["wpm"]
|
||||||
|
},
|
||||||
|
"component": "wpm/worktaskFlog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "worktask2",
|
||||||
|
"path": "/wpm/worktask2",
|
||||||
|
"meta": {
|
||||||
|
"title": "生产二部",
|
||||||
|
"icon": "el-icon-cellphone",
|
||||||
|
"perms": ["wpm"]
|
||||||
|
},
|
||||||
|
"component": "wpm/worktask2"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
//库存 inm
|
//库存 inm
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-input style="margin-right: 5px;" v-model="query.search" placeholder="名称" clearable></el-input>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'mgroup.create'"></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable ref="table" :data="tableData" row-key="id" hidePagination>
|
||||||
|
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||||
|
<el-table-column label="工段名称" prop="name" min-width="100"></el-table-column>
|
||||||
|
<!-- <el-table-column label="工序" prop="cate" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ cates_[scope.row.cate] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="所属部门" prop="belong_dept_name" min-width="150"></el-table-column>
|
||||||
|
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'mgroup.update'" type="primary">编辑</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button link size="small" v-auth="'mgroup.delete'" type="danger">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</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 "./mgroup_form.vue";
|
||||||
|
export default {
|
||||||
|
name: 'dept',
|
||||||
|
components: {
|
||||||
|
saveDialog
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
apiObj: this.$API.mtm.mgroup.list,
|
||||||
|
query: {},
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
permission: false,
|
||||||
|
},
|
||||||
|
tableData:[],
|
||||||
|
selection:[],
|
||||||
|
cates_:{
|
||||||
|
'section':'工序',
|
||||||
|
'other':'其他',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData(){
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
|
||||||
|
let data = [];
|
||||||
|
res.forEach(item => {
|
||||||
|
if(!item.need_enm){
|
||||||
|
data.push(item)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.tableData = data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
table_add() {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除测点集
|
||||||
|
async table_del(row){
|
||||||
|
var id = row.id;
|
||||||
|
var res = await this.$API.mtm.mgroup.delete.req(id);
|
||||||
|
if(res.err_msg){
|
||||||
|
this.$message.error(res.err_msg)
|
||||||
|
}else{
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection){
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
handleQuery(){
|
||||||
|
this.$refs.table.queryData(this.query)
|
||||||
|
},
|
||||||
|
//本地更新数据
|
||||||
|
//新增岗位后更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,173 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="titleMap[mode]"
|
||||||
|
v-model="visible"
|
||||||
|
:size="1000"
|
||||||
|
destroy-on-close
|
||||||
|
@closed="$emit('closed')"
|
||||||
|
>
|
||||||
|
<el-container v-loading="loading">
|
||||||
|
<el-main style="padding: 0 20px 20px 20px">
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
style="padding: 0 10px;"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="form.name" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工序" prop="process">
|
||||||
|
<el-select
|
||||||
|
v-model="form.process"
|
||||||
|
placeholder="工序"
|
||||||
|
clearable
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属部门">
|
||||||
|
<el-select
|
||||||
|
v-model="form.belong_dept"
|
||||||
|
placeholder="所属部门"
|
||||||
|
clearable
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in group"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-main>
|
||||||
|
<el-footer>
|
||||||
|
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const defaultForm = {
|
||||||
|
name: "",
|
||||||
|
process:'',
|
||||||
|
cate:'photon',
|
||||||
|
belong_dept:'',
|
||||||
|
need_enm:false,
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
emits: ["success", "closed"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
mode: "add",
|
||||||
|
titleMap: {
|
||||||
|
add: '新增测点集',
|
||||||
|
edit: '编辑测点集',
|
||||||
|
show: '查看测点集'
|
||||||
|
},
|
||||||
|
//表单数据
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
//验证规则
|
||||||
|
rules: {
|
||||||
|
name: [{required: true, message: "请输入名称", trigger: "blur"}],
|
||||||
|
process: [{required: true, message: "请选择工序", trigger: "blur"}],
|
||||||
|
belong_dept: [{required: true, message: "请选择所属部门", trigger: "blur"}]
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
isSaveing: false,
|
||||||
|
options:[],
|
||||||
|
group: [],
|
||||||
|
materials:[],
|
||||||
|
setFiltersVisible: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getGroup();//获取部门
|
||||||
|
this.getProcess();//获取产品
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//部门数据
|
||||||
|
getGroup() {
|
||||||
|
this.$API.system.dept.list.req({page:0,type:'dept'}).then(res=>{
|
||||||
|
let data = [];
|
||||||
|
res.forEach(item => {
|
||||||
|
if(item.parent=='3423856735881117696'){
|
||||||
|
data.push(item)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.group = data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取工序列表
|
||||||
|
getProcess(){
|
||||||
|
var res = this.$API.mtm.process.list.req({page:0}).then(res=>{
|
||||||
|
this.options = res;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//显示
|
||||||
|
open(mode = "add") {
|
||||||
|
this.mode = mode;
|
||||||
|
this.visible = true;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
//表单注入数据
|
||||||
|
setData(data) {
|
||||||
|
Object.assign(this.form,data);
|
||||||
|
},
|
||||||
|
getReceptionist(data) {
|
||||||
|
this.form.leader=data.id;
|
||||||
|
this.form.leader_name=data.name
|
||||||
|
},
|
||||||
|
//表单提交方法
|
||||||
|
submit() {
|
||||||
|
let that = this;
|
||||||
|
that.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
that.form.cate = 'photon';
|
||||||
|
that.form.need_enm = false;
|
||||||
|
that.isSaveing = true;
|
||||||
|
if(that.mode==='add'){
|
||||||
|
that.$API.mtm.mgroup.create.req(that.form).then(res=>{
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success", that.form, that.mode);
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.$API.mtm.mgroup.update.req(that.form.id,that.form).then(res=>{
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success", that.form, that.mode);
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//设置过滤项
|
||||||
|
setFilters(filters) {
|
||||||
|
this.selectionFilters = filters;
|
||||||
|
this.setFiltersVisible = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
>查询</el-button>
|
>查询</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="任务数">
|
<el-form-item label="任务数">
|
||||||
<el-input v-model="form.count" placeholder="任务数"/>
|
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right" placeholder="任务数"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="工序" prop="process">
|
<el-form-item label="工段" prop="mgroup">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.process"
|
v-model="form.mgroup"
|
||||||
placeholder="工序"
|
placeholder="工段"
|
||||||
clearable
|
clearable
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
>
|
>
|
||||||
|
|
@ -43,10 +43,27 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="产品" prop="material">
|
<el-form-item label="领用物" prop="material_before">
|
||||||
|
<el-select
|
||||||
|
v-model="form.material_before"
|
||||||
|
placeholder="领用物"
|
||||||
|
clearable
|
||||||
|
style="width:100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in materialOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="产物" prop="material">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.material"
|
v-model="form.material"
|
||||||
placeholder="产品"
|
placeholder="产物"
|
||||||
clearable
|
clearable
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,24 @@
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"></el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
|
<el-card>
|
||||||
|
<el-form label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="订单编号:">{{ orderObj.number }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="订单状态:">{{ orderObj.state }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="所属部门">{{ orderObj.belong_dept }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="交货日期:">{{ orderObj.delivery_date }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
ref="table"
|
ref="table"
|
||||||
|
|
@ -98,6 +116,7 @@ export default {
|
||||||
page_size:20
|
page_size:20
|
||||||
},
|
},
|
||||||
puOrder:'',
|
puOrder:'',
|
||||||
|
orderObj:{},
|
||||||
selection: [],
|
selection: [],
|
||||||
state_: {
|
state_: {
|
||||||
10: '完好',
|
10: '完好',
|
||||||
|
|
@ -109,8 +128,14 @@ export default {
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.puOrder = this.$route.query.pu_order;
|
this.puOrder = this.$route.query.pu_order;
|
||||||
|
this.getOrder();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getOrder(){
|
||||||
|
this.$API.pum.order.item.req(this.puOrder).then((res) => {
|
||||||
|
this.orderObj = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
//添加
|
//添加
|
||||||
add() {
|
add() {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
|
|
@ -130,6 +155,7 @@ export default {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
//编辑
|
//编辑
|
||||||
table_edit(row) {
|
table_edit(row) {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,21 @@
|
||||||
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button>
|
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
|
<el-card>
|
||||||
|
<el-form label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计划名称:">{{ orderObj.name }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计划编号:">{{ orderObj.number }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计划状态:">{{ orderObj.state }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
ref="table"
|
ref="table"
|
||||||
|
|
@ -87,6 +102,7 @@
|
||||||
save: false,
|
save: false,
|
||||||
},
|
},
|
||||||
puPlan:'',
|
puPlan:'',
|
||||||
|
orderObj:{},
|
||||||
apiObj: this.$API.pum.planitem.list,
|
apiObj: this.$API.pum.planitem.list,
|
||||||
query: {
|
query: {
|
||||||
page:1,
|
page:1,
|
||||||
|
|
@ -96,8 +112,16 @@
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.puPlan = this.$route.query.pu_plan;
|
this.puPlan = this.$route.query.pu_plan;
|
||||||
|
this.getOrder();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getOrder(){
|
||||||
|
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
|
||||||
|
debugger;
|
||||||
|
console.log(res);
|
||||||
|
this.orderObj = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
//添加
|
//添加
|
||||||
add() {
|
add() {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,26 @@
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-card>订单信息:
|
<el-card>
|
||||||
<div>订单编号:</div>
|
<el-form label-width="120px">
|
||||||
<div>订单状态:</div>
|
<el-row>
|
||||||
<div>客户:</div>
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="订单编号:">{{ orderObj.number }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="客户:">{{ orderObj.customer }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="订单状态:">{{ orderObj.state }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计划开工日期:">{{ orderObj.customer }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="计划完工日期:">{{ orderObj.customer }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
|
|
@ -48,7 +64,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
|
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="left">
|
<el-table-column label="操作" fixed="right" align="center" width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link
|
<el-link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -96,6 +112,7 @@ export default {
|
||||||
page_size:20
|
page_size:20
|
||||||
},
|
},
|
||||||
orderId:'',
|
orderId:'',
|
||||||
|
orderObj:{},
|
||||||
selection: [],
|
selection: [],
|
||||||
state_: {
|
state_: {
|
||||||
10: '完好',
|
10: '完好',
|
||||||
|
|
@ -107,9 +124,14 @@ export default {
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.orderId = this.$route.query.order;
|
this.orderId = this.$route.query.order;
|
||||||
console.log(this.orderId)
|
this.getOrder();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getOrder(){
|
||||||
|
this.$API.sam.order.item.req(this.orderId).then((res) => {
|
||||||
|
this.orderObj = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
//添加
|
//添加
|
||||||
add() {
|
add() {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ export default {
|
||||||
account: defineAsyncComponent(() => import("./user/account")),
|
account: defineAsyncComponent(() => import("./user/account")),
|
||||||
seting: defineAsyncComponent(() => import("./user/seting")),
|
seting: defineAsyncComponent(() => import("./user/seting")),
|
||||||
pushSettings: defineAsyncComponent(() => import("./user/pushSettings")),
|
pushSettings: defineAsyncComponent(() => import("./user/pushSettings")),
|
||||||
clockRecord: defineAsyncComponent(() => import("./user/clock_record")),
|
// clockRecord: defineAsyncComponent(() => import("./user/clock_record")),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -84,11 +84,11 @@ export default {
|
||||||
title: "修改密码",
|
title: "修改密码",
|
||||||
component: "pushSettings",
|
component: "pushSettings",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
icon: "el-icon-lock",
|
// icon: "el-icon-lock",
|
||||||
title: "打卡记录",
|
// title: "打卡记录",
|
||||||
component: "clockRecord",
|
// component: "clockRecord",
|
||||||
},
|
// },
|
||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,215 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="titleMap[mode]"
|
||||||
|
v-model="visible"
|
||||||
|
width="1000px"
|
||||||
|
:size="1000"
|
||||||
|
destroy-on-close
|
||||||
|
@closed="$emit('closed')"
|
||||||
|
>
|
||||||
|
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="产品编号" prop="material">
|
||||||
|
<el-select
|
||||||
|
v-model="material"
|
||||||
|
placeholder="产品编号"
|
||||||
|
clearable
|
||||||
|
style="width:100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in materialOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<sc-form-table ref="table" v-model="formList" :addTemplate="addTemplate" drag-sort placeholder="暂无数据">
|
||||||
|
<el-table-column prop="type" label="工序" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select v-model="scope.row.process" placeholder="请选择">
|
||||||
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="加工数量" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.count_use" placeholder="请输入内容"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="合格数量" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.count_ok" placeholder="请输入内容"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="不合格数量" align="center">
|
||||||
|
<el-table-column prop="val" label="原因1" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.count_no1" placeholder="不合格数量1"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="原因2" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.count_no2" placeholder="不合格数量2"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="val" label="原因3" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.count_no3" placeholder="不合格数量3"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="type" label="操作人" min-width="120" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<span style="display:flex">
|
||||||
|
<el-input readonly v-model="scope.row.handle_user"></el-input>
|
||||||
|
<ehsUserSelect :listIndex="index" :multiple="false" @submit="getReceptionist"/>
|
||||||
|
</span>
|
||||||
|
<!-- <el-select v-model="scope.row.handle_user" placeholder="请选择">
|
||||||
|
<el-option v-for="item in typeDic" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||||
|
</el-select> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="type" label="操作" min-width="90" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link type="primary" @click="submitRecord(scope.row)" >确定 </el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</sc-form-table>
|
||||||
|
</el-form>
|
||||||
|
<el-footer>
|
||||||
|
<el-button type="primary" @click="submitForm">保存</el-button>
|
||||||
|
<el-button @click="resetForm">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { index } from 'd3';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
emits: ["success", "closed"],
|
||||||
|
props:{
|
||||||
|
puPlan: { type: String, default: '' },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
mode: "add",
|
||||||
|
titleMap: {
|
||||||
|
add: "新增记录",
|
||||||
|
edit: "编辑记录",
|
||||||
|
show: "查看记录",
|
||||||
|
},
|
||||||
|
form:{},
|
||||||
|
addTemplate: {
|
||||||
|
process: '',
|
||||||
|
count_use:1,
|
||||||
|
count_ok: 1,
|
||||||
|
count_no1: 1,
|
||||||
|
count_no2: 1,
|
||||||
|
count_no3: 1,
|
||||||
|
handle_user:'',
|
||||||
|
user_name:'',
|
||||||
|
},
|
||||||
|
formList: [
|
||||||
|
{
|
||||||
|
process: '',
|
||||||
|
count_use:1,
|
||||||
|
count_ok: 1,
|
||||||
|
count_no1: 1,
|
||||||
|
count_no2: 1,
|
||||||
|
count_no3: 1,
|
||||||
|
handle_user:'',
|
||||||
|
user_name:'',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
material:'',
|
||||||
|
visible: false,
|
||||||
|
isSaveing: false,
|
||||||
|
setFiltersVisible: false,
|
||||||
|
options: [],
|
||||||
|
materialOptions:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getProcess();
|
||||||
|
// this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取工序列表
|
||||||
|
getProcess(){
|
||||||
|
var res = this.$API.mtm.process.list.req({page:0}).then(res=>{
|
||||||
|
this.options = res;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
pushRow(){
|
||||||
|
let obj = {
|
||||||
|
process: '',
|
||||||
|
count_use:1,
|
||||||
|
count_ok: 1,
|
||||||
|
count_no1: 1,
|
||||||
|
count_no2: 1,
|
||||||
|
count_no3: 1,
|
||||||
|
handle_user:'',
|
||||||
|
user_name:'',
|
||||||
|
}
|
||||||
|
this.formList.push(obj);
|
||||||
|
},
|
||||||
|
deleteRow(){
|
||||||
|
this.$refs.table.deleteRow(0)
|
||||||
|
},
|
||||||
|
//显示
|
||||||
|
open(mode = "add") {
|
||||||
|
this.mode = mode;
|
||||||
|
this.visible = true;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
getList(){
|
||||||
|
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||||
|
this.options = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getReceptionist(data) {
|
||||||
|
// 子组件调用父组件的方法并传参
|
||||||
|
console.log(data);
|
||||||
|
console.log(data.listIndex);
|
||||||
|
debugger;
|
||||||
|
},
|
||||||
|
//提交
|
||||||
|
submit() {
|
||||||
|
this.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.isSaveing = true;
|
||||||
|
try {
|
||||||
|
var res;
|
||||||
|
this.form.pu_plan = this.puPlan;
|
||||||
|
if (this.mode == "add") {
|
||||||
|
res = await this.$API.pum.planitem.create.req(this.form);
|
||||||
|
} else if (this.mode == "edit") {
|
||||||
|
res = await this.$API.pum.planitem.update.req(this.form.id,this.form);
|
||||||
|
}
|
||||||
|
this.isSaveing = false;
|
||||||
|
this.$emit("success", this.form, this.mode);
|
||||||
|
this.visible = false;
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
} catch (err) {
|
||||||
|
//可以处理校验错误
|
||||||
|
this.isSaveing = false;
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表单注入数据
|
||||||
|
setData(data) {
|
||||||
|
Object.assign(this.form, data);
|
||||||
|
},
|
||||||
|
//设置过滤项
|
||||||
|
setFilters(filters) {
|
||||||
|
this.selectionFilters = filters;
|
||||||
|
this.setFiltersVisible = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,317 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="border-bottom: 1px solid #eeeeee;margin-bottom: 10px;">
|
||||||
|
<el-tab-pane label="混料工序" name="first">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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="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="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-if="scope.row.status==10"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>生产记录
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-else
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="成型7车间" name="second">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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="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="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-if="scope.row.status==10"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>生产记录
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-else
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="成型10车间" name="third">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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="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="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-if="scope.row.status==10"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>生产记录
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-else
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="13" style="border-right: 1px solid #eeeeee;">工序进度
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
height="500px"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<el-table-column label="日期" prop="number">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="工序" prop="material">
|
||||||
|
</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">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合格数量" prop="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作人" prop="count">
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">车间物料
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
height="500px"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<el-table-column label="产品编号" prop="material">
|
||||||
|
</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">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-if="scope.row.status==10"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>编辑
|
||||||
|
</el-link>
|
||||||
|
<!-- 提交后变查看 -->
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "worktask",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
},
|
||||||
|
apiObj: this.$API.pm.mtask.list,
|
||||||
|
query: {
|
||||||
|
page:1,
|
||||||
|
page_size:20,
|
||||||
|
date:''
|
||||||
|
},
|
||||||
|
activeName:'first',
|
||||||
|
tableData: [],
|
||||||
|
selection: [],
|
||||||
|
state_: {
|
||||||
|
10: '完好',
|
||||||
|
20: '限用',
|
||||||
|
30: '在修',
|
||||||
|
40: '禁用',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick(val){
|
||||||
|
debugger;
|
||||||
|
console.log(val.index);
|
||||||
|
this.tableData = [];
|
||||||
|
if(val==0){
|
||||||
|
this.$API.wpm.mtask.list.req().then((res) => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}else if(val==1){
|
||||||
|
|
||||||
|
}else if(val==2){
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
add() {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_show(row) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
async table_del(row) {
|
||||||
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.$API.pm.mtask.delete.req(row.id).then((res) => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
//本地更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
if (mode == "add") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
} else if (mode == "edit") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query)
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.el-main.nopadding{
|
||||||
|
padding:0 20px 20px 20px
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,375 @@
|
||||||
|
<template>
|
||||||
|
<el-container style="flex-direction: column">
|
||||||
|
<el-main class="nopadding" style="position: relative;height: 50%;margin-bottom: 20px;">
|
||||||
|
<div class="right-panel" style=" display: inline-block;position: absolute;right: 20px;margin-top: 4px;">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="add">任务下达</el-button>
|
||||||
|
<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
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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="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="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-link>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="table_del(scope.row)"
|
||||||
|
v-auth="'equipment.delete'"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-main>
|
||||||
|
<el-main class="nopadding" style="position: relative;height: 50%;">
|
||||||
|
<div class="right-panel" v-if="activeNameSub=='order'" style="display: inline-block;position: absolute;right: 20px;margin-top: 4px;">
|
||||||
|
<el-button type="primary" icon="el-icon-plus">排产</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-plus">合并任务</el-button>
|
||||||
|
</div>
|
||||||
|
<el-tabs v-model="activeNameSub" class="demo-tabs" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="订单排产" name="order">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
:params="query"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50"/>
|
||||||
|
<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="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="count">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="交货时间" prop="end_date">
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="生产进度" name="rate">
|
||||||
|
<div class="ganntClass" :style="{ height: ganttHeight }" v-loading="ganttLoading">
|
||||||
|
<div ref="gantt" class="gantt-container"></div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import gantt from 'dhtmlx-gantt';
|
||||||
|
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css';
|
||||||
|
export default {
|
||||||
|
name: "rparty",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ganttHeight: '500px',
|
||||||
|
ganttLoading: false,
|
||||||
|
projectId: '',
|
||||||
|
tasks: {
|
||||||
|
data: []
|
||||||
|
},
|
||||||
|
gantttt:{
|
||||||
|
data:[],
|
||||||
|
links:[
|
||||||
|
{ id:1, source:1, target:3, type:"0"},
|
||||||
|
{ id:2, source:12323545, target:12345453, type:"1"},
|
||||||
|
{ id:3, source:12345453, target:12345437, type:"0"}
|
||||||
|
],
|
||||||
|
columns:[
|
||||||
|
{ align: 'right', name: 'color', label: '', width: '15',
|
||||||
|
template:function(task){
|
||||||
|
if(task.color){return "<div class='tttttt' style='background:"+ task.color+ "'>"+"</div>"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ align: 'left', name: 'text', label: '', tree: true, width:"*",min_width:120},
|
||||||
|
{ align: 'center', name: 'person', label: '负责人', width: '100' },
|
||||||
|
{ align: 'right', name: 'time', label: '时间节点', width: '80' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
},
|
||||||
|
apiObj: this.$API.pm.mtask.list,
|
||||||
|
query: {
|
||||||
|
page:1,
|
||||||
|
page_size:20,
|
||||||
|
date:''
|
||||||
|
},
|
||||||
|
activeName:'first',
|
||||||
|
activeNameSub:'order',
|
||||||
|
selection: [],
|
||||||
|
state_: {
|
||||||
|
10: '完好',
|
||||||
|
20: '限用',
|
||||||
|
30: '在修',
|
||||||
|
40: '禁用',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
//清空gantt数据
|
||||||
|
gantt.clearAll();
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
var $this = this;
|
||||||
|
//本地化
|
||||||
|
gantt.i18n.setLocale('cn');
|
||||||
|
//自适应甘特图的尺寸大小, 使得在不出现滚动条的情况下, 显示全部任务
|
||||||
|
gantt.config.autosize = false;
|
||||||
|
//只读模式:打开后不可以操作甘特图
|
||||||
|
gantt.config.readonly = false;
|
||||||
|
//是否显示左侧树表格
|
||||||
|
gantt.config.show_grid = true;
|
||||||
|
//表格列设置:我们在后台获取数据后,会解析到这个表格列中,这里面会含有很多隐藏列,作用是甘特图中不需要看隐藏列,但当我们获取甘特图的任务时,这些隐藏列会跟随任务方便使用
|
||||||
|
gantt.config.columns = [
|
||||||
|
{
|
||||||
|
name: 'text',label: '分项工程',
|
||||||
|
tree: true,width: '*',align: 'left',template: function (obj) { return `<span class="gantt-name-box" title="${obj.text}">${obj.text}</span>` }
|
||||||
|
},
|
||||||
|
{name: 'beginTime',label: '开始日期', width: '100',align: 'center', template: function (obj) {return obj.beginTime;}},
|
||||||
|
{name: 'endTime',label: '结束日期',width: '100',align: 'center',template: function (obj) {return obj.endTime;}},
|
||||||
|
{name: 'limitTime',label: '工期',width: '100', align: 'center',template: function (obj) {return `${obj.limitTime}天`;}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
gantt.config.data=[
|
||||||
|
{ "id": "1635835705701744641", "text": "345分项工程分项工程分项工程", "start_date": "2022-12-01", "beginTime": "2022-12-01", "endTime": "2023-03-14", "limitTime": 103, "duration": 103, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744642", "text": "111", "start_date": "2023-03-14", "beginTime": "2023-03-14", "endTime": "2023-03-17", "limitTime": 3, "duration": 3, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744643", "text": "分项工程", "start_date": "2023-03-13", "beginTime": "2023-03-13", "endTime": "2023-03-23", "limitTime": 10, "duration": 10, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744644", "text": "分项工程1", "start_date": "2023-03-30", "beginTime": "2023-03-30", "endTime": "2023-04-20", "limitTime": 21, "duration": 21, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744645", "text": "分项工程2", "start_date": "2023-03-21", "beginTime": "2023-03-21", "endTime": "2023-03-29", "limitTime": 8, "duration": 8, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744646", "text": "分项工程3", "start_date": "2023-03-23", "beginTime": "2023-03-23", "endTime": "2023-03-31", "limitTime": 8, "duration": 8, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744647", "text": "6", "start_date": "2023-03-29", "beginTime": "2023-03-29", "endTime": "2023-03-30", "limitTime": 1, "duration": 1, "progress": 1 },
|
||||||
|
{ "id": "1635835705701744648", "text": "1", "start_date": "2023-03-16", "beginTime": "2023-03-16", "endTime": "2023-03-17", "limitTime": 1, "duration": 1, "progress": 1 },
|
||||||
|
];
|
||||||
|
//自适应
|
||||||
|
//gantt.config.fit_tasks = true;
|
||||||
|
gantt.config.row_height = 44;
|
||||||
|
//表头高度
|
||||||
|
gantt.config.scale_height = 50;
|
||||||
|
|
||||||
|
//开启提示:鼠标悬浮在gantt行上显示
|
||||||
|
gantt.plugins({
|
||||||
|
tooltip: true
|
||||||
|
});
|
||||||
|
|
||||||
|
//时间轴格式化模版
|
||||||
|
var yearScaleTemplate = function (date) {
|
||||||
|
return date.getFullYear();
|
||||||
|
};
|
||||||
|
var monthScaleTemplate = function (date) {
|
||||||
|
var month = date.getMonth()+1;
|
||||||
|
return month;
|
||||||
|
};
|
||||||
|
var dayScaleTemplate = function (date) {
|
||||||
|
var month = date.getDate();
|
||||||
|
return month;
|
||||||
|
};
|
||||||
|
//时间轴样式
|
||||||
|
var yearScaleCss = function () {
|
||||||
|
return 'yearScaleStyle';
|
||||||
|
};
|
||||||
|
var monthScaleCss = function () {
|
||||||
|
return 'monthScaleStyle';
|
||||||
|
};
|
||||||
|
var monthScaleCss = function () {
|
||||||
|
return 'monthScaleStyle';
|
||||||
|
};
|
||||||
|
gantt.config.start_date = new Date(2023, 9, 1);
|
||||||
|
gantt.config.end_date = new Date(2023, 9, 20);
|
||||||
|
gantt.config.scales = [
|
||||||
|
{ unit: 'year', step: 1, format: yearScaleTemplate, css: yearScaleCss },
|
||||||
|
{ unit: 'month', step: 1, format: monthScaleTemplate, css: monthScaleCss },
|
||||||
|
{ unit: 'day', step: 1, format: dayScaleTemplate, css: monthScaleCss }
|
||||||
|
];
|
||||||
|
|
||||||
|
gantt.attachEvent('onGanttReady', function () {
|
||||||
|
var tooltips = gantt.ext.tooltips;
|
||||||
|
gantt.templates.tooltip_text = function (start, end, task) {
|
||||||
|
return '任务编号:' + task.no + '<br/>Task:' + task.text + '<br/>Role:' + task.roleName + '<br/>Owner:' + task.ownerName + '<br/>计划开始时间:' + gantt.templates.tooltip_date_format(start) + '<br/>RCD:' + gantt.templates.tooltip_date_format(end);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
//禁用双击事件
|
||||||
|
gantt.config.details_on_dblclick = false;
|
||||||
|
//关闭所有错误提示信息:gantt有自己的异常消息,如果不关闭可能页面会弹出异常消息
|
||||||
|
gantt.config.show_errors = false;
|
||||||
|
//禁止拖动设置任务长度
|
||||||
|
gantt.attachEvent('onBeforeTaskDrag', function (id, mode, e) {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
//禁止拖动任务
|
||||||
|
gantt.config.drag_move = false;
|
||||||
|
//禁止拖动任务进度
|
||||||
|
gantt.config.drag_progress = false;
|
||||||
|
//禁止拖放添加Link
|
||||||
|
gantt.config.drag_links = false;
|
||||||
|
|
||||||
|
//开启标记
|
||||||
|
gantt.plugins({
|
||||||
|
marker: true
|
||||||
|
});
|
||||||
|
|
||||||
|
//标记当前日期
|
||||||
|
var dateToStr = gantt.date.date_to_str(gantt.config.task_date);
|
||||||
|
var markerId = gantt.addMarker({
|
||||||
|
start_date: new Date(),
|
||||||
|
css: 'today', //标记样式,style中对应
|
||||||
|
text: 'Today',
|
||||||
|
title: dateToStr(new Date())
|
||||||
|
});
|
||||||
|
gantt.getMarker(markerId);
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
gantt.init(this.$refs.gantt);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取甘特图数据
|
||||||
|
getProjectTaskData() {
|
||||||
|
this.ganttLoading= true;
|
||||||
|
this.tasks.data = [];
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('url'),
|
||||||
|
method: 'get',
|
||||||
|
params: this.$http.adornParams({
|
||||||
|
projectId: this.projectId
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data != null && data.code == 200) {
|
||||||
|
this.tasks.data = data.res;
|
||||||
|
// 数据解析:将数据解析到gantt列数据中
|
||||||
|
gantt.parse(this.tasks);
|
||||||
|
// 刷新数据
|
||||||
|
gantt.refreshData();
|
||||||
|
this.ganttLoading= false;
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//自定义新增任务
|
||||||
|
addTask(taskId) {
|
||||||
|
var $this = this;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
$this.$refs.taskAdd.init(task, action, parentTask, $this.milestoneOriginalData);
|
||||||
|
});
|
||||||
|
//删除任务:每次调用gantt内置新增事件时,gantt会直接新增任务到甘特图中,而我们需要的是自定义新增任务
|
||||||
|
gantt.deleteTask(taskId);
|
||||||
|
//灯箱事件必须返回布尔值,这里使用了自定义灯箱返回false,即不打开灯箱
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
add() {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_show(row) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
async table_del(row) {
|
||||||
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.$API.pm.mtask.delete.req(row.id).then((res) => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
//本地更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
if (mode == "add") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
} else if (mode == "edit") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query)
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.el-main.nopadding{
|
||||||
|
padding:0 20px 20px 20px
|
||||||
|
}
|
||||||
|
.gantt-container {
|
||||||
|
height: 30%;
|
||||||
|
}
|
||||||
|
.ganntClass {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-card style="height:fit-content;padding-bottom:10px;">
|
||||||
|
<el-form label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
|
||||||
|
<el-form-item class="infoForm" label="产品名称:">{{ orderObj.name }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
|
||||||
|
<el-form-item class="infoForm" label="型号:">{{ orderObj.name }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
|
||||||
|
<el-form-item class="infoForm" label="规格:">{{ orderObj.number }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
|
||||||
|
<el-form-item class="infoForm" label="计划数量:">{{ orderObj.state }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
|
||||||
|
<el-form-item class="infoForm" label="计划日期:">{{ orderObj.state }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="add">新增记录</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel"></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="material">
|
||||||
|
</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">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="left" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-if="scope.row.status==10"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>编辑
|
||||||
|
</el-link>
|
||||||
|
<!-- 提交后变查看 -->
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-auth="'equipment.update'"
|
||||||
|
>查看
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
:puPlan="puPlan"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import saveDialog from "./flog_form.vue";
|
||||||
|
export default {
|
||||||
|
name: "rparty",
|
||||||
|
components: {
|
||||||
|
saveDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
},
|
||||||
|
task:'',
|
||||||
|
orderObj:{},
|
||||||
|
// apiObj: this.$API.pum.planitem.list,
|
||||||
|
apiObj: null,
|
||||||
|
query: {
|
||||||
|
page:1,
|
||||||
|
page_size:20
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.puPlan = this.$route.query.pu_plan;
|
||||||
|
// this.getTask();//获取任务详情
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取任务详情
|
||||||
|
getTask(){
|
||||||
|
this.$API.wpm.task.item.req(this.task).then((res) => {
|
||||||
|
debugger;
|
||||||
|
console.log(res);
|
||||||
|
this.orderObj = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
add() {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_show(row) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//删除
|
||||||
|
table_del(row) {
|
||||||
|
this.$confirm(`确定删除该计划详情吗?`, "提示", {
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.$API.pum.planitem.delete.req(row.id).then((res) => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
//本地更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
if (mode == "add") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
} else if (mode == "edit") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query)
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.infoForm.el-form-item{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue