Commit 9c532ada authored by renjintao's avatar renjintao

resourceMangement/productionResources

parent 7176f54e
<template>
<div class="resources-p h100">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:high="false"
@on-selection-change="onSelect"
>
<div class="resources-p h100">
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" @on-selection-change="onSelect">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -43,15 +37,16 @@
</template>
</DataGrid>
<Modal v-model="editModal" title="设置日历" footer-hide>
<Modal v-model="editModal" title="设置日历" footer-hide width="1000">
<Set :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
......@@ -66,7 +61,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: "title,code,type,departTitle", value: null },
keys: {
op: "title,code,type,departTitle",
value: null
},
},
entity: {
isimportant: "1",
......@@ -77,11 +75,23 @@ export default {
deletelModal: false,
curId: 0,
rules: {
isimportant: [{ required: true, message: "必填", trigger: "blur" }],
capabilityValue: [{ required: true, message: "必填", trigger: "blur" }],
isimportant: [{
required: true,
message: "必填",
trigger: "blur"
}],
capabilityValue: [{
required: true,
message: "必填",
trigger: "blur"
}],
},
columns: [{
key: "id",
title: this.l("id"),
hide: true,
align: "left"
},
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
type: "selection",
width: 70,
......@@ -185,20 +195,29 @@ export default {
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row.id)
},
},
"设置"
),
h(
"op",
{
attrs: { oprate: "remove", title: "删除" },
on: { click: () => this.remove(params.row.id) },
"op", {
attrs: {
oprate: "remove",
title: "删除"
},
on: {
click: () => this.remove(params.row.id)
},
},
"删除"
),
......@@ -211,7 +230,10 @@ export default {
mounted() {
console.log(this);
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -234,7 +256,9 @@ export default {
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
......@@ -300,20 +324,25 @@ export default {
},
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.resources-p {
.form-row {
width: 600px;
margin-left: 50px;
.ivu-form-item-label {
color: @form-color;
}
}
.ivu-footer-toolbar-right {
width: 1100px;
position: relative !important;
}
.btn {
position: absolute !important;
top: 12px !important;
......
<template>
<Form ref="form" :model="formItem" :rules="rules" :label-width="90">
<Form ref="form" :model="formItem" :rules="rules" :label-width="110">
<Row>
<Col span="12">
<FormItem label="资源名称" prop="equip_name">
......@@ -13,19 +13,15 @@
</Col>
<Col :span="12">
<FormItem label="工作日历" prop="work">
<Select v-model="formItem1.calendarwork_pk" clearable placeholder="请选择...">
<Select v-model="formItem1.calendarwork_pk" filterable 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 v-model="formItem2.calendarovertime_pk" filterable clearable placeholder="请选择...">
<Option v-for="item in overtimeList" :value="item.id" :key="item.holidayCalName">{{ item.holidayCalName }}</Option>
</Select>
</FormItem>
</Col>
......@@ -48,8 +44,9 @@
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</Form>
</template>
<script>
import Api from "./api";
export default {
......@@ -76,7 +73,11 @@ export default {
},
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
name: [{
required: true,
message: "必填",
trigger: "blur"
}],
},
};
},
......@@ -109,7 +110,9 @@ export default {
});
},
load(v) {
Api.get({ id: v }).then((r) => {
Api.get({
id: v
}).then((r) => {
this.formItem.equip_name = r.result.title;
this.formItem.equip_id = r.result.code;
this.formItem.capabilityValue = r.result.capabilityValue;
......
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