qa-prevention-xgf-vue/src/views/train/synInfo/components/sendUtil.vue

131 lines
3.5 KiB
Vue
Raw Normal View History

2023-12-18 18:54:49 +08:00
<template>
<div>
<el-dialog :visible.sync="visible" :append-to-body="appendToBody" :before-close="beforeClose" title="头像" width="370px" destroy-on-close>
<el-form>
<el-form-item prop="TERRITORIALITY" label="集团单位 ">
<Treeselect
:options="jituanDanweiTreeData"
:normalizer="normalizer"
v-model="corp_id"
placeholder="请选择集团单位 "
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
@select="getInfo($event)"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="sendMessage()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import vueQr from 'vue-qr'
import Treeselect from '@riophae/vue-treeselect'
import { requestFN } from '@/utils/request'
export default {
components: { Treeselect, vueQr },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
jituanDanwei: '',
loading: false,
jituanDanweiTreeData: [],
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.nodes
}
},
corp_id: null,
corp_name: '',
heirloom: {}
}
},
methods: {
init(e) {
this.visible = true
this.getCorpinfo()
this.heirloom = JSON.stringify(e)
},
getCorpinfo() {
requestFN(
'/corpinfo/getDataForEditByCorpInfoId',
{
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
tm: new Date().getTime()
}
).then((data) => {
this.corpinfo = data.pd
// 河港机械 jtdw002 1e6dbbe16004402f8d2c0e52afd9a676
// 河港港工 jtdw003 3a854eefa7894e06aaa1a2611bca80f6
// 河港检测 jtdw004 020578a4c1f04bc692ee25145c2efbe5
// 方宇物业 jtdw005 90966974de3c4b83aca6f8fd6432d5c2
if (data.pd.CORP_TYPE == 'jtdw002') {
this.jituanDanwei = '1e6dbbe16004402f8d2c0e52afd9a676'
}
if (data.pd.CORP_TYPE == 'jtdw003') {
this.jituanDanwei = '3a854eefa7894e06aaa1a2611bca80f6'
}
if (data.pd.CORP_TYPE == 'jtdw004') {
this.jituanDanwei = '020578a4c1f04bc692ee25145c2efbe5'
}
if (data.pd.CORP_TYPE == 'jtdw005') {
this.jituanDanwei = '90966974de3c4b83aca6f8fd6432d5c2'
}
this.getTreeData()
})
},
getTreeData() {
if (this.jituanDanwei) {
requestFN(
'/companyApi/department/listTree',
{ CORPINFO_ID: this.jituanDanwei }
).then((data) => {
this.jituanDanweiTreeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
})
}
},
getInfo(e) {
console.log(e)
this.corp_name = e.name
},
beforeClose() {
this.corp_id = null
},
sendMessage(row) {
requestFN(
'/trainingbatch/sendMessage',
{
list: this.heirloom,
corp_id: this.corp_id,
corp_name: this.corp_name,
tm: new Date().getTime()
}
).then((data) => {
this.$message.success('推送成功')
this.visible = false
this.$emit('refresh', '')
})
}
}
}
</script>
<style lang="scss" scoped>
</style>