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