Commit 4d9d0acc authored by 仇晓婷's avatar 仇晓婷

排产资源

parent 0621929b
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<slot name="batch"></slot> <slot name="batch"></slot>
</div> </div>
<Button @click="cancelFooterToolbar">取消</Button> <Button @click="cancelFooterToolbar" class="btn">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
...@@ -477,10 +477,9 @@ export default { ...@@ -477,10 +477,9 @@ export default {
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status); this.$refs.table.selectAll(status);
}, },
cancelFooterToolbar() cancelFooterToolbar() {
{
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
this.footerToolbar=false this.footerToolbar = false;
} }
}, },
computed: { computed: {
......
...@@ -17,6 +17,9 @@ export default { ...@@ -17,6 +17,9 @@ export default {
update(params) { update(params) {
return Api.post(`${systemUrl}/equipcalendarwork/createorupdate`, params); return Api.post(`${systemUrl}/equipcalendarwork/createorupdate`, params);
}, },
set(params) {
return Api.post(`${systemUrl}/planresource/setplanresource`, params);
},
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${systemUrl}/planresource/delete`, { params: params }); return Api.delete(`${systemUrl}/planresource/delete`, { params: params });
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action" :high="false"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
:high="false"
@on-selection-change="onSelect"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字资源名称/资源编号/资源类型/部门" v-model="easySearch.keys.value" /> <Input placeholder="请输入资源名称/编号/类型/部门" v-model="easySearch.keys.value" />
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="batch">
<Form ref="form" :model="entity" :rules="rules" :label-width="90" class="form-row">
<Row>
<Col span="8">
<FormItem :label="l('isimportant')" prop="isimportant">
<RadioGroup v-model="entity.isimportant">
<Radio label="0"></Radio>
<Radio label="1"></Radio>
</RadioGroup>
</FormItem>
</Col>
<Col span="12">
<FormItem :label="l('capabilityValue')">
<InputNumber v-model="entity.capabilityValue"></InputNumber>
</FormItem>
</Col>
<Col span="4">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
</DataGrid> </DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
...@@ -38,14 +68,23 @@ export default { ...@@ -38,14 +68,23 @@ export default {
easySearch: { easySearch: {
keys: { op: "title,code,type,departTitle", value: null } keys: { op: "title,code,type,departTitle", value: null }
}, },
entity: {},
disabled: false,
ids: [],
editModal: false, editModal: false,
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
rules: {
isimportant: [{ required: true, message: "必填", trigger: "blur" }],
capabilityValue: [{ required: true, message: "必填", trigger: "blur" }]
},
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{
type: "selection",
width: 70,
align: "center"
},
// { // {
// key: "deleterUserId", // key: "deleterUserId",
// title: this.l("deleterUserId"), // title: this.l("deleterUserId"),
...@@ -194,6 +233,46 @@ export default { ...@@ -194,6 +233,46 @@ export default {
this.editModal = false; this.editModal = false;
this.deletedlModal = false; this.deletedlModal = false;
}, },
onSelect(a, b) {
console.log(a);
//批量选择
let selectRows = a;
this.ids = [];
selectRows.forEach(e => {
this.ids.push(e.id);
});
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
let data = {
ids: this.ids,
isimportant: this.entity.isimportant,
capabilityValue: this.entity.capabilityValue
};
Api.set(data)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
} else {
this.$Message.error("保存失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.footer = false;
this.handleSelectAll(false);
},
l(key) { l(key) {
let vkey = "plan_resource" + "." + key; let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
...@@ -202,4 +281,31 @@ export default { ...@@ -202,4 +281,31 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
.form-row {
width: 600px;
margin-left: 50px;
margin-top: -45px;
.ivu-form-item-label {
color: #fff !important;
}
}
.ivu-footer-toolbar-right {
width: 1100px;
position: relative !important;
}
.btn {
position: absolute !important;
top: 12px !important;
right: 40px !important;
}
// .ivu-footer-toolbar{
// position: relative !important;
// .ivu-btn .ivu-btn-default {
// position: absolute !important;
// top:0 !important;
// right: 10px !important;
// // margin-top: -80px !important;
// }
// }
</style> </style>
\ 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