数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.6 KiB

2 years ago
<!--
@ 作者: 鲁智强
@ 时间: 2023-08-15 11:34:38
@ 备注:
-->
<template>
<el-dialog :model-value="true" title="编辑指标" @close="handleClose">
<el-form ref="ruleFormRef" :model="formData" label-width="120px" class="demo-ruleForm">
<el-form-item label="说明">
<el-input v-model="formData.content" type="textarea" />
</el-form-item>
<el-form-item label="状态">
<el-select v-model="formData.state">
<el-option label="使用" :value="1"/>
<el-option label="禁止" :value="3"/>
</el-select>
</el-form-item>
<el-form-item label="执行人">
<el-tree-select ref="orgTreeRef" v-model="formData.uio" show-checkbox multiple node-key="id" :data="lcx" :props="orgTreeProps" :render-after-expand="false"/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm()">确定</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script lang="ts" setup>
import { reactive } from "vue"
2 years ago
import {ElMessage} from "element-plus"
2 years ago
import {get_runman,get_org,edit_scheme } from '@/api/opk/zxy/news/api'
2 years ago
2 years ago
const isshow = ref(false)
const props= defineProps( {
title: {
type: String,
default: "",
},
hyrPostBox: {
type: Boolean,
default: false,
},
rowInfo: {
type: Object,
default() {
return {};
},
},
arrayNum: {
type: Number,
default: 0,
},
});
const orgTreeProps ={
label: 'name',
children:'child'
}
const orgTreeProp = {
label:'title',
children:'children'
}
const emit = defineEmits(["update:hyrPostBox","editRow","addRow"])
const formData = reactive({
iop:"",
uio:"",
2 years ago
yui:"",
content:"",
state:"",
2 years ago
})
const tablea = ref<any>([])
function ge_adds(){
const yui = props.rowInfo.targetid
get_runman({id:yui,level:1,orgid:props.rowInfo.orgid,posid:"",type:1})
.then((data) => {
tablea.value = data.data;
}).finally(()=>{
isshow.value = false
})
}
ge_adds()
const lcx = ref<any>([])
function get_orgs(){
get_org({id:"309",all:1})
.then((data) => {
lcx.value = data.data;
}).finally(()=>{
isshow.value = false
})
}
get_orgs()
// 关闭弹窗
const handleClose = ()=> {
emit("update:hyrPostBox", false);
}
const submitForm=()=> {
handleClose()
2 years ago
const add = formData.uio.toString().split(',')
const ess = new Number(formData.state)
edit_scheme({Operator:add,content:formData.content,orgid:props.rowInfo.orgid,planversionkey:props.rowInfo.plantversion,state:ess,targetid:props.rowInfo.targetid})
.then(()=>{
ElMessage({
type:'success',
message:'成功'
})
})
2 years ago
}
onMounted(()=>{
Object.assign(formData,props.rowInfo);
})
</script>