Commit 394762da authored by renjintao's avatar renjintao

workHourManage testdata

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