Commit a3f9bc47 authored by renjintao's avatar renjintao

workhourManage detail\indx\zh-cn\datagrid...

parent 925dc4cf
<template> <template>
<div class="table-content"> <div class="table-content">
<div class="table-tools" v-if="tool"> <div class="table-tools" v-if="tool">
<div class="table-search"> <div class="table-search">
<slot name="easySearch" v-if="easy"> <slot name="easySearch" v-if="easy">
<Form inline> <Form inline>
<FormItem> <FormItem>
<Input <Input search enter-button :placeholder="placeholder" @on-search="easySearch" v-width="300" v-model="keys" />
search
enter-button
:placeholder="placeholder"
@on-search="easySearch"
v-width="300"
v-model="keys"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button v-if="high" @click="modalSearch = true" type="text"> <Button v-if="high" @click="modalSearch = true" type="text">
...@@ -28,9 +21,7 @@ ...@@ -28,9 +21,7 @@
</div> </div>
<div class="btns"> <div class="btns">
<slot name="buttons"></slot> <slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length > 0" <Button @click="export2Excel" v-if="exportTitle.length > 0">导出</Button>
>导出</Button
>
<Button v-if="set && type == 'table'" @click="config = !config"> <Button v-if="set && type == 'table'" @click="config = !config">
<Icon type="md-build" title="列设置" /> <Icon type="md-build" title="列设置" />
</Button> </Button>
...@@ -47,68 +38,20 @@ ...@@ -47,68 +38,20 @@
<h4>暂无数据</h4> <h4>暂无数据</h4>
</Col> </Col>
</Row> </Row>
<Table <Table v-else :border="border" :columns="columnsNow" :data="list" :height="tableHeight" :draggable="draggable" ref="table" class="tableCommon" @on-expand="expand" @on-drag-drop="onDragDrop" @on-selection-change="selectionChange" @on-select="onSelect" @on-select-all="allChange" @on-sort-change="sortChange" :row-key="rowKey" stripe></Table>
v-else
:border="border"
:columns="columnsNow"
:data="list"
:height="tableHeight"
:draggable="draggable"
ref="table"
class="tableCommon"
@on-expand="expand"
@on-drag-drop="onDragDrop"
@on-selection-change="selectionChange"
@on-select="onSelect"
@on-select-all="allChange"
@on-sort-change="sortChange"
:row-key="rowKey"
stripe
></Table>
</div> </div>
<div class="table-footer"> <div class="table-footer">
<slot name="footer"></slot> <slot name="footer"></slot>
<Page <Page v-if="page" :total="search.total" :current="search.page" class="fr" show-total size="small" show-elevator show-sizer :page-size="search.pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" />
v-if="page"
:total="search.total"
:current="search.page"
class="fr"
show-total
size="small"
show-elevator
show-sizer
:page-size="search.pageSize"
:page-size-opts="pageSizeOpts"
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div> </div>
<Modal <Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
v-if="high"
v-model="modalSearch"
title="高级搜索"
draggable
width="800"
ref="search"
>
<slot name="searchForm"></slot> <slot name="searchForm"></slot>
<div slot="footer"> <div slot="footer">
<Button @click="modalSearch = false" style="margin-left: 20px" <Button @click="modalSearch = false" style="margin-left: 20px">取消</Button>
>取消</Button <Button @click="complexSearch" type="primary" style="margin-left: 10px">查询</Button>
>
<Button @click="complexSearch" type="primary" style="margin-left: 10px"
>查询</Button
>
</div> </div>
</Modal> </Modal>
<Drawer <Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false">
title="列设置"
v-if="set"
v-model="config"
:scrollable="true"
placement="left"
:mask="false"
>
<div slot="header"> <div slot="header">
列设置 列设置
<a @click="undoConfig" class="ml50"> <a @click="undoConfig" class="ml50">
...@@ -116,17 +59,9 @@ ...@@ -116,17 +59,9 @@
</a> </a>
</div> </div>
<ul class="table-columns"> <ul class="table-columns">
<li <li v-for="(li, index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }">
v-for="(li, index) in columnsCur"
:key="index"
v-dragging="{ item: li, list: columnsCur, group: 'li' }"
>
<label @click="columnChange(li, index)" :class="{ dis: li.hide }"> <label @click="columnChange(li, index)" :class="{ dis: li.hide }">
<Icon <Icon :type="li.hide ? 'md-eye-off' : 'md-eye'" size="16" class="mr10" />
:type="li.hide ? 'md-eye-off' : 'md-eye'"
size="16"
class="mr10"
/>
<span>{{ li.title }}</span> <span>{{ li.title }}</span>
</label> </label>
<Icon type="ios-move" class="move" size="18" /> <Icon type="ios-move" class="move" size="18" />
...@@ -139,14 +74,16 @@ ...@@ -139,14 +74,16 @@
<slot name="batch"></slot> <slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button> <Button @click="cancelBatch">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
<script> <script>
import ColumnSlot from "./treeGrid/columnSolt"; import ColumnSlot from "./treeGrid/columnSolt";
export default { export default {
name: "DataGrid", name: "DataGrid",
components: { ColumnSlot }, components: {
ColumnSlot
},
data() { data() {
return { return {
keys: "", keys: "",
...@@ -156,7 +93,7 @@ export default { ...@@ -156,7 +93,7 @@ export default {
search: { search: {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
sortBy: "id", sortBy: this.conditions.sortBy ? this.conditions.sortBy : 'id',
isDesc: true, isDesc: true,
conditions: [], conditions: [],
}, },
...@@ -366,7 +303,7 @@ export default { ...@@ -366,7 +303,7 @@ export default {
} }
}); });
var items=this.$u.clone(this.columns); var items = this.$u.clone(this.columns);
// var soct=this.$scopedSlots; // var soct=this.$scopedSlots;
// // console.warn("that.$scopedSlots()",soct["action"]()); // // console.warn("that.$scopedSlots()",soct["action"]());
// items.forEach((u) => { // items.forEach((u) => {
...@@ -425,8 +362,7 @@ export default { ...@@ -425,8 +362,7 @@ export default {
}, },
loadUserConfig() { loadUserConfig() {
var query = { var query = {
conditions: [ conditions: [{
{
fieldName: "creatorUserId", fieldName: "creatorUserId",
fieldValue: this.userId, fieldValue: this.userId,
conditionalType: "Equal", conditionalType: "Equal",
...@@ -977,6 +913,7 @@ export default { ...@@ -977,6 +913,7 @@ export default {
} }
overflow-x: hidden; overflow-x: hidden;
.zan-wu { .zan-wu {
height: 600px; height: 600px;
line-height: 600px; line-height: 600px;
......
...@@ -2155,5 +2155,19 @@ document_category: { ...@@ -2155,5 +2155,19 @@ document_category: {
template: '模板', template: '模板',
attachment: '附件', attachment: '附件',
type: '模版类型', type: '模版类型',
},
workHour: {
userTitle: '员工姓名',
userCardNo: '员工编号',
totalWorkHour: '工时数量',
planQuantity: '计划数量',
qualified: '合格数量',
action: '操作',
mesCode: '订单编号',
productName: '产品名称',
drawnNumber: '产品图号',
routingDetailSeq: '工序号',
routingDetailName: '工序名称',
workHour: '工时数量',
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="detail"> <div class="detail">
<DataGrid :columns="columns" ref="grid" :data="data" :set="false"> <DataGrid :columns="columns" ref="grid" :data="data" :set="false">
<template slot="easySearch"> <template slot="easySearch">
<p class="pl10">用户姓名:<span class="mr20">{{entity.name}}</span>用户编号:<span class="mr20">{{entity.id}}</span>工时数量:<span class="mr20">{{entity.creatorUserId}}</span>计划数量:<span class="mr20">{{entity.creatorUserId}}</span>合格数量:<span class="mr20">{{entity.creatorUserId}}</span></p> <p class="pl10">{{this.l('userTitle')}}<span class="mr20">{{entity.userTitle}}</span>{{this.l('userTitle')}}<span class="mr20">{{entity.userCardNo}}</span>{{this.l('totalWorkHour')}}<span class="mr20">{{entity.totalWorkHour}}</span>{{this.l('planQuantity')}}<span class="mr20">{{entity.planQuantity}}</span>{{this.l('qualified')}}<span class="mr20">{{entity.qualified}}</span></p>
</template> </template>
</DataGrid> </DataGrid>
</div> </div>
...@@ -30,39 +30,36 @@ export default { ...@@ -30,39 +30,36 @@ export default {
fileUrlPath: "", fileUrlPath: "",
columns: [{ columns: [{
key: "mesCode", key: "mesCode",
title: '订单编号', title: this.l('mesCode'),
align: "left", align: "left",
easy: true,
high: true,
}, },
{ {
key: "productName", key: "productName",
title: '产品名称', title: this.l('productName'),
align: "left", align: "left",
easy: true,
high: true,
}, },
{ {
key: "drawnNumber", key: "drawnNumber",
title: '产品图号', title: this.l('drawnNumber'),
align: "left", align: "left",
easy: true,
high: true,
}, },
{ {
key: "routingDetailSeq", key: "routingDetailSeq",
title: '工序号', title: this.l('routingDetailSeq'),
align: "left", align: "right",
easy: true, width: 100,
high: true,
}, },
{ {
key: "routingDetailName", key: "routingDetailName",
title: '工序名称', title: this.l('routingDetailName'),
align: "left", align: "left",
easy: true, },
high: true, {
} key: "workHour",
title: this.l('workHour'),
align: "right",
},
], ],
data: [], data: [],
}; };
...@@ -100,6 +97,10 @@ export default { ...@@ -100,6 +97,10 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
l(key) {
let vkey = "workHour" + "." + key;
return this.$t(vkey) || key;
},
}, },
watch: { watch: {
row(v) { row(v) {
......
<template> <template>
<div class="h100"> <div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
op: "userTitle,userCardNo", op: "userTitle,userCardNo",
value: null value: null
}, },
sortBy: 'totalWorkHour'
}, },
modal: false, modal: false,
full: false, full: false,
...@@ -50,41 +51,41 @@ export default { ...@@ -50,41 +51,41 @@ export default {
title: "序号", title: "序号",
}, { }, {
key: "userTitle", key: "userTitle",
title: '员工姓名', title: this.l('userTitle'),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "userCardNo", key: "userCardNo",
title: '员工编号', title: this.l('userCardNo'),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "totalWorkHour", key: "totalWorkHour",
title: '工时数量', title: this.l('totalWorkHour'),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "planQuantity", key: "planQuantity",
title: '计划数量', title: this.l('planQuantity'),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
key: "qualified", key: "qualified",
title: '合格数量', title: this.l('qualified'),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ {
title: "操作", title: this.l("action"),
key: "action", key: "action",
width: 140, width: 140,
align: "center", align: "center",
...@@ -141,7 +142,7 @@ export default { ...@@ -141,7 +142,7 @@ export default {
this.modal = false; this.modal = false;
}, },
l(key) { l(key) {
let vkey = "import_center" + "." + key; let vkey = "workHour" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
}, },
}, },
......
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