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

排产资源页面

parent 07ec32b7
......@@ -924,14 +924,14 @@ export default {
demandStartDate: '投料时间',
demandFinishDate: '节点时间',
//tempTitle------
stage:'阶段',
materialId:'材料',
routing_Method:'工艺方法',
outer_Envelope_Size:'外包络尺寸',
guestName:'甲方客户',
taskCode:'甲方任务号',
putintDocmentCode:'甲方投产输入文件(编号)',
technologyDocmentCode:'甲方技术输入文件(编号)',
stage: '阶段',
materialId: '材料',
routing_Method: '工艺方法',
outer_Envelope_Size: '外包络尺寸',
guestName: '甲方客户',
taskCode: '甲方任务号',
putintDocmentCode: '甲方投产输入文件(编号)',
technologyDocmentCode: '甲方技术输入文件(编号)',
},
mes_part_task_plan_simulate: {
id: '',
......@@ -1259,5 +1259,21 @@ export default {
productionRequirement: '生产要求',
standard: '标准指标',
qualityTemplateName: '模板文件名称',
},
plan_resource: {
id: '',
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
title: '资源名称',
code: '资源编号',
type: '资源类型',
property: '属性',
departId: '部门id',
departTitle: '部门',
}
}
<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 '@/plugins/request'
export default {
index:`${resourceUrl}planresource/paged`,
paged(params){
return Api.post(`${resourceUrl}planresource/paged`,params);
},
get(params){
return Api.get(`${resourceUrl}planresource/get`,params);
},
create(params){
return Api.post(`${resourceUrl}planresource/create`,params);
},
update(params){
return Api.post(`${resourceUrl}planresource/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}planresource/delete`,{params:params});
},
}
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字资源名称/资源编号/资源类型/部门" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Add from "./add";
export default {
name: "list",
components: {
Add
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title,code,type,departTitle", value: null }
},
deletelModal: false,
curId: 0,
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "creationTime",
title: this.l("creationTime"),
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",
title: this.l("title"),
align: "left",
easy: true,
high: true
},
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true
},
{
key: "type",
title: this.l("type"),
align: "left",
easy: true,
high: true
},
{
key: "property",
title: this.l("property"),
align: "left",
high: true
},
{
key: "departId",
title: this.l("departId"),
align: "left",
high: true
},
{
key: "departTitle",
title: this.l("departTitle"),
align: "left",
easy: true,
high: true
},
{
title: "操作",
key: "id",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) }
},
"查看"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
}
}
]
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.curId = 0;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then(r => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.deletedlModal = false;
},
l(key) {
/*
plan_resource:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'资源名称',
code:'资源编号',
type:'资源类型',
property:'属性',
departId:'部门id',
departTitle:'部门',
}
*/
let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less">
</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