Commit ea9d2d99 authored by 康振飞's avatar 康振飞

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product

parents 83ec8ae3 c99d2402
......@@ -924,14 +924,14 @@ export default {
demandStartDate: '投料时间',
demandFinishDate: '节点时间',
//tempTitle------
stage:'阶段',
materialId:'材料',
routing_Method:'工艺方法',
outer_Envelope_Size:'外包络尺寸',
guestName:'甲方客户',
taskCode:'甲方任务号',
putintDocmentCode:'甲方投产输入文件(编号)',
technologyDocmentCode:'甲方技术输入文件(编号)',
stage: '阶段',
materialId: '材料',
routing_Method: '工艺方法',
outer_Envelope_Size: '外包络尺寸',
guestName: '甲方客户',
taskCode: '甲方任务号',
putintDocmentCode: '甲方投产输入文件(编号)',
technologyDocmentCode: '甲方技术输入文件(编号)',
},
mes_part_task_plan_simulate: {
id: '',
......@@ -1259,5 +1259,21 @@ export default {
productionRequirement: '生产要求',
standard: '标准指标',
qualityTemplateName: '模板文件名称',
},
plan_resource: {
id: '',
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
title: '资源名称',
code: '资源编号',
type: '资源类型',
property: '属性',
departId: '部门id',
departTitle: '部门',
}
}
......@@ -16,9 +16,9 @@
</Row>
<Row :gutter="16">
<Col span="11">
<FormItem label="设备类型" prop="equip_type">
<FormItem label="设备类型" prop="equip_type">
<Select v-model="formItem.equip_type" multiple placeholder="请选择...">
<Option v-for="item in cityList" :value="item.id" :key="item.value">{{ item.label }}</Option>
<Option v-for="item in cityList" :value="item.id" :key="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
</Col>
......@@ -33,15 +33,11 @@
</Row>
<Row :gutter="16">
<Col span="11">
<FormItem label="所属部门" prop="shop_name">
<Input
v-model="formItem.shop_name"
readonly
placeholder="请选择..."
style="width:327px" >
<Button slot="append" @click="selectDepart">选择</Button>
</Input>
</FormItem>
<FormItem label="所属部门" prop="shop_name">
<Input v-model="formItem.shop_name" readonly placeholder="请选择..." style="width:327px">
<Button slot="append" @click="selectDepart">选择</Button>
</Input>
</FormItem>
</Col>
<Col span="11" offset="1">
<FormItem label="设备IP" prop="equip_ip">
......@@ -50,33 +46,45 @@
</Col>
</Row>
<Row :gutter="16">
<Col span="11">
<Col span="12">
<FormItem label="设备图片">
<!-- <Upload multiple type="drag" action="//jsonplaceholder.typicode.com/posts/">
<span>上传图片</span>
<Icon type="ios-cloud-upload" size="30" style="color: #3399ff"></Icon>
</Upload> -->
</Upload>-->
<inputFile ref="refqcFile" v-model="imgName" :parms="qcfileparms" files />
</FormItem>
</Col>
<Col span="11" offset="1">
<FormItem label="是否关重" prop="isimportant">
<Select v-model="isimportant">
<Option :value="1" ></Option>
<Option :value="2" ></Option>
<Option :value="1"></Option>
<Option :value="2"></Option>
</Select>
</FormItem>
</Col>
</Row>
<Row :gutter="16">
<Row :gutter="16">
<Col span="11">
<FormItem label="能力系数">
<InputNumber :min="0" v-model="formItem.capability_value" size="large" style="width:240px"></InputNumber>
<InputNumber
:min="0"
v-model="formItem.capability_value"
size="large"
style="width:240px"
></InputNumber>
</FormItem>
</Col>
<Col span="11" offset="1">
<FormItem label="位置" prop="location">
<Input v-model="formItem.location" placeholder="请输入位置"></Input>
<Input v-model="formItem.location" placeholder="请输入位置"></Input>
</FormItem>
</Col>
</Row>
<Row :gutter="16">
<Col :span="12">
<FormItem label="属性">
<Checkbox v-model="property">排产资源</Checkbox>
</FormItem>
</Col>
</Row>
......@@ -88,189 +96,203 @@
</div>
</Modal>
<Department
:show.sync="showDeptTree"
:value.sync="formItem.shop_id"
:text.sync="formItem.shop_name"
:isAdd="false"
/>
: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'
import Department from "@/components/modalTree/department.vue";
import service from "@/plugins/request";
export default {
components: {
Department
},
name: '',
components: {
Department
},
name: "",
data() {
return {
qcfileparms: 'app=newEquipment&eid=23&name=newEquipment',
qcfileparms: "app=newEquipment&eid=23&name=newEquipment",
modalShow: false,
showDeptTree: false,
saveId:'',
title:'',
editId:'',
data1:[],
cityList:[],
imgName: '',
showDeptTree: false,
saveId: "",
title: "",
editId: "",
data1: [],
cityList: [],
imgName: "",
formItem: {
equip_name: '',
equip_id: '',
equip_type: [],
equip_pic: '',
equip_status: '',
equip_ip: '',
shop_id: '',
shop_name: '',
isimportant:2,
location:'',
capability_value:1,
equip_name: "",
equip_id: "",
equip_type: [],
equip_pic: "",
equip_status: "",
equip_ip: "",
shop_id: "",
shop_name: "",
isimportant: 2,
location: "",
capability_value: 1
},
isimportant:2,
property: true,
isimportant: 2,
ruleValidate: {
equip_id: [
{
required: true,
message: '设备编号不能为空!',
trigger: 'blur'
message: "设备编号不能为空!",
trigger: "blur"
}
],
shop_name: [
{
required: true,
message: '所属部门不能为空!',
trigger: 'blur'
message: "所属部门不能为空!",
trigger: "blur"
}
]
}
}
};
},
created() {
created() {
this.laodaction();
},
watch: {
watch: {
imgName(newName, oldName) {
if (newName != '') {
const imgPathsArr = JSON.parse(newName)
this.formItem.equip_pic = imgPathsArr[0].filePath
if (newName != "") {
const imgPathsArr = JSON.parse(newName);
this.formItem.equip_pic = imgPathsArr[0].filePath;
}
}
},
methods: {
selectDepart() {
this.showDeptTree = true
},
laodaction(){
let url = `${systemUrl}/equiptype/getpaged`,
that = this;
service.get(`${url}`, ).then(res => {
let selectdata = res.result.items;
// console.log(selectdata)
selectdata.forEach(item => {
that.cityList.push({
value: item.equip_type_name,
label: item.equip_type_name,
id: item.id,
})
// console.log(that.cityList)
});
});
},
selectDepart() {
this.showDeptTree = true;
},
laodaction() {
let url = `${systemUrl}/equiptype/getpaged`,
that = this;
service.get(`${url}`).then(res => {
let selectdata = res.result.items;
// console.log(selectdata)
selectdata.forEach(item => {
that.cityList.push({
value: item.equip_type_name,
label: item.equip_type_name,
id: item.id
});
// console.log(that.cityList)
});
});
},
preservation() {},
close() {
this.modalShow = false
this.modalShow = false;
},
// 添加/编辑 弹框的保存
saveOk(){
if (!this.formItem.equip_id) {
this.$Message.error('设备编号不能为空!')
return
}
if (!this.formItem.shop_name) {
this.$Message.error('所属部门不能为空!')
return
}
let saveId = this.editId,
url = `${systemUrl}/equipinfo/createorupdate`;
// console.log(saveId);
if(!saveId){ saveId == "" }
if(this.title == '编辑设备'){
//this.$Message.success(saveId);
// if(this.formItem.selectName){
let arr=this.formItem.equip_type;
let str=arr.join(',');
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar1 = this.data1.find((val) => {
if(val.id!=saveId)
return val.equip_id == this.formItem.equip_id
})
if (ar1) {
this.$Message.error('设备编号已存在!');
return
}
let paramsdata = {
"id": saveId,
"equip_id": this.formItem.equip_id,
"equip_name": this.formItem.equip_name,
"equip_status": this.formItem.equip_status,
"equip_pic": this.formItem.equip_pic,
"equip_ip": this.formItem.equip_ip,
"shop_id": this.formItem.shop_id,
"eqstyle": str,
"isimportant":this.isimportant,
"location":this.formItem.location,
"capability_value":this.formItem.capability_value,
};
// console.log(paramsdata);
service.post(`${url}`, {equipInfo: paramsdata}).then(res=>{
if(res.success) {
this.$emit('getMessage');
this.modalShow=false;
this.$Message.success('编辑成功');
}
});
// }
}
if(this.title == '新增设备'){
let arr=this.formItem.equip_type;
let str=arr.join(',');
//console.log(str);
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar = this.data1.find((val) => {
return val.equip_id == this.formItem.equip_id
})
if (ar ) {
this.$Message.error('设备编号已存在!');
return
}
let paramsdata = {
"id": this.saveId,
"equip_id": this.formItem.equip_id,
"equip_name": this.formItem.equip_name,
"equip_status": this.formItem.equip_status,
"equip_pic": this.formItem.equip_pic,
"equip_ip": this.formItem.equip_ip,
"shop_id": this.formItem.shop_id,
"eqstyle": str,
"isimportant":this.isimportant,
"location":this.formItem.location,
"capability_value":this.formItem.capability_value,
// 添加/编辑 弹框的保存
saveOk() {
if (!this.formItem.equip_id) {
this.$Message.error("设备编号不能为空!");
return;
}
if (!this.formItem.shop_name) {
this.$Message.error("所属部门不能为空!");
return;
}
let saveId = this.editId,
url = `${systemUrl}/equipinfo/createorupdate`;
// console.log(saveId);
if (!saveId) {
saveId == "";
}
if (this.title == "编辑设备") {
//this.$Message.success(saveId);
// if(this.formItem.selectName){
let arr = this.formItem.equip_type;
let str = arr.join(",");
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar1 = this.data1.find(val => {
if (val.id != saveId) return val.equip_id == this.formItem.equip_id;
});
if (ar1) {
this.$Message.error("设备编号已存在!");
return;
}
if (this.property == true) {
this.property = 2;
} else {
this.property = "";
}
let paramsdata = {
id: saveId,
equip_id: this.formItem.equip_id,
equip_name: this.formItem.equip_name,
equip_status: this.formItem.equip_status,
equip_pic: this.formItem.equip_pic,
equip_ip: this.formItem.equip_ip,
shop_id: this.formItem.shop_id,
eqstyle: str,
isimportant: this.isimportant,
location: this.formItem.location,
capability_value: this.formItem.capability_value,
property: this.property
};
// console.log(paramsdata);
service.post(`${url}`, { equipInfo: paramsdata }).then(res => {
if (res.success) {
this.$emit("getMessage");
this.modalShow = false;
this.$Message.success("编辑成功");
}
});
// }
}
if (this.title == "新增设备") {
let arr = this.formItem.equip_type;
let str = arr.join(",");
//console.log(str);
let url = `${systemUrl}/equipinfo/createorupdate`;
var ar = this.data1.find(val => {
return val.equip_id == this.formItem.equip_id;
});
if (ar) {
this.$Message.error("设备编号已存在!");
return;
}
};
//console.log(this.formItem.equip_type);
service.post(`${url}`, {equipInfo: paramsdata}).then(res=>{
if(res.success) {
this.$emit('getMessage');
this.modalShow=false;
this.$Message.success('新增成功')
}
});
}
},
if (this.property == true) {
this.property = 2;
} else {
this.property = "";
}
let paramsdata = {
id: this.saveId,
equip_id: this.formItem.equip_id,
equip_name: this.formItem.equip_name,
equip_status: this.formItem.equip_status,
equip_pic: this.formItem.equip_pic,
equip_ip: this.formItem.equip_ip,
shop_id: this.formItem.shop_id,
eqstyle: str,
isimportant: this.isimportant,
location: this.formItem.location,
capability_value: this.formItem.capability_value,
property: this.property
};
//console.log(this.formItem.equip_type);
service.post(`${url}`, { equipInfo: paramsdata }).then(res => {
if (res.success) {
this.$emit("getMessage");
this.modalShow = false;
this.$Message.success("新增成功");
}
});
}
}
}
}
};
</script>
<style lang="less" scoped>
......
......@@ -19,7 +19,7 @@
clearable
style="width:235px;flaot:left;"
/>
<Button type="primary" class="" @click="easySearch">查询</Button>
<Button type="primary" class @click="easySearch">查询</Button>
<!-- <Button @click="advancedSearch" type="success" style="margin-left:8px;">高级搜索</Button> -->
</Col>
<Col span="12" style=" text-align: right;">
......@@ -371,106 +371,106 @@
ok-text="确定"
cancel-text="取消"
@on-ok="deleOk"
>此操作将永久删除该数据, 是否继续?</Modal> -->
>此操作将永久删除该数据, 是否继续?</Modal>-->
</div>
</template>
<script>
import TreeType from './components/treeType.vue' //左侧树列表
import NewEquipment from './components/newEquipment.vue' //新增设备弹框
import service from '@/plugins/request'
import TreeType from "./components/treeType.vue"; //左侧树列表
import NewEquipment from "./components/newEquipment.vue"; //新增设备弹框
import service from "@/plugins/request";
export default {
components: {
TreeType,
NewEquipment
},
name: '',
name: "",
data() {
return {
downUrl: fileUrlDown,
fileUrlPath: '',
ruleValidate:{},
tbHeight: '',
fileUrlPath: "",
ruleValidate: {},
tbHeight: "",
total: 0,
page: 1,
pageSize: 10,
shopid: '',
shopid: "",
treeData: [],
treeHeight: '',
treeInputSearch: '',
treeHeight: "",
treeInputSearch: "",
loading: false,
seleId: 0,
eid: '',
eid1: '',
ptimes: '',
ptimee: '',
atimes: '',
atimee: '',
inputtime: '',
mainstatus: '',
failurenotes: '',
etype: '',
eqid: '',
eqname: '',
borw: '',
eid: "",
eid1: "",
ptimes: "",
ptimee: "",
atimes: "",
atimee: "",
inputtime: "",
mainstatus: "",
failurenotes: "",
etype: "",
eqid: "",
eqname: "",
borw: "",
show: false,
show2: false,
show3: false,
show4: false,
show5: false,
show6: false,
title: '新增设备',
title1: '设备维修',
title2: '设备保养',
editId: '',
title: "新增设备",
title1: "设备维修",
title2: "设备保养",
editId: "",
typepk: [],
value1: '',
value1: "",
formItemMain: {
equip_name: '',
equip_pk: '',
equip_down_type: '',
plan_start: '',
plan_finish: '',
input_time: '',
notes: ''
equip_name: "",
equip_pk: "",
equip_down_type: "",
plan_start: "",
plan_finish: "",
input_time: "",
notes: ""
},
formItemMain1: {
equip_name: '',
equip_pk: '',
equip_down_type: '',
plan_start: '',
plan_finish: '',
actual_start: '',
actual_finish: '',
failure_notes: '',
status: ''
equip_name: "",
equip_pk: "",
equip_down_type: "",
plan_start: "",
plan_finish: "",
actual_start: "",
actual_finish: "",
failure_notes: "",
status: ""
},
sysdata: [
{
value: '月度保养',
label: '月度保养'
value: "月度保养",
label: "月度保养"
},
{
value: '季度保养',
label: '季度保养'
value: "季度保养",
label: "季度保养"
},
{
value: '精度检查',
label: '精度检查'
value: "精度检查",
label: "精度检查"
},
{
value: '常规保养',
label: '常规保养'
value: "常规保养",
label: "常规保养"
}
],
sysdata1: [
{
value: '维护中',
label: '维护中'
value: "维护中",
label: "维护中"
},
{
value: '完成',
label: '维护完成'
value: "完成",
label: "维护完成"
}
],
column: [
......@@ -480,82 +480,82 @@ export default {
// align: 'center'
// },
{
type: 'index',
type: "index",
width: 60,
align: 'center'
align: "center"
},
{
title: '设备名称',
key: 'equip_name'
title: "设备名称",
key: "equip_name"
},
{
title: '设备编号',
key: 'equip_id'
title: "设备编号",
key: "equip_id"
},
{
title: '设备类型',
key: 'type_name'
title: "设备类型",
key: "type_name"
},
{
title: '设备图片',
key: 'equip_pic',
title: "设备图片",
key: "equip_pic",
render: (h, params) => {
return h('div', { class: 'action' }, [
return h("div", { class: "action" }, [
h(
'a',
"a",
{
attrs: {
oprate: 'detail',
oprate: "detail",
href: this.fileUrlPath,
target: '_blank'
target: "_blank"
},
on: {
click: () => {
this.downFile(params)
this.downFile(params);
}
}
},
'查看图片'
),
])
"查看图片"
)
]);
}
},
{
title: '设备状态',
key: 'equip_status'
title: "设备状态",
key: "equip_status"
},
{
title: '设备IP',
key: 'equip_ip'
title: "设备IP",
key: "equip_ip"
},
{
title: '所属部门',
key: 'shop_name'
title: "所属部门",
key: "shop_name"
},
{
title: '是否关重',
key: 'isimportant',
render: (h,params) => {
let statuse = params.row.isimportant
let text = statuse == 1 ? '是' : (statuse==2? '否':'')
return h('span',{},text)
title: "是否关重",
key: "isimportant",
render: (h, params) => {
let statuse = params.row.isimportant;
let text = statuse == 1 ? "是" : statuse == 2 ? "否" : "";
return h("span", {}, text);
}
},
{
title: '位置',
key: 'location'
title: "位置",
key: "location"
},
{
title: '能力系数',
key: 'capability_value'
title: "能力系数",
key: "capability_value"
},
{
title: '操作',
key: 'action',
align: 'center',
title: "操作",
key: "action",
align: "center",
width: 280,
render: (h, params) => {
return h('div', { class: 'action' },[
return h("div", { class: "action" }, [
// h(
// 'op',
// {
......@@ -569,66 +569,66 @@ export default {
// '查看'
// ),
h(
'op',
"op",
{
attrs:{
oprate:'detail',
class:'edit'
attrs: {
oprate: "detail",
class: "edit"
},
on: {
click: () => {
this.edit(params)
this.edit(params);
}
}
},
'编辑'
"编辑"
),
h(
'op',
"op",
{
attrs:{
oprate:'delete'
attrs: {
oprate: "delete"
},
style: {
color: 'red',
color: "red"
},
on: {
click: () => {
this.del(params)
this.del(params);
}
}
},
'删除'
"删除"
),
h(
'op',
"op",
{
attrs:{
oprate:'detail'
attrs: {
oprate: "detail"
},
on: {
click: () => {
this.Main(params)
this.Main(params);
}
}
},
'保养'
"保养"
),
h(
'op',
"op",
{
attrs:{
oprate:'detail'
attrs: {
oprate: "detail"
},
on: {
click: () => {
this.Main1(params)
this.Main1(params);
}
}
},
'维修'
"维修"
)
])
]);
}
}
],
......@@ -639,85 +639,85 @@ export default {
// align: 'center'
// },
{
title: '维护状态',
key: 'status'
title: "维护状态",
key: "status"
},
{
title: '计划人',
key: 'input_name'
title: "计划人",
key: "input_name"
},
{
title: '报修时间',
key: 'input_time'
title: "报修时间",
key: "input_time"
},
{
title: '保养人',
key: 'maintain_name'
title: "保养人",
key: "maintain_name"
},
{
title: '计划开始时间',
key: 'plan_start'
title: "计划开始时间",
key: "plan_start"
},
{
title: '计划完成时间',
key: 'plan_finish'
title: "计划完成时间",
key: "plan_finish"
},
{
title: '实际开始时间',
key: 'actual_start'
title: "实际开始时间",
key: "actual_start"
},
{
title: '实际结束时间',
key: 'actual_finish'
title: "实际结束时间",
key: "actual_finish"
},
{
title: '维保类型',
key: 'equip_down_type'
title: "维保类型",
key: "equip_down_type"
}
],
datatable1: [],
datatable: [
{
name: '3D打印机',
name1: 'EOS M290',
name2: 'New York No. 1 Lake Park',
name3: '2016-10-03',
name4: '正常',
name5: '102.10.0.80',
name6: '车间1',
name7: ''
name: "3D打印机",
name1: "EOS M290",
name2: "New York No. 1 Lake Park",
name3: "2016-10-03",
name4: "正常",
name5: "102.10.0.80",
name6: "车间1",
name7: ""
},
{
name: '3D打印机',
name1: 'EOS M290',
name2: 'New York No. 1 Lake Park',
name3: '2016-10-03',
name4: '正常',
name5: '102.10.0.80',
name6: '车间1',
name7: ''
name: "3D打印机",
name1: "EOS M290",
name2: "New York No. 1 Lake Park",
name3: "2016-10-03",
name4: "正常",
name5: "102.10.0.80",
name6: "车间1",
name7: ""
},
{
name: '3D打印机',
name1: 'EOS M290',
name2: 'New York No. 1 Lake Park',
name3: '2016-10-03',
name4: '正常',
name5: '102.10.0.80',
name6: '车间1',
name7: ''
name: "3D打印机",
name1: "EOS M290",
name2: "New York No. 1 Lake Park",
name3: "2016-10-03",
name4: "正常",
name5: "102.10.0.80",
name6: "车间1",
name7: ""
}
],
page: 1 //当前页 整形 选填 默认1
}
};
},
created() {
this.laodaction()
this.treeHeight = window.innerHeight-140
this.tbHeight = window.innerHeight - 250
this.laodaction();
this.treeHeight = window.innerHeight - 140;
this.tbHeight = window.innerHeight - 250;
},
mounted() {
this.initTree()
this.initTree();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
......@@ -729,60 +729,60 @@ export default {
},
methods: {
initTree() {
this.$http.department.getDepartmentTree(this.treeData)
this.$http.department.getDepartmentTree(this.treeData);
},
//搜索查询
easySearch() {
this.page = 1
this.pageSize = 10
this.laodaction()
this.page = 1;
this.pageSize = 10;
this.laodaction();
},
handleChange(date) {
this.formItemMain.plan_start = date
this.formItemMain.plan_start = date;
},
handleChange1(date) {
this.formItemMain.plan_finish = date
this.formItemMain.plan_finish = date;
},
handleChange2(date) {
this.formItemMain.input_time = date
this.formItemMain.input_time = date;
},
handleChange3(date) {
this.formItemMain1.plan_start = date
this.formItemMain1.plan_start = date;
},
handleChange4(date) {
this.formItemMain1.plan_finish = date
this.formItemMain1.plan_finish = date;
},
handleChange5(date) {
this.formItemMain1.actual_start = date
this.formItemMain1.actual_start = date;
},
handleChange6(date) {
this.formItemMain1.actual_finish = date
this.formItemMain1.actual_finish = date;
},
handleChange7(date) {
this.formItemMain1.plan_start = date
this.formItemMain1.plan_start = date;
},
handleChange8(date) {
this.formItemMain1.plan_finish = date
this.formItemMain1.plan_finish = date;
},
handleChange9(date) {
this.formItemMain1.actual_start = date
this.formItemMain1.actual_start = date;
},
handleChange10(date) {
this.formItemMain1.actual_finish = date
this.formItemMain1.actual_finish = date;
},
laodaction() {
let url = `${systemUrl}/equipinfo/getpaged`
let url = `${systemUrl}/equipinfo/getpaged`;
service
.get(`${url}`,{
equip_name: this.value1,
shopid: this.shopid,
pageindex: this.page,
pageSize: this.pageSize
})
.then((res) => {
this.datatable = res.result.items
this.total = res.result.totalCount
.get(`${url}`, {
equip_name: this.value1,
shopid: this.shopid,
pageindex: this.page,
pageSize: this.pageSize
})
.then(res => {
this.datatable = res.result.items;
this.total = res.result.totalCount;
});
},
//高级搜索
advancedSearch() {
......@@ -790,88 +790,89 @@ export default {
},
//设备保养
newMain() {
if (this.eid == '') {
this.$Message.error('请选择设备!')
return
if (this.eid == "") {
this.$Message.error("请选择设备!");
return;
}
this.formItemMain.equip_pk = this.eqid
this.formItemMain.equip_name = this.eqname
this.show = true
this.formItemMain.equip_pk = this.eqid;
this.formItemMain.equip_name = this.eqname;
this.show = true;
},
newMain1() {
if (this.eid == '') {
this.$Message.error('请选择设备!')
return
if (this.eid == "") {
this.$Message.error("请选择设备!");
return;
}
this.formItemMain.equip_pk = this.eqid
this.formItemMain.equip_name = this.eqname
this.show5 = true
this.formItemMain.equip_pk = this.eqid;
this.formItemMain.equip_name = this.eqname;
this.show5 = true;
},
//新增设备
newEquipment() {
this.$refs.equipment.modalShow = true
this.$refs.equipment.title = '新增设备'
this.$refs.equipment.data1 = this.datatable
this.$refs.equipment.$refs.refqcFile.newName= ''
this.$refs.equipment.isimportant= 2
this.$refs.equipment.property = true;
this.$refs.equipment.modalShow = true;
this.$refs.equipment.title = "新增设备";
this.$refs.equipment.data1 = this.datatable;
this.$refs.equipment.$refs.refqcFile.newName = "";
this.$refs.equipment.isimportant = 2;
//this.$refs.equipment.refqcFile.newName = ''
this.$refs.equipment.formItem = {
equip_name: '',
equip_id: '',
equip_name: "",
equip_id: "",
equip_type: [],
equip_pic: '',
equip_status: '',
equip_ip: '',
shop_id: '',
shop_name: '',
isimportant:2,
location:'',
capability_value:1,
}
equip_pic: "",
equip_status: "",
equip_ip: "",
shop_id: "",
shop_name: "",
isimportant: 2,
location: "",
capability_value: 1
};
},
// 删除
deleted() {
this.$Modal.confirm({
title: '删除',
content: '<p>您确定要删除此设备吗</p>',
title: "删除",
content: "<p>您确定要删除此设备吗</p>",
onOk: () => {
this.$Message.info('删除成功')
this.$Message.info("删除成功");
},
onCancel: () => {
this.$Message.info('已取消')
this.$Message.info("已取消");
}
})
});
},
// 分页
pageChange(num) {
//console.log(num);
this.page = num
this.laodaction()
this.page = num;
this.laodaction();
},
pageSizeChange(limit) {
//console.log(limit)
this.pageSize = limit
this.laodaction()
this.pageSize = limit;
this.laodaction();
},
selectionData(row) {
console.log(row)
console.log(row);
},
selectionRow(currentRow, oldCurrentRow) {
this.eqid = currentRow.equip_id
this.eqname = currentRow.equip_name
this.eid = currentRow.id
this.eqid = currentRow.equip_id;
this.eqname = currentRow.equip_name;
this.eid = currentRow.id;
},
selectionRow1(currentRow, oldCurrentRow) {
this.ptimes = currentRow.plan_start
this.ptimee = currentRow.plan_finish
this.atimes = currentRow.actual_start
this.atimee = currentRow.actual_finish
this.inputtime = currentRow.input_time
this.etype = currentRow.equip_down_type
this.mainstatus = currentRow.status
this.eid1 = currentRow.id
this.failurenotes = currentRow.failure_notes
this.borw = currentRow.maintain_type
this.ptimes = currentRow.plan_start;
this.ptimee = currentRow.plan_finish;
this.atimes = currentRow.actual_start;
this.atimee = currentRow.actual_finish;
this.inputtime = currentRow.input_time;
this.etype = currentRow.equip_down_type;
this.mainstatus = currentRow.status;
this.eid1 = currentRow.id;
this.failurenotes = currentRow.failure_notes;
this.borw = currentRow.maintain_type;
},
saveOk() {
// if(this.formItemMain.plan_start=='')
......@@ -887,38 +888,36 @@ export default {
// console.log(str);
// console.log(this.formItemMain.plan_start);
// return;
let url = `${systemUrl}/equipmaintainplan/createorupdate`
let url = `${systemUrl}/equipmaintainplan/createorupdate`;
let paramsdata = {
id: '',
id: "",
equip_pk: this.eid,
equip_down_type: this.formItemMain.equip_down_type,
plan_start: this.formItemMain.plan_start,
plan_finish: this.formItemMain.plan_finish,
maintain_type: '1'
}
console.log(paramsdata)
service
.post(`${url}`, { equipMaintainPlan: paramsdata })
.then((res) => {
if (res.success) {
this.changestatus(this.eid)
this.show = false
setTimeout(() => {
this.laodaction()
}, 1000)
this.$Message.success('新增成功')
}
})
maintain_type: "1"
};
console.log(paramsdata);
service.post(`${url}`, { equipMaintainPlan: paramsdata }).then(res => {
if (res.success) {
this.changestatus(this.eid);
this.show = false;
setTimeout(() => {
this.laodaction();
}, 1000);
this.$Message.success("新增成功");
}
});
},
downFile(path) {
console.log(path)
var path1 = path.row.equip_pic
if (path1 != '') {
this.fileUrlPath = this.downUrl + path1
downFile(path) {
console.log(path);
var path1 = path.row.equip_pic;
if (path1 != "") {
this.fileUrlPath = this.downUrl + path1;
} else {
this.fileUrlPath = 'javascript:void(0)'
this.$Message.error('无图片')
return
this.fileUrlPath = "javascript:void(0)";
this.$Message.error("无图片");
return;
}
},
saveOk1() {
......@@ -929,38 +928,36 @@ export default {
// return;
// }
let url = `${systemUrl}/equipmaintainplan/createorupdate`
let url = `${systemUrl}/equipmaintainplan/createorupdate`;
let paramsdata = {
id: '',
id: "",
equip_pk: this.eid,
notes: this.formItemMain.notes,
input_time: this.formItemMain.input_time,
equip_down_type: '设备故障',
maintain_type: '2'
}
console.log(paramsdata)
service
.post(`${url}`, { equipMaintainPlan: paramsdata })
.then((res) => {
if (res.success) {
this.changestatus(this.eid)
this.show = false
setTimeout(() => {
this.laodaction()
}, 1000)
this.$Message.success('新增成功')
}
})
equip_down_type: "设备故障",
maintain_type: "2"
};
console.log(paramsdata);
service.post(`${url}`, { equipMaintainPlan: paramsdata }).then(res => {
if (res.success) {
this.changestatus(this.eid);
this.show = false;
setTimeout(() => {
this.laodaction();
}, 1000);
this.$Message.success("新增成功");
}
});
},
edit(data) {
this.$refs.equipment.$refs.refqcFile.newName= data.row.equip_pic
this.$refs.equipment.data1 = this.datatable
let url = `${systemUrl}/equipbelongtype/getbyid`
service.get(`${url}`, { Id: data.row.id }).then((res) => {
console.log(data)
this.typepk = res.result
this.$refs.equipment.title = '编辑设备'
this.$refs.equipment.modalShow = true
this.$refs.equipment.$refs.refqcFile.newName = data.row.equip_pic;
this.$refs.equipment.data1 = this.datatable;
let url = `${systemUrl}/equipbelongtype/getbyid`;
service.get(`${url}`, { Id: data.row.id }).then(res => {
console.log(data);
this.typepk = res.result;
this.$refs.equipment.title = "编辑设备";
this.$refs.equipment.modalShow = true;
this.$refs.equipment.formItem = {
equip_name: data.row.equip_name,
equip_id: data.row.equip_id,
......@@ -970,109 +967,112 @@ export default {
equip_ip: data.row.equip_ip,
shop_id: data.row.shop_id,
shop_name: data.row.shop_name,
isimportant:data.row.isimportant,
location:data.row.location,
capability_value:data.row.capability_value,
isimportant: data.row.isimportant,
location: data.row.location,
capability_value: data.row.capability_value
};
if (data.row.property == 2) {
this.$refs.equipment.property = true;
} else {
this.$refs.equipment.property = false;
}
this.$refs.equipment.isimportant = data.row.isimportant
this.$refs.equipment.editId = data.row.id
})
this.$refs.equipment.isimportant = data.row.isimportant;
this.$refs.equipment.editId = data.row.id;
});
},
del(data) {
this.seleId = data.row.id
this.seleId = data.row.id;
let url = `${systemUrl}/equipinfo/delete`,
uId = this.seleId
service
.delete(`${systemUrl}/equipinfo/delete?id=${uId}`)
.then((res) => {
if (res.success) {
this.laodaction()
this.$Message.success('删除成功')
}
})
uId = this.seleId;
service.delete(`${systemUrl}/equipinfo/delete?id=${uId}`).then(res => {
if (res.success) {
this.laodaction();
this.$Message.success("删除成功");
}
});
},
Main(data) {
this.eid1 = ''
this.seleId = data.row.id
let url = `${systemUrl}/equipmaintainplan/getpaged`
this.eid1 = "";
this.seleId = data.row.id;
let url = `${systemUrl}/equipmaintainplan/getpaged`;
service
.get(`${url}`,{ equipid: this.seleId, maintain_type: '1' })
.then((res) => {
.get(`${url}`, { equipid: this.seleId, maintain_type: "1" })
.then(res => {
//console.log(res)
this.datatable1 = res.result.items
this.datatable1 = res.result.items;
if (this.datatable1.length == 0) {
this.$Message.error('该设备没有保养数据!')
this.show3 = false
return
this.$Message.error("该设备没有保养数据!");
this.show3 = false;
return;
}
this.show3 = true
})
console.log(this.datatable1)
this.show3 = true;
});
console.log(this.datatable1);
},
Main1(data) {
this.eid1 = ''
this.seleId = data.row.id
let url = `${systemUrl}/equipmaintainplan/getpaged`
this.eid1 = "";
this.seleId = data.row.id;
let url = `${systemUrl}/equipmaintainplan/getpaged`;
service
.get(`${url}`, { equipid: this.seleId, maintain_type: '2' })
.then((res) => {
.get(`${url}`, { equipid: this.seleId, maintain_type: "2" })
.then(res => {
//console.log(res)
this.datatable1 = res.result.items
this.datatable1 = res.result.items;
if (this.datatable1.length == 0) {
this.$Message.error('该设备没有维修数据!')
this.show3 = false
return
this.$Message.error("该设备没有维修数据!");
this.show3 = false;
return;
}
this.show3 = true
})
this.show3 = true;
});
},
loadmain(id) {
let url = `${systemUrl}/equipmaintainplan/getpaged`
let url = `${systemUrl}/equipmaintainplan/getpaged`;
service
.get(`${url}`,{ equipid: id, maintain_type: this.borw })
.then((res) => {
.get(`${url}`, { equipid: id, maintain_type: this.borw })
.then(res => {
//console.log(res)
this.datatable1 = res.result.items
})
this.datatable1 = res.result.items;
});
},
changestatus(id) {
let url = `${systemUrl}/equipmaintainplan/changestatus`
service.post(`${url}`, { equipid: id }).then((res) => {
let url = `${systemUrl}/equipmaintainplan/changestatus`;
service.post(`${url}`, { equipid: id }).then(res => {
//console.log(res)
})
});
},
newMainBack() {
if (this.eid1 == '') {
this.$Message.error('请选择维保任务!')
return
if (this.eid1 == "") {
this.$Message.error("请选择维保任务!");
return;
}
if (this.mainstatus == '完成') {
this.$Message.error('该维保任务已完成!')
return
if (this.mainstatus == "完成") {
this.$Message.error("该维保任务已完成!");
return;
}
if (this.borw == '1') {
this.show4 = true
this.formItemMain1.plan_start = this.ptimes
this.formItemMain1.plan_finish = this.ptimee
this.formItemMain1.actual_start = this.atimes
this.formItemMain1.actual_finish = this.atimee
this.formItemMain1.failure_notes = this.failurenotes
if (this.borw == "1") {
this.show4 = true;
this.formItemMain1.plan_start = this.ptimes;
this.formItemMain1.plan_finish = this.ptimee;
this.formItemMain1.actual_start = this.atimes;
this.formItemMain1.actual_finish = this.atimee;
this.formItemMain1.failure_notes = this.failurenotes;
}
if (this.borw == '2') {
this.show6 = true
this.formItemMain1.plan_start = this.ptimes
this.formItemMain1.plan_finish = this.ptimee
this.formItemMain1.actual_start = this.atimes
this.formItemMain1.actual_finish = this.atimee
this.formItemMain1.failure_notes = this.failurenotes
if (this.borw == "2") {
this.show6 = true;
this.formItemMain1.plan_start = this.ptimes;
this.formItemMain1.plan_finish = this.ptimee;
this.formItemMain1.actual_start = this.atimes;
this.formItemMain1.actual_finish = this.atimee;
this.formItemMain1.failure_notes = this.failurenotes;
}
console.log(this.formItemMain1.plan_start)
console.log(this.formItemMain1.plan_start);
},
saveOkBack() {
// console.log(str);
let url = `${systemUrl}/equipmaintainplan/createorupdate`
let url = `${systemUrl}/equipmaintainplan/createorupdate`;
let paramsdata = {
id: this.eid1,
equip_pk: this.eid,
......@@ -1085,29 +1085,27 @@ export default {
input_time: this.inputtime,
maintain_type: this.borw,
status: this.formItemMain1.status
}
console.log(paramsdata)
service
.post(`${url}`, { equipMaintainPlan: paramsdata })
.then((res) => {
if (res.success) {
this.changestatus(this.eid)
this.loadmain(this.eid)
setTimeout(() => {
this.laodaction()
}, 1000)
this.eid1 = ''
this.show4 = false
this.$Message.success('更新成功')
}
})
};
console.log(paramsdata);
service.post(`${url}`, { equipMaintainPlan: paramsdata }).then(res => {
if (res.success) {
this.changestatus(this.eid);
this.loadmain(this.eid);
setTimeout(() => {
this.laodaction();
}, 1000);
this.eid1 = "";
this.show4 = false;
this.$Message.success("更新成功");
}
});
},
selectTreeNode(value) {
if (value != '') {
this.shopid = value[0].value
this.page = 1
this.pageSize = 10
this.laodaction()
if (value != "") {
this.shopid = value[0].value;
this.page = 1;
this.pageSize = 10;
this.laodaction();
}
// if (value != "") {
// this.searchObj.departmentId = null
......@@ -1119,27 +1117,27 @@ export default {
},
computed: {
searchList() {
let nodeList = this.treeData
var text = this.treeInputSearch
var newNodeList = []
let nodeList = this.treeData;
var text = this.treeInputSearch;
var newNodeList = [];
function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) {
newNodeList.push(nodeLists[i])
newNodeList.push(nodeLists[i]);
} else if (nodeLists[i].children.length > 0) {
searchTree(nodeLists[i].children, value)
searchTree(nodeLists[i].children, value);
}
}
}
if (text != '') {
searchTree(nodeList, text)
if (text != "") {
searchTree(nodeList, text);
} else {
return nodeList
return nodeList;
}
return newNodeList
return newNodeList;
}
}
}
};
</script>
<style lang="less" scoped>
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('code')" prop="code"> <Input v-model="entity.code"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('type')" prop="type"> <Input v-model="entity.type"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('property')" prop="property"> <InputNumber v-model="entity.property"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('departId')" prop="departId"> <InputNumber v-model="entity.departId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('departTitle')" prop="departTitle"> <Input v-model="entity.departTitle"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "plan_resource" + "." + key;
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
\ No newline at end of file
// import Api from '@/api/axios'
import Api from '@/plugins/request'
export default {
index:`${resourceUrl}planresource/paged`,
paged(params){
return Api.post(`${resourceUrl}planresource/paged`,params);
},
get(params){
return Api.get(`${resourceUrl}planresource/get`,params);
},
create(params){
return Api.post(`${resourceUrl}planresource/create`,params);
},
update(params){
return Api.post(`${resourceUrl}planresource/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}planresource/delete`,{params:params});
},
}
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字资源名称/资源编号/资源类型/部门" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Add from "./add";
export default {
name: "list",
components: {
Add
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title,code,type,departTitle", value: null }
},
deletelModal: false,
curId: 0,
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left"
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left"
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left"
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left"
},
{
key: "isDeleted",
title: this.l("isDeleted"),
hide: true,
align: "left"
},
{
key: "deletionTime",
title: this.l("deletionTime"),
hide: true,
align: "left"
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
hide: true,
align: "left"
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true
},
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true
},
{
key: "type",
title: this.l("type"),
align: "left",
easy: true,
high: true
},
{
key: "property",
title: this.l("property"),
align: "left",
high: true
},
{
key: "departId",
title: this.l("departId"),
align: "left",
high: true
},
{
key: "departTitle",
title: this.l("departTitle"),
align: "left",
easy: true,
high: true
},
{
title: "操作",
key: "id",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) }
},
"查看"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
}
}
]
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.curId = 0;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then(r => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.deletedlModal = false;
},
l(key) {
/*
plan_resource:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'资源名称',
code:'资源编号',
type:'资源类型',
property:'属性',
departId:'部门id',
departTitle:'部门',
}
*/
let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
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