Commit fbecf61c authored by renjintao's avatar renjintao

datagrid

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