Commit 4e1a4474 authored by 周远喜's avatar 周远喜

模版测试

parent e73a3f82
...@@ -63,7 +63,30 @@ ...@@ -63,7 +63,30 @@
data() { data() {
return { return {
disabled: false, disabled: false,
entity: {}, entity: {classId: null,
unicode: "",
name: "",
code: "",
productId: null,
version: "",
author: null,
departmentId: null,
isMain: null,
upId: null,
upDetailId: null,
routingType: null,
status: null,
approvalStatus: null,
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
isEffect: "",
versionnotes: "",
phase: null,
versionid: null,
isSendPpm: null},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: '必填', trigger: 'blur' }]
} }
...@@ -72,10 +95,14 @@ ...@@ -72,10 +95,14 @@
props: { props: {
v: Object, v: Object,
eid: Number eid: Number
}, },
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
...@@ -102,7 +129,7 @@ ...@@ -102,7 +129,7 @@
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
this.entity.id = 0; this.entity.id = 0;
}) });
}, },
l(key) { l(key) {
key = "routing_header" + "." + key; key = "routing_header" + "." + key;
...@@ -115,7 +142,7 @@ ...@@ -115,7 +142,7 @@
}, },
eid(v) { eid(v) {
if (v > 0) { if (v > 0) {
this.load(v);
} }
} }
} }
......
...@@ -13,8 +13,10 @@ export default { ...@@ -13,8 +13,10 @@ export default {
update(params){ update(params){
return Api.post(`${technologyUrl}routingheader/update`,params); return Api.post(`${technologyUrl}routingheader/update`,params);
}, },
//删除: delete(id) {
delete(params) { return Api.delete(`${technologyUrl}routingheader/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${technologyUrl}routingheader/batchdelete`,params); return Api.post(`${technologyUrl}routingheader/batchdelete`,params);
} }
} }
\ No newline at end of file
...@@ -46,6 +46,11 @@ ...@@ -46,6 +46,11 @@
props: { props: {
eid: Number eid: Number
}, },
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
...@@ -63,7 +68,7 @@ ...@@ -63,7 +68,7 @@
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v > 0) {
this.load(v); this.load(v);
} }
} }
......
...@@ -73,11 +73,15 @@ ...@@ -73,11 +73,15 @@
props: { props: {
eid: Number eid: Number
}, },
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
this.$emit('on-load')
}) })
}, },
handleSubmit() { handleSubmit() {
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<Modal v-model="modal" :title="title" footer-hide> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -25,9 +24,9 @@ export default { ...@@ -25,9 +24,9 @@ export default {
Search Search
}, },
head: { head: {
title: "&#x5DE5;&#x827A;&#x89C4;&#x7A0B;", title: "工艺规程",
author: "henq", author: "henq",
description: "routing_header 2020/4/23 17:58:42", description: "routing_header 2020/4/24 17:15:41",
}, },
data() { data() {
return { return {
...@@ -40,13 +39,13 @@ keys:{op:"unicode,name,code",value:null} ...@@ -40,13 +39,13 @@ keys:{op:"unicode,name,code",value:null}
detail:null, detail:null,
curId: 0, curId: 0,
columns: [ columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" }, { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
{ key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true }, { key:"creationTime",title:this.$t("creationTime") ,hide:true ,align:"left" ,high:true },
{ key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true }, { key:"creatorUserId",title:this.$t("creatorUserId") ,hide:true ,align:"left" ,high:true },
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true }, { key:"lastModificationTime",title:this.$t("lastModificationTime") ,hide:true ,align:"left" ,high:true },
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true }, { key:"lastModifierUserId",title:this.$t("lastModifierUserId") ,hide:true ,align:"left" ,high:true },
{ key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true }, { key:"deleterUserId",title:this.$t("deleterUserId") ,hide:true ,align:"left" },
{ key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true }, { key:"deletionTime",title:this.$t("deletionTime") ,hide:true ,align:"left" },
{ key:"classId",title:this.l("classId") ,align:"left" ,high:true }, { key:"classId",title:this.l("classId") ,align:"left" ,high:true },
{ key:"unicode",title:this.l("unicode") ,align:"left" ,easy:true ,high:true }, { key:"unicode",title:this.l("unicode") ,align:"left" ,easy:true ,high:true },
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true }, { key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true },
...@@ -65,7 +64,7 @@ keys:{op:"unicode,name,code",value:null} ...@@ -65,7 +64,7 @@ keys:{op:"unicode,name,code",value:null}
{ key:"approvalStatusRemark",title:this.l("approvalStatusRemark") ,align:"left" ,high:true }, { key:"approvalStatusRemark",title:this.l("approvalStatusRemark") ,align:"left" ,high:true },
{ key:"auditUserId1",title:this.l("auditUserId1") ,align:"left" ,high:true }, { key:"auditUserId1",title:this.l("auditUserId1") ,align:"left" ,high:true },
{ key:"auditUserId2",title:this.l("auditUserId2") ,align:"left" ,high:true }, { key:"auditUserId2",title:this.l("auditUserId2") ,align:"left" ,high:true },
{ key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true }, { key:"isDeleted",title:this.$t("isDeleted") ,hide:true ,align:"left" },
{ key:"platesnum",title:this.l("platesnum") ,align:"left" ,high:true }, { key:"platesnum",title:this.l("platesnum") ,align:"left" ,high:true },
{ key:"isEffect",title:this.l("isEffect") ,align:"left" ,high:true }, { key:"isEffect",title:this.l("isEffect") ,align:"left" ,high:true },
{ key:"versionnotes",title:this.l("versionnotes") ,align:"left" ,high:true }, { key:"versionnotes",title:this.l("versionnotes") ,align:"left" ,high:true },
...@@ -79,8 +78,8 @@ keys:{op:"unicode,name,code",value:null} ...@@ -79,8 +78,8 @@ keys:{op:"unicode,name,code",value:null}
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('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: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(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) } }, '删除') h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除')
]) ])
...@@ -96,54 +95,46 @@ keys:{op:"unicode,name,code",value:null} ...@@ -96,54 +95,46 @@ keys:{op:"unicode,name,code",value:null}
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch('loadDictionary') // 加载数据字典
}, },
methods:{ methods:{
addOk() { ok() {
this.$refs.grid.load() this.$refs.grid.load()
this.modal = false this.modal = false
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch)
}, },
add(id) { add() {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = import('./add') this.detail =()=> import('./add')
this.modal = true; this.modal = true;
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.detail = import('./add') this.detail = () =>import('./add')
this.modal = true; this.modal = true;
}, },
detail(id) { view(id) {
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = import('./detail') this.detail = () =>import('./detail')
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = import('./edit') this.detail = () => import('./edit')
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
this.deletelModal = true; Api.delete(id).then((r) => {
this.curId = id;
},
removeOk() {
Api.delete([this.curId]).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success('删除成功') this.$Message.success('删除成功')
} }
}) })
}, },
removeCancel() {
this.deletelModal = false;
},
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false this.modal = false
...@@ -152,12 +143,6 @@ keys:{op:"unicode,name,code",value:null} ...@@ -152,12 +143,6 @@ keys:{op:"unicode,name,code",value:null}
/* /*
routing_header:{ routing_header:{
id:'', id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'最近修改时间',
lastModifierUserId:'最近修改人',
deleterUserId:'上传人',
deletionTime:'删除时间',
classId:'类id', classId:'类id',
unicode:'unicode', unicode:'unicode',
name:'工艺名称', name:'工艺名称',
...@@ -176,7 +161,6 @@ keys:{op:"unicode,name,code",value:null} ...@@ -176,7 +161,6 @@ keys:{op:"unicode,name,code",value:null}
approvalStatusRemark:'审批备注', approvalStatusRemark:'审批备注',
auditUserId1:'审批人', auditUserId1:'审批人',
auditUserId2:'审批人', auditUserId2:'审批人',
isDeleted:'是否删除',
platesnum:'板数', platesnum:'板数',
isEffect:'是否有效', isEffect:'是否有效',
versionnotes:'版本说明', versionnotes:'版本说明',
......
...@@ -3,17 +3,13 @@ ...@@ -3,17 +3,13 @@
<Row> <Row>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="l('id')" prop="id"> <Input v-model="condition.id.value"> </Input> <Col :span="12" :v-if="condition.id.show"><FormItem :label="l('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker> <Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="$t('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input> <Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="$t('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker> <Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="$t('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input> <Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="$t('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deleterUserId.show"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <Input v-model="condition.deleterUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.classId.show"><FormItem :label="l('classId')" prop="classId"> <Input v-model="condition.classId.value"> </Input> <Col :span="12" :v-if="condition.classId.show"><FormItem :label="l('classId')" prop="classId"> <Input v-model="condition.classId.value"> </Input>
</FormItem></Col> </FormItem></Col>
...@@ -51,8 +47,6 @@ ...@@ -51,8 +47,6 @@
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.auditUserId2.show"><FormItem :label="l('auditUserId2')" prop="auditUserId2"> <Input v-model="condition.auditUserId2.value"> </Input> <Col :span="12" :v-if="condition.auditUserId2.show"><FormItem :label="l('auditUserId2')" prop="auditUserId2"> <Input v-model="condition.auditUserId2.value"> </Input>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.isDeleted.show"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="condition.isDeleted.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.platesnum.show"><FormItem :label="l('platesnum')" prop="platesnum"> <Input v-model="condition.platesnum.value"> </Input> <Col :span="12" :v-if="condition.platesnum.show"><FormItem :label="l('platesnum')" prop="platesnum"> <Input v-model="condition.platesnum.value"> </Input>
</FormItem></Col> </FormItem></Col>
<Col :span="12" :v-if="condition.isEffect.show"><FormItem :label="l('isEffect')" prop="isEffect"> <Input v-model="condition.isEffect.value"> </Input> <Col :span="12" :v-if="condition.isEffect.show"><FormItem :label="l('isEffect')" prop="isEffect"> <Input v-model="condition.isEffect.value"> </Input>
...@@ -75,13 +69,11 @@ ...@@ -75,13 +69,11 @@
data() { data() {
return { return {
condition: { condition: {
id:{op:"Equal",value:null,show:false}, id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true}, creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true}, creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true}, lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true}, lastModifierUserId:{op:"Equal",value:null,show:true},
deleterUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
classId:{op:"Equal",value:null,show:true}, classId:{op:"Equal",value:null,show:true},
unicode:{op:"Equal",value:null,show:true}, unicode:{op:"Equal",value:null,show:true},
name:{op:"Equal",value:null,show:true}, name:{op:"Equal",value:null,show:true},
...@@ -100,7 +92,6 @@ remark:{op:"Equal",value:null,show:true}, ...@@ -100,7 +92,6 @@ remark:{op:"Equal",value:null,show:true},
approvalStatusRemark:{op:"Equal",value:null,show:true}, approvalStatusRemark:{op:"Equal",value:null,show:true},
auditUserId1:{op:"Equal",value:null,show:true}, auditUserId1:{op:"Equal",value:null,show:true},
auditUserId2:{op:"Equal",value:null,show:true}, auditUserId2:{op:"Equal",value:null,show:true},
isDeleted:{op:"Equal",value:null,show:true},
platesnum:{op:"Equal",value:null,show:true}, platesnum:{op:"Equal",value:null,show:true},
isEffect:{op:"Equal",value:null,show:true}, isEffect:{op:"Equal",value:null,show:true},
versionnotes:{op:"Equal",value:null,show:true}, versionnotes:{op:"Equal",value:null,show:true},
......
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