Commit fbecf61c authored by renjintao's avatar renjintao

datagrid

parent 299f49eb
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
tableHeight: 0, tableHeight: 0,
firstY: 0, firstY: 0,
config: false, config: false,
list: [], list: [],
columnsCur: [], columnsCur: [],
configLoad: false, configLoad: false,
...@@ -146,9 +146,9 @@ export default { ...@@ -146,9 +146,9 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
format:{ format: {
type:Function, type: Function,
default:null default: null
}, },
lazy: { lazy: {
//懒加载设置,设置为真时候,默认不加载数据。 //懒加载设置,设置为真时候,默认不加载数据。
...@@ -227,17 +227,19 @@ export default { ...@@ -227,17 +227,19 @@ export default {
return ["table", "card", "list"].indexOf(value) !== -1; return ["table", "card", "list"].indexOf(value) !== -1;
} }
}, },
span: {//栅格数 span: {
//栅格数
type: Number, type: Number,
default: 24 default: 24
}, },
//table控件children子数据控制功能 //table控件children子数据控制功能
rowKey: { rowKey: {
type: [String, Number] type: [String, Number]
}, },
gutter:{//间距 gutter: {
type:Number, //间距
default:40 type: Number,
default: 40
} }
}, },
created() { created() {
...@@ -264,7 +266,7 @@ export default { ...@@ -264,7 +266,7 @@ export default {
this.easySearch(); this.easySearch();
} }
if (this.height === 0) { if (this.height === 0) {
this.$nextTick(()=>{ this.$nextTick(() => {
this.tableHeight = this.$refs.main.offsetHeight; this.tableHeight = this.$refs.main.offsetHeight;
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
...@@ -272,7 +274,7 @@ export default { ...@@ -272,7 +274,7 @@ export default {
this.tableHeight = this.$refs.main.offsetHeight; this.tableHeight = this.$refs.main.offsetHeight;
})(); })();
}; };
}) });
} else { } else {
this.tableHeight = this.height; this.tableHeight = this.height;
} }
...@@ -290,12 +292,10 @@ export default { ...@@ -290,12 +292,10 @@ export default {
} }
if (this.action) { if (this.action) {
this.$api.post(this.action, this.search).then(r => { this.$api.post(this.action, this.search).then(r => {
if(this.format){ if (this.format) {
this.list = this.format(r.result.items); this.list = this.format(r.result.items);
} } else {
else this.list = r.result.items;
{
this.list = r.result.items;
} }
this.search.total = r.result.totalCount || r.result.count; this.search.total = r.result.totalCount || r.result.count;
}); });
...@@ -390,7 +390,11 @@ export default { ...@@ -390,7 +390,11 @@ export default {
this.$emit("on-drag-drop", a, b); this.$emit("on-drag-drop", a, b);
}, },
easySearch() { easySearch() {
if (this.conditions &&this.conditions.keys&& this.conditions.keys.default) { if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询 //判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys; this.conditions.keys.value = this.keys;
} }
...@@ -496,11 +500,13 @@ export default { ...@@ -496,11 +500,13 @@ export default {
if (u.type == "user") { if (u.type == "user") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key; let values = u.key;
return h("User", { if (params.row[values]) {
props: { return h("User", {
value: params.row[values] props: {
} value: params.row[values]
}); }
});
}
}; };
} }
if (u.type == "date" || u.type == "dateTime") { if (u.type == "date" || u.type == "dateTime") {
...@@ -556,7 +562,7 @@ export default { ...@@ -556,7 +562,7 @@ export default {
tr td .ivu-table-cell { tr td .ivu-table-cell {
padding: 0 5px; padding: 0 5px;
} }
overflow-x: hidden; overflow-x: hidden;
} }
.table-tools { .table-tools {
display: flex; display: flex;
......
...@@ -38,7 +38,9 @@ export default { ...@@ -38,7 +38,9 @@ export default {
handonpaged(params) { handonpaged(params) {
return Api.post(`${PlanUrl}/orderexecutehandon/handonpaged`, params); return Api.post(`${PlanUrl}/orderexecutehandon/handonpaged`, params);
}, },
//刷卡交接
handon(params) {
return Api.post(`${PlanUrl}/orderexecutehandon/handon`, params);
},
} }
\ No newline at end of file
...@@ -35,16 +35,16 @@ ...@@ -35,16 +35,16 @@
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="transModal" title="确认转续" width="900"> <Modal v-model="transModal" title="确认转续" width="900">
<div class="zhuanx mt30"> <div class="zhuanx mt30 mb20">
<p class="line_p"> <p class="line_p">
<Input <Input
prefix="ios-contact-outline" prefix="ios-contact"
v-model="userId" v-model="handonCardNo"
placeholder="请输入人员编号" placeholder="请输入接收人员编号"
style="width: auto" style="width: auto"
/> />
</p> </p>
<p class="line_p"> <!--<p class="line_p">
<Input <Input
prefix="ios-lock-outline" prefix="ios-lock-outline"
type="password" type="password"
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
placeholder="请输入人员密码" placeholder="请输入人员密码"
style="width: auto" style="width: auto"
/> />
</p> </p>-->
</div> </div>
<div slot="footer"> <div slot="footer">
<Button @click="transModal = false">取消</Button> <Button @click="transModal = false">取消</Button>
...@@ -160,14 +160,6 @@ export default { ...@@ -160,14 +160,6 @@ export default {
high: true, high: true,
type: "user" type: "user"
}, },
{
key: "actualHandonUser",
title: this.l("actualHandonUser"),
align: "left",
high: true,
type: "user",
hide: true
},
{ {
key: "handonCardNo", key: "handonCardNo",
title: this.l("handonCardNo"), title: this.l("handonCardNo"),
...@@ -190,6 +182,13 @@ export default { ...@@ -190,6 +182,13 @@ export default {
easy: true, easy: true,
high: true high: true
}, },
{
key: "actualHandonUser",
title: this.l("actualHandonUser"),
align: "left",
high: true,
type: "user"
},
{ {
key: "handonTime", key: "handonTime",
title: this.l("handonTime"), title: this.l("handonTime"),
...@@ -217,8 +216,8 @@ export default { ...@@ -217,8 +216,8 @@ export default {
} }
} }
], ],
userId: "", handonCardNo: "",
userPwd: "", userPwd: ""
}; };
}, },
created() { created() {
...@@ -249,12 +248,27 @@ export default { ...@@ -249,12 +248,27 @@ export default {
this.transModal = true; this.transModal = true;
}, },
transOk() { transOk() {
if (!this.handonCardNo || this.handonCardNo.trim == "") {
this.$Message.error("请输入用户编号!");
return;
}
let params = { let params = {
ids: this.arrayIds, ids: this.arrayIds,
user: this.userId, handonCardNo: this.handonCardNo
pwd: this.userPwd
}; };
alert(JSON.stringify(params)); Api.handon(params)
.then(res => {
if (res.success && res.result) {
this.$Message.success("转续成功!");
this.transModal = false;
this.search();
} else {
this.$Message.error("转续失败!");
}
})
.catch(err => {
this.$Message.error("连接失败!");
});
}, },
onSelect(a, b) { onSelect(a, b) {
//批量选择 //批量选择
...@@ -268,13 +282,13 @@ export default { ...@@ -268,13 +282,13 @@ export default {
}, },
//格式化原始数据 //格式化原始数据
formatFun(data) { formatFun(data) {
data.map(e=>{ data.map(e => {
if (e.status != 1) { if (e.status != 1) {
e._disabled = true; e._disabled = true;
} else { } else {
e._disabled = false; e._disabled = false;
} }
}) });
return data; return data;
} }
}, },
......
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