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.
261 lines
9.1 KiB
261 lines
9.1 KiB
<template>
|
|
<div class="app-container">
|
|
<div v-show="viewState == 1">
|
|
<div class="tab-header webtop">
|
|
<div>{{ viewTitle }}</div>
|
|
<div>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled">提交</el-button>
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="listconadd">
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
|
<el-row style="border-top: 1px solid #e0e3eb">
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请部门</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请人</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请日期</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">备注</div>
|
|
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">附件</div>
|
|
<el-form-item>
|
|
<uploadImg ref="uploadImg" class="addinputInfo" v-model="formobj.asTechTitleApplyFileList" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="title">维修技师职称备案列表</div>
|
|
<el-table :key="tableKey" :data="formobj.asTechTitleDetailDetailsList" :index="index" border style="width: 100%">
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
|
|
<el-table-column fixed label="操作" align="center" width="100">
|
|
<template slot-scope="scope">
|
|
<el-button type="danger" size="small" @click="handleDelete(scope.$index)">删除</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="titleNameValue" label="职称名称" align="center" />
|
|
<el-table-column prop="weight" label="权重" align="center"/>
|
|
<el-table-column label="维修技师" align="center">
|
|
<template slot-scope="scope">
|
|
<el-select v-model="scope.row.techSids" placeholder="请选择" @change="techChange(scope.row.techSids, scope.row)" clearable filterable multiple>
|
|
<el-option v-for="item in tech_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
|
|
</el-select>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/basicinformation/technicalTitleFiling'
|
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
|
import { getOrgSidByPath, fetchBySid, getUserByDeptSid } from '@/api/Common/dictcommons'
|
|
|
|
export default {
|
|
name: 'TechnicalTitleFilingAdd',
|
|
components: {
|
|
uploadImg
|
|
},
|
|
data() {
|
|
return {
|
|
viewTitle: '',
|
|
viewState: 1,
|
|
submitdisabled: false,
|
|
tableKey: 1,
|
|
index: 0,
|
|
tech_list: [],
|
|
formobj: {
|
|
sid: '',
|
|
remarks: '',
|
|
createBySid: '',
|
|
createTime: '',
|
|
billNo: '',
|
|
createByName: '',
|
|
deptSid: '',
|
|
deptName: '',
|
|
useOrgSid: '',
|
|
useOrgName: '',
|
|
finishTime: '',
|
|
procInstId: '',
|
|
procDefId: '',
|
|
taskId: '',
|
|
nodeId: '',
|
|
nodeState: '',
|
|
asTechTitleDetailDetailsList: [],
|
|
asTechTitleApplyFileList: []
|
|
},
|
|
rules: {}
|
|
}
|
|
},
|
|
methods: {
|
|
showAdd(val) {
|
|
this.viewTitle = '【新增】维修技师职称备案申请'
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
req.init(val).then((res) => {
|
|
if (res.success) {
|
|
this.formobj = res.data
|
|
this.formobj.createByName = window.sessionStorage.getItem('name')
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
|
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
|
|
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
|
this.formobj.createOrgSid = this.formobj.deptSid
|
|
this.formobj.createOrgName = this.formobj.deptName
|
|
var nowDate = new Date()
|
|
var date = {
|
|
year: nowDate.getFullYear(),
|
|
month: nowDate.getMonth() + 1,
|
|
day: nowDate.getDate()
|
|
}
|
|
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day)
|
|
getUserByDeptSid({ deptSid: this.formobj.deptSid }).then((respsone) => {
|
|
if (respsone.success) {
|
|
this.tech_list = respsone.data
|
|
}
|
|
})
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => {
|
|
if (resp.success) {
|
|
this.formobj.useOrgSid = resp.data
|
|
fetchBySid(resp.data).then((respsone) => {
|
|
if (respsone.success) {
|
|
this.formobj.useOrgName = respsone.data.name
|
|
}
|
|
})
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
showEdit(row) {
|
|
this.viewTitle = '【编辑】维修技师职称备案申请'
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
req.fetchDetailsBySid(row.sid).then((res) => {
|
|
if (res.success) {
|
|
this.formobj = res.data
|
|
this.formobj.instanceId = res.data.procInstId
|
|
getUserByDeptSid({ deptSid: this.formobj.deptSid }).then((respsone) => {
|
|
if (respsone.success) {
|
|
this.tech_list = respsone.data
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleDelete(index) {
|
|
this.formobj.asTechTitleDetailDetailsList.splice(index, 1)
|
|
},
|
|
techChange(value, row) {
|
|
const aa = []
|
|
if (value.length > 0) {
|
|
this.tech_list.forEach((e) => {
|
|
value.forEach((k) => {
|
|
if (e.sid === k) {
|
|
aa.push(e.name)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
row.techNames = aa
|
|
},
|
|
saveOrUpdate() {
|
|
if (this.formobj.asTechTitleDetailDetailsList.length === 0) {
|
|
this.$message({ showClose: true, type: 'error', message: '维修技师职称备案列表不能为空' })
|
|
return
|
|
}
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.saveOrUpdate(this.formobj).then((res) => {
|
|
if (res.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
submit() {
|
|
if (this.formobj.asTechTitleDetailDetailsList.length === 0) {
|
|
this.$message({ showClose: true, type: 'error', message: '维修技师职称备案列表不能为空' })
|
|
return
|
|
}
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.submit(this.formobj).then((res) => {
|
|
if (res.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '提交成功' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleReturn(isreload) {
|
|
if (isreload === 'true') this.$emit('reloadlist')
|
|
this.formobj = {
|
|
sid: '',
|
|
remarks: '',
|
|
createBySid: '',
|
|
createTime: '',
|
|
billNo: '',
|
|
createByName: '',
|
|
deptSid: '',
|
|
deptName: '',
|
|
useOrgSid: '',
|
|
useOrgName: '',
|
|
finishTime: '',
|
|
procInstId: '',
|
|
procDefId: '',
|
|
taskId: '',
|
|
nodeId: '',
|
|
nodeState: '',
|
|
asTechTitleDetailDetailsList: [],
|
|
asTechTitleApplyFileList: []
|
|
}
|
|
this.submitdisabled = false
|
|
this.$emit('doback')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.span-sty {
|
|
width: 130px !important;
|
|
}
|
|
.addinputInfo {
|
|
margin-left: 120px !important;
|
|
}
|
|
/deep/ .el-form-item__error {
|
|
margin-left: 120px !important;
|
|
}
|
|
</style>
|
|
|