Commit 394762da authored by renjintao's avatar renjintao

workHourManage testdata

parent a0de9c00
<template> <template>
<div class="detail"> <div class="detail">
<Row> <DataGrid :columns="columns" ref="grid" :action="action" :easy="false" :set="false">
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed> </DataGrid>
<Filed :span="12" :name="l('file')">
<a @click="downFile(entity.path)">{{entity.file}}</a>
</Filed>
<Filed :span="12" :name="l('status')">
<state code="improt.im.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User>
</Filed>
</Row>
</div> </div>
</template> </template>
...@@ -23,28 +11,84 @@ export default { ...@@ -23,28 +11,84 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
action: Api.index,
easySearch: {
keys: {
op: "name,file",
value: null
},
},
entity: {}, entity: {},
downUrl: fileUrlDown, downUrl: fileUrlDown,
fileUrlPath: "", fileUrlPath: "",
columns: [{
key: "name",
title: '订单编号',
align: "left",
easy: true,
high: true,
},
{
key: "id",
title: '产品图号',
align: "left",
easy: true,
high: true,
},
{
key: "creatorUserId",
title: '产品名称',
align: "left",
easy: true,
high: true,
},
{
key: "creatorUserId",
title: '工序号',
align: "left",
easy: true,
high: true,
},
{
key: "creatorUserId",
title: '工序名称',
align: "left",
easy: true,
high: true,
}
],
}; };
}, },
props: { props: {
eid: Number, eid: Number,
row: {} row: {
type: Object,
default: () => {
return null;
}
}
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { mounted() {
if (this.eid > 0) {
this.load(this.eid); if (this.row != null && this.row != {}) {
this.entity = this.row
//this.load(this.eid);
} }
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ // Api.get({
id: v, // id: v,
}).then((r) => { // }).then((r) => {
this.entity = r.result; // this.entity = r.result;
this.$emit("on-load"); // this.$emit("on-load");
}); // });
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
...@@ -70,14 +114,10 @@ export default { ...@@ -70,14 +114,10 @@ export default {
}, },
}, },
watch: { watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
row(v) { row(v) {
if (v != null && v != {}) { if (v != null && v != {}) {
this.load(v); // this.load(v);
this.entity = v
} }
}, },
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="full" :footer-hide="initBtn"> <Modal v-model="modal" :title="title" width="1200" :fullscreen="full" :footer-hide="initBtn">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :row="row" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -42,49 +42,46 @@ export default { ...@@ -42,49 +42,46 @@ export default {
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
row: null,
columns: [{ columns: [{
key: "id", type: "index",
title: this.$t("id"), width: 80,
hide: true, align: "right",
align: "left", title: "序号",
high: true, }, {
},
{
key: "name", key: "name",
title: this.l("name"), title: '员工姓名',
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "file", key: "id",
title: this.l("file"), title: '员工编号',
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "creationTime", key: "creatorUserId",
title: this.l("creationTime"), title: '工时数量',
align: "center", align: "left",
width: "180", easy: true,
high: true, high: true,
}, },
{ {
key: "creatorUserId", key: "creatorUserId",
title: this.l("creatorUserId"), title: '计划数量',
align: "left", align: "left",
easy: true,
high: true, high: true,
type: "user",
width: "180",
}, },
{ {
key: "status", key: "creatorUserId",
title: this.l("status"), title: '合格数量',
align: "center", align: "left",
easy: true,
high: true, high: true,
code: "improt.im.status",
width: "150",
}, },
{ {
title: "操作", title: "操作",
...@@ -101,7 +98,7 @@ export default { ...@@ -101,7 +98,7 @@ export default {
oprate: "detail" oprate: "detail"
}, },
on: { on: {
click: () => this.view(params.row.id) click: () => this.view(params.row)
}, },
}, },
"详情" "详情"
...@@ -130,22 +127,15 @@ export default { ...@@ -130,22 +127,15 @@ export default {
search() { search() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
view(id) { view(rowInfo) {
this.curId = id; this.curId = rowInfo.id;
this.title = "详情"; this.row = rowInfo;
this.full = false; this.title = "工时详情------【" + "员工姓名:管理员;员工编号:10001;工时数量:10000.00;计划数量:8000.00;合格数量:9000.00】";
this.full = true;
this.initBtn = false; this.initBtn = false;
this.detail = () => import("./detail"); this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
......
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