|
@@ -1,14 +1,7 @@
|
|
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
<div>
|
|
<div>
|
|
- <el-dialog
|
|
|
|
- :title="title"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- v-dialogDrag
|
|
|
|
- width="1000px"
|
|
|
|
- @close="close"
|
|
|
|
- :visible.sync="visible">
|
|
|
|
<el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
<el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
- label-width="125px" @submit.native.prevent>
|
|
|
|
|
|
+ @submit.native.prevent>
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
<el-divider content-position="left"><i class="el-icon-document"></i> 人员信息</el-divider>
|
|
<el-divider content-position="left"><i class="el-icon-document"></i> 人员信息</el-divider>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -39,33 +32,96 @@
|
|
</el-card>
|
|
</el-card>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="部门" prop="soName"
|
|
|
|
+ :rules="[]"
|
|
|
|
+ >
|
|
|
|
+ <el-card shadow="always">
|
|
|
|
+ {{inputForm.soName?inputForm.soName:'--'}}
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+<!-- <el-row :gutter="15">-->
|
|
|
|
+<!-- <el-divider content-position="left"><i class="el-icon-document"></i> 交接内容</el-divider>-->
|
|
|
|
+<!-- <el-col :span="24" v-for="item in contentList">-->
|
|
|
|
+<!-- <el-form-item>-->
|
|
|
|
+<!-- <el-card shadow="always">-->
|
|
|
|
+<!-- {{item}}-->
|
|
|
|
+<!-- </el-card>-->
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
+<!-- </el-col>-->
|
|
|
|
+<!-- </el-row>-->
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
- <el-divider content-position="left"><i class="el-icon-document"></i> 交接内容</el-divider>
|
|
|
|
- <el-col :span="24" v-for="item in contentList">
|
|
|
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i> 离职交接</el-divider>
|
|
|
|
+ <el-col :span="24" v-if="false">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-card shadow="always">
|
|
|
|
- {{item}}
|
|
|
|
- </el-card>
|
|
|
|
|
|
+ <el-button @click="addLine()" type="primary" icon="el-icon-plus">添加分类</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- </el-row>
|
|
|
|
- <el-row>
|
|
|
|
- <el-divider content-position="left"><i class="el-icon-document"></i> 会签对象</el-divider>
|
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="选择会签对象" prop="approvalHandoverId"
|
|
|
|
- :rules="[{required: true, message: '会签对象不能为空', trigger: 'blur'},{required: true, message: '会签对象不能为空', trigger: 'change'}]"
|
|
|
|
- >
|
|
|
|
- <RosterSelectForm :limit='1' :value="inputForm.approvalHandoverId" @getValue='(value) => {inputForm.approvalHandoverId=value}'></RosterSelectForm>
|
|
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-table ref="inputTable" :key="tableKey" :data="inputForm.handoverDTOList" >
|
|
|
|
+ <el-table-column label="分类" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-form-item :prop="'handoverDTOList.'+scope.$index+'.type'" :rules="[{required: true, message: '分类不能为空', trigger: 'blur'}]">
|
|
|
|
+<!-- {{'交接分类'+(scope.$index+1)+':'}}-->
|
|
|
|
+ <el-input :readonly="true" v-model="scope.row.type" placeholder="请输入交接分类" clearable></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-table :ref="'inputTable'+scope.$index" :show-header="true" :data="inputForm.handoverDTOList[scope.$index].handoverDTOList" >
|
|
|
|
+ <el-table-column label="交接内容" >
|
|
|
|
+ <template slot-scope="scope1">
|
|
|
|
+ <el-form-item :prop="'handoverDTOList['+scope.$index+'].handoverDTOList['+scope1.$index+'].content'" :rules="[{required: true, message: '交接内容不能为空', trigger: 'blur'}]">
|
|
|
|
+ <el-input :readonly="true" v-model="scope1.row.content" placeholder="请输入交接内容" clearable></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="80" prop="" label="操作" v-if="false">
|
|
|
|
+ <template scope="scope1">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button v-if="inputForm.handoverDTOList[scope.$index].handoverDTOList.length !== 1" size="small" type="danger" @click="delLine(scope.$index,scope1.$index)">删除</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="300" label="会签人员">
|
|
|
|
+ <template scope="scope">
|
|
|
|
+ <el-form-item :prop="'handoverDTOList.'+scope.$index+'.rosterId'" :rules="[
|
|
|
|
+ {required: true, message: '人员姓名不能为空', trigger: 'blur'},{required: true, message: '人员姓名不能为空', trigger: 'change'}]">
|
|
|
|
+<!-- <RosterSelectForm :limit='1' :value="inputForm.handoverDTOList[scope.$index].rosterId" @getValue='(value) => {$set(inputForm.handoverDTOList[scope.$index],"rosterId", value)}'></RosterSelectForm>-->
|
|
|
|
+ <UserSelect :limit='1' :value="inputForm.handoverDTOList[scope.$index].rosterId" @getValue='(value) => {$set(inputForm.handoverDTOList[scope.$index],"rosterId", value)}'></UserSelect>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="150" label="操作" v-if="false">
|
|
|
|
+ <template scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ <el-form-item >
|
|
|
|
+ <el-button size="small" type="primary" @click="addLine(scope.$index)">增加</el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="delLine(scope.$index,null)">删除</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+<!-- <el-row>-->
|
|
|
|
+<!-- <el-divider content-position="left"><i class="el-icon-document"></i> 会签对象</el-divider>-->
|
|
|
|
+<!-- <el-col :span="24">-->
|
|
|
|
+<!-- <el-form-item label="选择会签对象" prop="approvalHandoverId"-->
|
|
|
|
+<!-- :rules="[{required: true, message: '会签对象不能为空', trigger: 'blur'},{required: true, message: '会签对象不能为空', trigger: 'change'}]"-->
|
|
|
|
+<!-- >-->
|
|
|
|
+<!-- <RosterSelectForm :limit='1' :value="inputForm.approvalHandoverId" @getValue='(value) => {inputForm.approvalHandoverId=value}'></RosterSelectForm>-->
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
+<!-- </el-col>-->
|
|
|
|
+<!-- </el-row>-->
|
|
</el-form>
|
|
</el-form>
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
|
-<!-- <el-button size="small" type="primary" v-if="method !== 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>-->
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -73,7 +129,19 @@
|
|
import DimissionService from '@/api/changes/dimission/DimissionService'
|
|
import DimissionService from '@/api/changes/dimission/DimissionService'
|
|
import RosterService from '@/api/roster/RosterService'
|
|
import RosterService from '@/api/roster/RosterService'
|
|
import RosterSelectForm from '@/views/common/RosterSelectForm'
|
|
import RosterSelectForm from '@/views/common/RosterSelectForm'
|
|
|
|
+ import UserSelect from '@/components/userSelect'
|
|
|
|
+ import DimissionHandoverService from '@/api/changes/dimission/DimissionHandoverService'
|
|
export default {
|
|
export default {
|
|
|
|
+ props: {
|
|
|
|
+ businessId: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
|
|
+ },
|
|
|
|
+ formReadOnly: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
title: '',
|
|
title: '',
|
|
@@ -88,19 +156,42 @@
|
|
rosterBaseDTO: {
|
|
rosterBaseDTO: {
|
|
jobNo: '',
|
|
jobNo: '',
|
|
mobile: ''
|
|
mobile: ''
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ cdId: '',
|
|
|
|
+ handoverDTOList: []
|
|
},
|
|
},
|
|
|
|
+ tableKey: 0,
|
|
contentList: ['工作交接', '回收工作邮箱', '回收工作电话', '回收系统账号', '回收门禁等权限', '回收笔记本']
|
|
contentList: ['工作交接', '回收工作邮箱', '回收工作电话', '回收系统账号', '回收门禁等权限', '回收笔记本']
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ 'businessId': {
|
|
|
|
+ handler (newVal) {
|
|
|
|
+ if (this.businessId) {
|
|
|
|
+ if (this.businessId !== 'false') {
|
|
|
|
+ this.init('handover', this.businessId)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ immediate: true,
|
|
|
|
+ deep: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
dimissionService: null,
|
|
dimissionService: null,
|
|
rosterService: null,
|
|
rosterService: null,
|
|
|
|
+ dimissionHandoverService: null,
|
|
created () {
|
|
created () {
|
|
this.dimissionService = new DimissionService()
|
|
this.dimissionService = new DimissionService()
|
|
this.rosterService = new RosterService()
|
|
this.rosterService = new RosterService()
|
|
|
|
+ this.dimissionHandoverService = new DimissionHandoverService()
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
- RosterSelectForm
|
|
|
|
|
|
+ RosterSelectForm,
|
|
|
|
+ UserSelect
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init (method, id) {
|
|
init (method, id) {
|
|
@@ -113,7 +204,9 @@
|
|
rosterBaseDTO: {
|
|
rosterBaseDTO: {
|
|
jobNo: '',
|
|
jobNo: '',
|
|
mobile: ''
|
|
mobile: ''
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ cdId: '',
|
|
|
|
+ handoverDTOList: []
|
|
}
|
|
}
|
|
this.inputForm.id = id
|
|
this.inputForm.id = id
|
|
if (method === 'handover') {
|
|
if (method === 'handover') {
|
|
@@ -127,16 +220,41 @@
|
|
this.dimissionService.queryById(this.inputForm.id).then(({data}) => {
|
|
this.dimissionService.queryById(this.inputForm.id).then(({data}) => {
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
- this.loading = false
|
|
|
|
|
|
+ this.dimissionHandoverService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
|
+ if (!this.commonJS.isEmpty(data)) {
|
|
|
|
+ this.inputForm.handoverDTOList = data
|
|
|
|
+ this.inputForm.handoverDTOList = JSON.parse(JSON.stringify(this.inputForm.handoverDTOList))
|
|
|
|
+ this.inputForm.handoverDTOList.forEach(item => {
|
|
|
|
+ if (this.commonJS.isEmpty(item.rosterId)) {
|
|
|
|
+ item.rosterId = ''
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.tableKey++
|
|
|
|
+ } else {
|
|
|
|
+ this.dimissionHandoverService.queryInitialize().then(({data}) => {
|
|
|
|
+ this.inputForm.handoverDTOList = data
|
|
|
|
+ this.inputForm.handoverDTOList = JSON.parse(JSON.stringify(this.inputForm.handoverDTOList))
|
|
|
|
+ this.inputForm.handoverDTOList.forEach(item => {
|
|
|
|
+ if (this.commonJS.isEmpty(item.rosterId)) {
|
|
|
|
+ item.rosterId = ''
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.tableKey++
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 表单提交
|
|
// 表单提交
|
|
doSubmit () {
|
|
doSubmit () {
|
|
|
|
+ console.log(this.inputForm)
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
- this.dimissionService.save(this.inputForm).then(({data}) => {
|
|
|
|
|
|
+ this.inputForm.cdId = this.inputForm.id
|
|
|
|
+ this.dimissionHandoverService.save(this.inputForm).then(({data}) => {
|
|
this.close()
|
|
this.close()
|
|
this.$message.success(data)
|
|
this.$message.success(data)
|
|
this.$emit('refreshDataList')
|
|
this.$emit('refreshDataList')
|
|
@@ -151,6 +269,30 @@
|
|
this.selectData = []
|
|
this.selectData = []
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
this.visible = false
|
|
this.visible = false
|
|
|
|
+ },
|
|
|
|
+ delLine (index, childIndex) {
|
|
|
|
+ if (childIndex !== null && childIndex !== undefined && childIndex !== '') {
|
|
|
|
+ this.inputForm.handoverDTOList[index].handoverDTOList.splice(childIndex, 1)
|
|
|
|
+ } else {
|
|
|
|
+ this.inputForm.handoverDTOList.splice(index, 1)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ addLine (rowIndex) {
|
|
|
|
+ const newLine = {
|
|
|
|
+ id: '',
|
|
|
|
+ cdId: '',
|
|
|
|
+ parentId: '',
|
|
|
|
+ type: '',
|
|
|
|
+ content: '',
|
|
|
|
+ rosterId: ''
|
|
|
|
+ }
|
|
|
|
+ if (!this.commonJS.isEmpty(rowIndex)) {
|
|
|
|
+ this.inputForm.handoverDTOList[rowIndex].handoverDTOList.push(newLine)
|
|
|
|
+ } else {
|
|
|
|
+ this.inputForm.handoverDTOList.push({type: '', rosterId: ''})
|
|
|
|
+ this.$set(this.inputForm.handoverDTOList[this.inputForm.handoverDTOList.length - 1], 'handoverDTOList', [newLine])
|
|
|
|
+ }
|
|
|
|
+ this.tableKey++
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|