Commit d9c0b093 authored by 仇晓婷's avatar 仇晓婷

排产资源

parent c99d2402
...@@ -1275,5 +1275,11 @@ export default { ...@@ -1275,5 +1275,11 @@ export default {
property: '属性', property: '属性',
departId: '部门id', departId: '部门id',
departTitle: '部门', departTitle: '部门',
calId: '工作日历编号',
holidayCalId: '加班日历编号',
calName: '工作日历名称',
holidayCalName: '加班日历名称',
isimportant:'关重',
capabilityValue:'能力值',
} }
} }
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('code')" prop="code"> <Input v-model="entity.code"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('type')" prop="type"> <Input v-model="entity.type"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('property')" prop="property"> <InputNumber v-model="entity.property"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('departId')" prop="departId"> <InputNumber v-model="entity.departId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('departTitle')" prop="departTitle"> <Input v-model="entity.departTitle"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "plan_resource" + "." + key;
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
\ No newline at end of file
// import Api from '@/api/axios' // import Api from '@/api/axios'
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index:`${resourceUrl}planresource/paged`, index: `${systemUrl}/planresource/paged`,
paged(params){ paged(params) {
return Api.post(`${resourceUrl}planresource/paged`,params); return Api.post(`${systemUrl}/planresource/paged`, params);
}, },
get(params){ get(params) {
return Api.get(`${resourceUrl}planresource/get`,params); return Api.get(`${systemUrl}/planresource/get`, params);
}, },
create(params){ create(params) {
return Api.post(`${resourceUrl}planresource/create`,params); return Api.post(`${systemUrl}/mesdailyworksched/list`, params);
}, },
update(params){ create1(params) {
return Api.post(`${resourceUrl}planresource/update`,params); return Api.post(`${systemUrl}/mesholidaycal/list`, params);
},
update(params) {
return Api.post(`${systemUrl}/equipcalendarwork/createorupdate`, params);
}, },
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${resourceUrl}planresource/delete`,{params:params}); return Api.delete(`${systemUrl}/planresource/delete`, { params: params });
}, },
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid :columns="columns" ref="grid" :action="action" :high="false">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -11,15 +11,10 @@ ...@@ -11,15 +11,10 @@
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid> </DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" /> <Modal v-model="editModal" title="编辑" footer-hide>
<Set :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
...@@ -29,12 +24,13 @@ ...@@ -29,12 +24,13 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Add from "./add";
import Set from "./set";
export default { export default {
name: "list", name: "list",
components: { components: {
Add Set
}, },
data() { data() {
return { return {
...@@ -43,52 +39,19 @@ export default { ...@@ -43,52 +39,19 @@ export default {
keys: { op: "title,code,type,departTitle", value: null } keys: { op: "title,code,type,departTitle", value: null }
}, },
editModal: false,
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "creationTime", // {
title: this.l("creationTime"), // key: "deleterUserId",
hide: true, // title: this.l("deleterUserId"),
align: "left" // hide: true,
}, // align: "left"
{ // },
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left"
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left"
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left"
},
{
key: "isDeleted",
title: this.l("isDeleted"),
hide: true,
align: "left"
},
{
key: "deletionTime",
title: this.l("deletionTime"),
hide: true,
align: "left"
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
hide: true,
align: "left"
},
{ {
key: "title", key: "title",
title: this.l("title"), title: this.l("title"),
...@@ -106,25 +69,54 @@ export default { ...@@ -106,25 +69,54 @@ export default {
{ {
key: "type", key: "type",
title: this.l("type"), title: this.l("type"),
align: "left", align: "center",
code: "aps.resource.type",
easy: true, easy: true,
high: true high: true
}, },
// {
// key: "property",
// title: this.l("property"),
// align: "left",
// high: true
// },
// {
// key: "departId",
// title: this.l("departId"),
// align: "left",
// high: true
// },
{ {
key: "property", key: "departTitle",
title: this.l("property"), title: this.l("departTitle"),
align: "left", align: "left",
easy: true,
high: true high: true
}, },
{ {
key: "departId", key: "calId",
title: this.l("departId"), title: this.l("calId"),
align: "center",
easy: true,
high: true
},
{
key: "holidayCalId",
title: this.l("holidayCalId"),
align: "center",
easy: true,
high: true
},
{
key: "calName",
title: this.l("calName"),
align: "left", align: "left",
easy: true,
high: true high: true
}, },
{ {
key: "departTitle", key: "holidayCalName",
title: this.l("departTitle"), title: this.l("holidayCalName"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true
...@@ -136,21 +128,13 @@ export default { ...@@ -136,21 +128,13 @@ export default {
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) }
},
"查看"
),
h( h(
"op", "op",
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row.id) }
}, },
"编辑" "设置日历"
), ),
h( h(
"op", "op",
...@@ -175,10 +159,17 @@ export default { ...@@ -175,10 +159,17 @@ export default {
methods: { methods: {
addOk() { addOk() {
this.$refs.grid.load(); this.$refs.grid.load();
this.addModal = false; this.editModal = false;
this.curId = 0; this.curId = 0;
}, },
search() {
this.$refs.grid.reload(this.easySearch);
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) { remove(id) {
this.deletelModal = true; this.deletelModal = true;
...@@ -199,28 +190,11 @@ export default { ...@@ -199,28 +190,11 @@ export default {
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.addModal = false; this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false; this.deletedlModal = false;
}, },
l(key) { l(key) {
/*
plan_resource:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'资源名称',
code:'资源编号',
type:'资源类型',
property:'属性',
departId:'部门id',
departTitle:'部门',
}
*/
let vkey = "plan_resource" + "." + key; let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} }
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col span="12">
<FormItem label="资源名称" prop="equip_name">
<Input v-model="formItem.equip_name" placeholder="请输入设备名称" readonly></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="资源编号" prop="equip_id">
<Input v-model="formItem.equip_id" placeholder="请输入设备编号" readonly></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="工作日历" prop="work">
<Select v-model="formItem1.calendarwork_pk" clearable placeholder="请选择...">
<Option v-for="item in workList" :value="item.id" :key="item.calName">{{ item.calName }}</Option>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="加班日历" prop="overtime">
<Select v-model="formItem2.calendarovertime_pk" clearable placeholder="请选择...">
<Option
v-for="item in overtimeList"
:value="item.id"
:key="item.holidayCalName"
>{{ item.holidayCalName }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
workList: [],
overtimeList: [],
formItem: {
equip_name: "",
equip_id: ""
},
formItem1: {
id: 0,
equip_pk: 0,
calendarwork_pk: 0
},
formItem2: {
id: 0,
equip_pk: 0,
calendarovertime_pk: 0
},
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
props: {
eid: Number
},
created() {
this.laodaction();
},
methods: {
laodaction() {
let parmse = {
pageIndex: 1,
conditions: [],
pageSize: 10
};
Api.create(parmse).then(r => {
if (r.success) {
this.workList = r.result;
} else {
this.$Message.error("获取数据失败...");
}
});
Api.create1(parmse).then(r => {
if (r.success) {
this.overtimeList = r.result;
} else {
this.$Message.error("获取数据失败...");
}
});
},
load(v) {
Api.get({ id: v }).then(r => {
this.formItem.equip_name = r.result.title;
this.formItem.equip_id = r.result.code;
this.formItem1.equip_pk = r.result.id;
this.formItem2.equip_pk = r.result.id;
});
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
Api.update({
equipCalendarWork: this.formItem1,
equipCalendarOverTime: this.formItem2
})
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "plan_resource" + "." + key;
return this.$t(key);
}
},
watch: {
eid(v) {
if (v != 0) {
this.formItem1.calendarwork_pk = "";
this.formItem2.calendarovertime_pk = "";
this.load(v);
}
}
}
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment