Commit 58bdbaf7 authored by renjintao's avatar renjintao

设备管理(产品)&&设备日历

parent d176f45a
......@@ -16,7 +16,7 @@
</Button>
</ButtonGroup>
</h3>
<div class="tree" >
<div class="tree" :style="{height:divHeight}">
<Tree
ref="tree"
:data="tree"
......@@ -33,7 +33,8 @@ export default {
return {
expand: false,
ids: [],
tree: []
tree: [],
divHeight:''
}
},
props: {
......@@ -45,6 +46,8 @@ export default {
mounted() {},
created() {
this.loadTree()
var theight = window.innerHeight - 180 + 'px'
this.divHeight = theight
},
methods: {
toggle() {
......
<template>
<div class="new-equipment">
<Modal v-model="modalShow" title="设置日历" width="500" :mask-closable="false">
<Form :model="formItem" :label-width="100" style="margin:10px;" :rules="ruleValidate">
<Row >
<Col span="20">
<FormItem label="设备名称" prop="equip_name">
<Input v-model="formItem.equip_name" placeholder="请输入设备名称" readonly></Input>
</FormItem>
</Col>
</Row>
<Row >
<Col span="20" >
<FormItem label="设备编号" prop="equip_id">
<Input v-model="formItem.equip_id" placeholder="请输入设备编号" readonly></Input>
</FormItem>
</Col>
</Row>
<Row >
<Col span="20">
<FormItem label="工作日历" prop="work">
<Select v-model="formItem1.calendarwork_pk" clearable placeholder="请选择...">
<Option v-for="item in cityList" :value="item.id" :key="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row >
<Col span="20" >
<FormItem label="加班日历" prop="overtime">
<Select v-model="formItem2.calendarovertime_pk" clearable placeholder="请选择...">
<Option v-for="item in cityList1" :value="item.id" :key="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<!-- class="footers" -->
<Button @click="close">取消</Button>
<Button @click="saveOk" type="success">保存</Button>
</div>
</Modal>
<Department
:show.sync="showDeptTree"
:value.sync="formItem.shop_id"
:text.sync="formItem.shop_name"
:isAdd="false"
/>
</div>
</template>
<script>
import Department from '@/components/modalTree/department.vue'
import service from '@/plugins/request'
export default {
components: {
Department
},
name: '',
data() {
return {
qcfileparms: 'app=newEquipment&eid=23&name=newEquipment',
modalShow: false,
showDeptTree: false,
saveId:'',
title:'',
editId:0,
data1:[],
cityList:[],
cityList1:[],
imgName: '',
formItem: {
equip_name: '',
equip_id: '',
},
formItem1: {
id:0,
equip_pk:0,
calendarwork_pk:0,
},
formItem2: {
id:0,
equip_pk:0,
calendarovertime_pk:0
},
ruleValidate: {
}
}
},
created() {
this.laodaction();
},
watch: {
imgName(newName, oldName) {
if (newName != '') {
const imgPathsArr = JSON.parse(newName)
this.formItem.equip_pic = imgPathsArr[0].filePath
}
}
},
methods: {
selectDepart() {
this.showDeptTree = true
},
laodaction(){
let parmse ={
pageIndex:0,
cont:0,
conditions: [],
pageSize: 0
}
let url = `${systemUrl}/calendarwork/list`,
that = this;
service.post(`${url}`, parmse).then(res => {
let selectdata = res.data.result;
//console.log(selectdata)
selectdata.forEach(item => {
that.cityList.push({
value: item.title,
label: item.title,
id: item.id,
})
// console.log(that.cityList)
});
});
let url1 = `${systemUrl}/calendarovertime/list`;
service.post(`${url1}`,parmse).then(res => {
let selectdata1 = res.data.result;
console.log(selectdata1)
selectdata1.forEach(item => {
this.cityList1.push({
value: item.title,
label: item.title,
id: item.id,
})
// console.log(that.cityList)
});
});
},
preservation() {},
close() {
this.modalShow = false
},
// 添加/编辑 弹框的保存
saveOk() {
var url = `${systemUrl}/equipcalendarwork/createorupdate`
console.log(this.formItem1)
console.log(this.formItem2)
console.log(this.editId)
service.post(`${url}`, JSON.stringify({ equipCalendarWork: this.formItem1,equipCalendarOverTime: this.formItem2 }))
.then((res) => {
if (res.data.success) {
this.$Message.success('保存成功')
this.$emit('getMessage');
this.modalShow = false
}
})
},
}
}
</script>
<style lang="less" scoped>
.footers {
margin-right: -60px;
}
</style>
\ No newline at end of file
<template>
<div class="tree-type">
<h3 class="zh-title">产品结构</h3>
<div class="zh-box">
<Input placeholder="输入内容" style="width: auto">
<Icon type="ios-search" slot="prefix" />
</Input>
<Tree :data="treeData" class="tree-content"></Tree>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
treeData: [
{
title: '工厂',
expand: true,
children: [
{
title: '生产处1',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
},
{
title: '生产处2',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
},
{
title: '生产处3',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
}
]
}
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="less" scoped>
.tree-content{
margin-top: 15px;
}
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div class="tree-type">
<h3 class="zh-title">产品结构</h3>
<div class="zh-box">
<Input placeholder="输入内容" style="width: auto">
<Icon type="ios-search" slot="prefix" />
</Input>
<Tree :data="treeData" class="tree-content"></Tree>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
treeData: [
{
title: '工厂',
expand: true,
children: [
{
title: '生产处1',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
},
{
title: '生产处2',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
},
{
title: '生产处3',
expand: true,
children: [
{
title: '车间1'
},
{
title: '车间2'
},
{
title: '车间3'
}
]
}
]
}
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="less" scoped>
.tree-content{
margin-top: 15px;
}
</style>
\ No newline at end of file
This diff is collapsed.
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