Commit 174bf24d authored by 康振飞's avatar 康振飞

工步modal

parent 74833485
......@@ -15362,8 +15362,7 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -15523,7 +15522,6 @@
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -15542,7 +15540,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -15645,7 +15642,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -15731,8 +15727,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -15768,7 +15763,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -15832,14 +15826,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -18617,6 +18609,7 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -19485,7 +19478,6 @@
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -19504,7 +19496,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -19607,7 +19598,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -19693,8 +19683,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -19794,14 +19783,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="entity.isDeleted"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingHeaderId')" prop="routingHeaderId"> <InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingDetailId')" prop="routingDetailId"> <InputNumber v-model="entity.routingDetailId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('classId')" prop="classId"> <InputNumber v-model="entity.classId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('stepSeq')" prop="stepSeq"> <InputNumber v-model="entity.stepSeq"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('description')" prop="description"> <Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="Process.Status" v-model="entity.status"></Dictionary>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('stepContent')" prop="stepContent"> <Input v-model="entity.stepContent" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('extend')" prop="extend"> <Input v-model="entity.extend"> </Input>
</FormItem></Col>
<Col :span="12">
<FormItem :label="l('stepSeq')" prop="stepSeq">
<InputNumber v-model="entity.stepSeq"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('stepContent')" prop="stepContent">
<Input v-model="entity.stepContent" type="textarea" :rows="5"></Input>
<!-- <Input v-model="entity.stepContent" type="textarea" :minRows="3", :maxRows="7" ></Input> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingHeaderId')" prop="routingHeaderId">
<InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingDetailId')" prop="routingDetailId">
<InputNumber v-model="entity.routingDetailId"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="entity.isDeleted"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('classId')" prop="classId">
<InputNumber v-model="entity.classId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="Process.Status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('extend')" prop="extend">
<Input v-model="entity.extend"></Input>
</FormItem>
</Col> -->
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -43,18 +95,17 @@
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {
},
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
name: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
props: {
eid: Number
......@@ -68,34 +119,36 @@
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
Api.update(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error('保存失败')
this.$Message.error("保存失败");
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = "routing_step" + "." + key;
return this.$t(key)
return this.$t(key);
}
},
watch: {
......@@ -105,5 +158,5 @@
}
}
}
}
};
</script>
\ 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>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<!-- <Poptip trigger="focus" title="Title" content="请输入关键字工步名称/描述/备注/工步内容"> -->
<FormItem prop="keys">
<Input placeholder="请输入关键字工步名称/描述/备注/工步内容" v-model="easySearch.keys.value" />
</FormItem>
<!-- <Poptip/> -->
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
......@@ -16,108 +26,181 @@
</div>
</template>
<script>
import Api from './api'
import Search from './search'
import Api from "./api";
import Search from "./search";
export default {
name: 'list',
components:{
name: "list",
components: {
Search
},
head: {
title: "工步",
author: "henq",
description: "routing_step 4/28/2020 4:23:17 PM",
},
description: "routing_step 4/28/2020 4:23:17 PM"
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"name,description,remark,stepContent",value:null}
},
keys: { op: "name,description,remark,stepContent", value: null }
},
modal: false,
title:"新增",
detail:null,
title: "新增",
detail: null,
curId: 0,
columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" ,high:true },
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" ,high:true },
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,hide:true ,align:"left" ,high:true },
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,hide:true ,align:"left" ,high:true },
{ key:"routingHeaderId",title:this.l("routingHeaderId") ,hide:true ,align:"left" },
{ key:"routingDetailId",title:this.l("routingDetailId") ,hide:true ,align:"left" },
{ key:"classId",title:this.l("classId") ,hide:true ,align:"left" },
{ key:"stepSeq",title:this.l("stepSeq") ,align:"left" ,high:true },
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true },
{ key:"description",title:this.l("description") ,align:"left" ,easy:true ,high:true },
{ key:"status",title:this.l("status") ,align:"left" ,high:true ,code:'Process.Status' },
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left",
high: true
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left",
high: true
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left",
high: true
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left",
high: true
},
{
key: "routingHeaderId",
title: this.l("routingHeaderId"),
hide: true,
align: "left"
},
{
key: "routingDetailId",
title: this.l("routingDetailId"),
hide: true,
align: "left"
},
{ key: "classId", title: this.l("classId"), hide: true, align: "left" },
{ key: "stepSeq", title: this.l("stepSeq"), align: "left", high: true },
{
title: '操作',
key: 'action',
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true
},
{
key: "description",
title: this.l("description"),
align: "left",
easy: true,
high: true
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "Process.Status"
},
{
title: "操作",
key: "action",
width: 140,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'),
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
}
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
]
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
}
}
]
};
},
mounted(){
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods:{
methods: {
ok() {
this.$refs.grid.load()
this.modal = false
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail =()=> import('./add')
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () =>import('./add')
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () =>import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
Api.delete(id).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('删除成功')
this.$Message.success("删除成功");
}
})
});
},
cancel() {
this.curId = 0;
this.modal = false
this.modal = false;
},
l(key) {
/*
......@@ -143,10 +226,10 @@ keys:{op:"name,description,remark,stepContent",value:null}
}
*/
let vkey = "routing_step" + "." + key;
return this.$t(vkey)||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