Commit a37bc868 authored by renjintao's avatar renjintao

setProcess... scroll

parent ca704af5
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
this.laodaction() this.laodaction()
this.laodactiontype() this.laodactiontype()
this.tbHeight = window.innerHeight - 220 this.tbHeight = window.innerHeight - 220
this.treeHeight = window.innerHeight - 150 this.treeHeight = window.innerHeight - 140
}, },
methods: { methods: {
......
...@@ -408,7 +408,7 @@ export default { ...@@ -408,7 +408,7 @@ export default {
} }
}, },
created() { created() {
this.treeHeight = window.innerHeight - 150 this.treeHeight = window.innerHeight - 140
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230
this.loaddata() this.loaddata()
this.getapprovalStatusdata() this.getapprovalStatusdata()
...@@ -421,7 +421,7 @@ export default { ...@@ -421,7 +421,7 @@ export default {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
this.treeHeight = window.innerHeight - 150 this.treeHeight = window.innerHeight - 140
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230
})() })()
} }
......
...@@ -630,7 +630,7 @@ export default { ...@@ -630,7 +630,7 @@ export default {
} }
}, },
created() { created() {
this.treeHeight = window.innerHeight - 150 this.treeHeight = window.innerHeight - 140
this.tableHeight = window.innerHeight - 230 this.tableHeight = window.innerHeight - 230
this.newColumn = this.historycolumn this.newColumn = this.historycolumn
this.column = this.newColumn this.column = this.newColumn
...@@ -645,7 +645,7 @@ export default { ...@@ -645,7 +645,7 @@ export default {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight
this.treeHeight = window.screenHeight - 150 this.treeHeight = window.screenHeight - 140
this.tableHeight = window.screenHeight - 230 this.tableHeight = window.screenHeight - 230
})() })()
} }
......
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger :style="{background: '#fff'}" class="menu" width="240" style=" flex:0;"> <Sider hide-trigger :style="{background: '#fff'}" class="menu" width="240" style=" flex:0;">
<StoreHouseLeft @storeIds="storeIds" :type='4'></StoreHouseLeft> <StoreHouseLeft @storeIds="storeIds" :type="4"></StoreHouseLeft>
</Sider> </Sider>
<Content class="content manyTabs"> <Content class="content manyTabs">
<Tabs :animated="false" @on-click="tab"> <Tabs :animated="false" @on-click="tab">
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
ref="grid" ref="grid"
:action="action" :action="action"
style="margin-top: 45px;" style="margin-top: 45px;"
:height="tdHeight"
:conditions="easySearch" :conditions="easySearch"
> >
<template slot="searchForm"> <template slot="searchForm">
...@@ -56,23 +57,23 @@ ...@@ -56,23 +57,23 @@
</Layout> </Layout>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Add from './add' import Add from "./add";
import Edit from './edit' import Edit from "./edit";
import Detail from './detail' import Detail from "./detail";
import Search from './search' import Search from "./search";
import Cart from './cart' import Cart from "./cart";
import Return from './return' import Return from "./return";
import Log from './log' import Log from "./log";
import StoreHouseLeft from '@/components/modalTree/StoreHouseLeft.vue' import StoreHouseLeft from "@/components/modalTree/StoreHouseLeft.vue";
const root = { const root = {
id: 0, id: 0,
typeId: -1, typeId: -1,
title: '顶级节点', title: "顶级节点",
code: '' code: ""
} };
export default { export default {
name: 'list', name: "list",
components: { components: {
Add, Add,
Edit, Edit,
...@@ -96,229 +97,230 @@ export default { ...@@ -96,229 +97,230 @@ export default {
cartModel: false, //借出车 cartModel: false, //借出车
returnModel: false, //归还车 returnModel: false, //归还车
logModel: false, //查看日志 logModel: false, //查看日志
tdHeight: "",
curId: 0, curId: 0,
easySearch: { easySearch: {
keys: { op: 'nameOfResource,resourceId', value: '', default: true }, keys: { op: "nameOfResource,resourceId", value: "", default: true },
storeId: { op: 'In', value: '' } storeId: { op: "In", value: "" }
}, },
columns: [ columns: [
{ {
key: 'id', key: "id",
title: this.l('id'), title: this.l("id"),
hide: true, hide: true,
align: 'left', align: "left",
sortable: true sortable: true
}, },
{ {
key: 'creationTime', key: "creationTime",
title: this.l('creationTime'), title: this.l("creationTime"),
sortable: true, sortable: true,
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'creatorUserId', key: "creatorUserId",
title: this.l('creatorUserId'), title: this.l("creatorUserId"),
hide: false, hide: false,
type: 'user', type: "user",
align: 'left', align: "left",
width: 120, width: 120
}, },
{ {
key: 'lastModificationTime', key: "lastModificationTime",
title: this.l('lastModificationTime'), title: this.l("lastModificationTime"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'lastModifierUserId', key: "lastModifierUserId",
title: this.l('lastModifierUserId'), title: this.l("lastModifierUserId"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'isDeleted', key: "isDeleted",
title: this.l('isDeleted'), title: this.l("isDeleted"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'deletionTime', key: "deletionTime",
title: this.l('deletionTime'), title: this.l("deletionTime"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'deleterUserId', key: "deleterUserId",
title: this.l('deleterUserId'), title: this.l("deleterUserId"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'ico', key: "ico",
title: ' ', title: " ",
align: 'center', align: "center",
easy: true, easy: true,
high: true, high: true,
width: 60, width: 60,
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h('op', { h("op", {
attrs: { attrs: {
icon: 'ios-cart-outline', icon: "ios-cart-outline",
type: 'icon' type: "icon"
}, },
on: { click: () => this.addCart(params.row) } on: { click: () => this.addCart(params.row) }
}) })
]) ]);
} }
}, },
{ {
key: 'resourceId', key: "resourceId",
title: this.l('resourceId'), title: this.l("resourceId"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
width: 180, width: 180,
render: (h, params) => { render: (h, params) => {
return h( return h(
'a', "a",
{ {
props: {}, props: {},
style: {}, style: {},
on: { click: () => this.detail(params.row.id) } on: { click: () => this.detail(params.row.id) }
}, },
params.row.resourceId params.row.resourceId
) );
} }
}, },
{ {
key: 'nameOfResource', key: "nameOfResource",
title: this.l('nameOfResource'), title: this.l("nameOfResource"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
tooltip: true, tooltip: true,
width: 150 width: 150
}, },
{ {
key: 'specifications', key: "specifications",
title: this.l('specifications'), title: this.l("specifications"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'totalNum', key: "totalNum",
title: this.l('totalNum'), title: this.l("totalNum"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
width: 100, width: 100
}, },
{ {
key: 'numberAvailable', key: "numberAvailable",
title: this.l('numberAvailable'), title: this.l("numberAvailable"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
width: 100, width: 100
}, },
{ {
key: 'measuringUnit', key: "measuringUnit",
title: this.l('measuringUnit'), title: this.l("measuringUnit"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'qualityCharacteristics', key: "qualityCharacteristics",
title: this.l('qualityCharacteristics'), title: this.l("qualityCharacteristics"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'batchNo', key: "batchNo",
title: this.l('batchNo'), title: this.l("batchNo"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'storeId', key: "storeId",
title: this.l('storeId'), title: this.l("storeId"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'storeTitle', key: "storeTitle",
title: this.l('storeTitle'), title: this.l("storeTitle"),
align: 'left', align: "left",
high: true, high: true,
hide: true hide: true
}, },
{ {
key: 'state', key: "state",
title: this.l('state'), title: this.l("state"),
align: 'left', align: "left",
high: true, high: true,
code: 'mes_xingchi_resource.resource.state', code: "mes_xingchi_resource.resource.state",
hide: true hide: true
}, },
{ {
key: 'resourceType', key: "resourceType",
title: this.l('resourceType'), title: this.l("resourceType"),
align: 'left', align: "left",
high: true, high: true,
code: 'mes_xingchi_resource.resource.resource_type' code: "mes_xingchi_resource.resource.resource_type"
}, },
{ {
title: '操作', title: "操作",
width: 190, width: 190,
align: 'center', align: "center",
hide: false, hide: false,
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row.id) }
}, },
'修改' "修改"
), ),
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'delete' oprate: "delete"
}, },
class: class:
params.row.totalNum === params.row.numberAvailable params.row.totalNum === params.row.numberAvailable
? 'remove' ? "remove"
: 'disable', : "disable",
on: { click: () => this.remove(params.row) } on: { click: () => this.remove(params.row) }
}, },
'删除' "删除"
), ),
h( h(
'op', "op",
{ {
attrs: { attrs: {
oprate: 'detail' oprate: "detail"
}, },
on: { click: () => this.logDetail(params.row.id) } on: { click: () => this.logDetail(params.row.id) }
}, },
'查看日志' "查看日志"
) )
]) ]);
} }
} }
], ],
...@@ -326,132 +328,142 @@ export default { ...@@ -326,132 +328,142 @@ export default {
cartListCount: 0, cartListCount: 0,
tabIndex: 1, tabIndex: 1,
ids: [] ids: []
} };
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeight = window.screenHeight - 250;
})();
};
},
created() {
this.tdHeight = window.innerHeight - 250;
}, },
mounted() {},
created() {},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
//选项卡切换 //选项卡切换
tab(data) { tab(data) {
this.tabIndex = data + 1 this.tabIndex = data + 1;
// this.search(this.searchForm) // this.search(this.searchForm)
}, },
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.cartModel = false this.cartModel = false;
this.returnModel = false this.returnModel = false;
this.logModel = false this.logModel = false;
this.curId = 0 this.curId = 0;
}, },
cartOk() { cartOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.cartList = [] this.cartList = [];
this.cartModel = false this.cartModel = false;
this.curId = 0 this.curId = 0;
}, },
detail(id) { detail(id) {
this.detailModal = true this.detailModal = true;
this.curId = id this.curId = id;
}, },
edit(id) { edit(id) {
this.editModal = true this.editModal = true;
this.curId = id this.curId = id;
}, },
logDetail(id) { logDetail(id) {
this.logModel = true this.logModel = true;
this.curId = id this.curId = id;
}, },
remove(row) { remove(row) {
if (row.totalNum != row.numberAvailable) { if (row.totalNum != row.numberAvailable) {
this.$Message.error('资源有接触不能删除') this.$Message.error("资源有接触不能删除");
} else { } else {
this.deletelModal = true this.deletelModal = true;
this.curId = row.id this.curId = row.id;
} }
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({ id: this.curId }).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load() this.$refs.grid.load();
this.deletelModal = false this.deletelModal = false;
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
removeCancel() { removeCancel() {
this.deletelModal = false this.deletelModal = false;
}, },
cancel() { cancel() {
this.curId = 0 this.curId = 0;
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.deletedlModal = false this.deletedlModal = false;
this.cartModel = false this.cartModel = false;
this.returnModel = false this.returnModel = false;
this.logModel = false this.logModel = false;
}, },
l(key) { l(key) {
let vkey = 'resource' + '.' + key let vkey = "resource" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
}, },
storeIds(val) { storeIds(val) {
this.easySearch.storeId.value = val this.easySearch.storeId.value = val;
this.$refs.grid.easySearch() this.$refs.grid.easySearch();
}, },
showCart() { showCart() {
if (this.$store.state.count > 0) { if (this.$store.state.count > 0) {
this.cartModel = true this.cartModel = true;
} else { } else {
this.$Message.error('请将资源加入借出车') this.$Message.error("请将资源加入借出车");
} }
}, },
//加入借出车 //加入借出车
addCart(arr) { addCart(arr) {
let id = arr.id let id = arr.id;
this.cartListCount = this.$store.state.count this.cartListCount = this.$store.state.count;
this.cartList = this.$store.state.cart this.cartList = this.$store.state.cart;
if (arr.numberAvailable > 0) { if (arr.numberAvailable > 0) {
const index = this.$store.state.cart.findIndex(function(item) { const index = this.$store.state.cart.findIndex(function(item) {
return item.id === id return item.id === id;
}) });
if (index == -1) { if (index == -1) {
arr.numberAvailable1 = arr.numberAvailable //用于最大借出数量 arr.numberAvailable1 = arr.numberAvailable; //用于最大借出数量
this.cartList.push(arr) this.cartList.push(arr);
this.cartListCount += 1 this.cartListCount += 1;
this.$store.commit('setCart', this.cartList) this.$store.commit("setCart", this.cartList);
this.$store.commit('setCartCount', this.cartListCount) this.$store.commit("setCartCount", this.cartListCount);
this.$Message.success('加入借出车成功') this.$Message.success("加入借出车成功");
} else { } else {
this.$Message.error('已加入借出车') this.$Message.error("已加入借出车");
} }
} else { } else {
this.$Message.error('资源无库存') this.$Message.error("资源无库存");
} }
}, },
//移除借出车 //移除借出车
substr(value, index) { substr(value, index) {
if (index > -1) { if (index > -1) {
this.cartListCount -= value this.cartListCount -= value;
this.cartList.splice(index, 1) this.cartList.splice(index, 1);
this.$store.commit('setCart', this.cartList) this.$store.commit("setCart", this.cartList);
this.$store.commit('setCartCount', this.cartListCount) this.$store.commit("setCartCount", this.cartListCount);
} else { } else {
this.cartListCount = 0 this.cartListCount = 0;
this.cartList = [] this.cartList = [];
this.$store.commit('setCart', this.cartList) this.$store.commit("setCart", this.cartList);
this.$store.commit('setCartCount', this.cartListCount) this.$store.commit("setCartCount", this.cartListCount);
} }
} }
}, },
computed: {} computed: {}
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.full { .full {
......
...@@ -696,8 +696,8 @@ export default { ...@@ -696,8 +696,8 @@ export default {
}, },
created() { created() {
this.laodaction() this.laodaction()
this.treeHeight = window.innerHeight this.treeHeight = window.innerHeight-140
this.tbHeight = window.innerHeight - 175 this.tbHeight = window.innerHeight - 230
}, },
mounted() { mounted() {
this.initTree() this.initTree()
......
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