| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <template>
- <div>
- <el-dialog title="提交初审"
- :close-on-click-modal="false"
- :visible.sync="dialogVisibleCom"
- width="520px">
- <el-form ref="searchForm"
- label-width="100px">
- <el-row>
- <el-col :span="24">
- <el-form-item label="初审人员">
- <el-select ref="selectAuditer"
- v-model="auditer"
- placeholder="请选择初审人"
- style="width: 100%"
- filterable
- default-first-option
- @change="auditOrgChang()">
- <el-option v-for="item in firOptions"
- :key="item.Id"
- :label="item.Realname"
- :value="item.Id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="复审人员">
- <el-select ref="selectAuditer"
- v-model="fushenauditer"
- placeholder="请选择复审人"
- style="width: 100%"
- filterable
- default-first-option>
- <el-option v-for="item in secauditerOptions"
- :key="item.Id"
- :label="item.Realname"
- :value="item.Id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="专业处室">
- <el-select v-model="selectDept"
- filterable
- placeholder="请选择"
- style="width: 100%"
- @change="changeOrgUnit">
- <el-option v-for="item in allorgunitOptions"
- :key="item.Id"
- :label="item.Fullname"
- :value="item.Id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="备注">
- <el-input v-model="auditform.AuditRemark"
- type="textarea"
- placeholder="请输入备注内容">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <span slot="footer"
- class="dialog-footer">
- <el-button size="mini"
- @click="dialogVisibleCom = false">取 消</el-button>
- <el-button size="mini"
- type="primary"
- @click="secondaryUnitSubmitApply" :loading="loading">确定</el-button>
- </span>
- </el-dialog>
- <!-- 复审 -->
- <el-dialog title="审核" :close-on-click-modal="false" :visible.sync="dialogCommonAuditMakeSureVisible">
- <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
- <el-form-item label="审核状态">
- <template>
- <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1" @change="radioChange">通过</el-radio>
- <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="0" @change="radioChange">退回</el-radio>
- </template>
- </el-form-item>
- <el-form-item label="意见" :rules="[{ required: true, message: '请输入审批意见', trigger: 'blur' }]">
- <el-input type="textarea" v-model="shenheForm.AuditorRemark" :placeholder="textplaceholder">
- </el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer" style="margin-top: -25px">
- <el-button size="small" @click="dialogCommonAuditMakeSureVisible = false">取 消</el-button>
- <el-button type="primary" size="small" @click="commonAuditMakeSure()" :loading="btnloading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 专业科室接收 -->
- <el-dialog title="分配" :close-on-click-modal="false" :visible.sync="dialogBusinessOfficeSeparateAuditVisible">
- <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
- <el-form-item label="审批人">
- <el-select ref="selectAuditer" v-model="ProfessionalAudit" placeholder="请选择" style="width: 100%" filterable
- default-first-option>
- <el-option v-for="item in secauditerOptions" :key="item.Id" :label="item.Realname" :value="item.Id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="意见">
- <el-input type="textarea" v-model="shenheForm.AuditorRemark" placeholder="请输入审核意见"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer" style="margin-top: -25px">
- <el-button size="small" @click="dialogBusinessOfficeSeparateAuditVisible = false">取 消</el-button>
- <el-button type="primary" size="small" @click="businessOfficeSeparateAuditMakeSure()" :loading="btnloading">确
- 定
- </el-button>
- </div>
- </el-dialog>
- <!-- 专业科室接收 批量审批 -->
- <el-dialog title="分配" :close-on-click-modal="false" :visible.sync="dialogBusinessOfficeSeparateBatchAuditVisible">
- <el-form :model="shenheForm" label-width="100px" ref="shenheForm">
- <el-form-item label="审批人">
- <el-select ref="selectAuditer" v-model="ProfessionalAudit" placeholder="请选择" style="width: 100%" filterable
- default-first-option>
- <el-option v-for="item in secauditerOptions" :key="item.Id" :label="item.Realname" :value="item.Id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="意见">
- <el-input type="textarea" v-model="shenheForm.AuditorRemark" placeholder="请输入审核意见"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer" style="margin-top: -25px">
- <el-button size="small" @click="dialogBusinessOfficeSeparateBatchAuditVisible = false">取 消</el-button>
- <el-button type="primary" size="small" @click="businessOfficeSeparateBatchAuditMakeSure()" :loading="btnloading">确
- 定
- </el-button>
- </div>
- </el-dialog>
- <choose-auditor-fen ref="chooseAuditorFen"
- @close="setAuditerFen"
- @hideChooseAuditer="chooseAuditorVisibleFen=false"
- :visible="chooseAuditorVisibleFen"></choose-auditor-fen>
- </div>
- </template>
- <script>
- import {mapGetters} from 'vuex'
- import ChooseAuditorFen from '@/components/oilsupplier/chooseauditorfenban'
- import api from '@/api/oilsupplier/supplier'
- import apiCert from '@/api/oilsupplier/suppliercert'
- import apiOilcontract from '@/api/oilcontract/contract'
- export default {
- computed: {
- ...mapGetters({
- authUser: 'authUser'
- })
- },
- name: 'submitPopup',
- components: {
- ChooseAuditorFen
- },
- props: {
- // 从合同进来还是从编辑进来 1合同2编辑
- eveId: {
- type: null,
- default: 0
- },
- formData: {
- type: Object,
- default: function () {
- return {}
- }
- },
- examineType: {
- type: Number,
- default: 0
- },
- selectDeptBoolean: {
- type: Boolean,
- default: true
- },
- selectDeptBoolean2: {
- type: Boolean,
- default: false
- }
- },
- data () {
- return {
- dialogVisibleCom: false, // 初审
- dialogCommonAuditMakeSureVisible: false, // 复审
- dialogBusinessOfficeSeparateAuditVisible: false, // 专业科室接收
- dialogBusinessOfficeSeparateBatchAuditVisible: false, // 专业科室接收批量审批
- chooseAuditorVisibleFen: false,
- auditer: '',
- auditerName: '',
- firOptions: [],
- fushenauditer: '', // 复审人员
- selectDept: this.selectDeptBoolean2 ? 100000662 : (this.selectDeptBoolean ? 100000653 : ''),
- allorgunitOptions: [],
- auditform: {
- FirstAuditName: '',
- SecondAudit: '',
- ThirdAudit: '',
- CertId: '',
- AuditRemark: '',
- TypeCode: '02'
- },
- majorDept: [100000000, 100000004, 100000662],
- // 复审的变量
- shenheForm: {
- SuccessStatus: 1,
- AuditorRemark: '',
- AppendId: 0,
- Auditer: '',
- MajorDept: ''
- },
- btnloading: false,
- textplaceholder: '审核意见须具体、明确(含企业资质、资信、能力等内容)',
- // 专业科室接收
- ProfessionalAudit: '',
- secauditerOptions: [],
- loading: false,
- UnitOrgOptions: [],
- UnitOrg: ''
- }
- },
- created () {
- console.log(this.eveId, 'eveId')
- this.getFirAuditerByDept()
- this.getDictOptions()
- this.orgtreeChange(this.majorDept)
- },
- methods: {
- // 专业科室接收
- // 数据
- auditOrgChange () {
- let auditstepcode = ''
- if (this.formData.Status === '1') {
- auditstepcode = 'SECOND_TRIAL'
- } else if (this.formData.Status === '3') {
- auditstepcode = 'PROF_AUDIT'
- } else if (this.formData.Status === '10') {
- auditstepcode = 'SECOND_TRIAL'
- } else {
- return
- }
- api.getAuditerByDept(this.authUser.Profile.DepartmentId, auditstepcode, this.$axios).then(res => {
- this.secauditerOptions = res.data.item
- }).catch(err => {
- console.error(err)
- })
- },
- // 业务处室分办 单条(待办入口)
- businessOfficeSeparateAuditMakeSure () {
- if (this.ProfessionalAudit === '') {
- this.$message({
- type: 'warning',
- message: '请选择审批人!'
- })
- return
- }
- let params = {
- ProfessionalAudit: this.ProfessionalAudit,
- AuditRemark: this.shenheForm.AuditorRemark
- }
- this.btnloading = true
- console.log('业务处室专业审批, 提交参数: ', params)
- let _this = this
- var apiName = ['businessSeparateAudit', 'businessSeparateAuditYear']
- apiOilcontract[apiName[this.examineType]](this.formData.Id, params, this.$axios).then(res => {
- if (res.data.code === 0) {
- console.log('审批提交,成功返回')
- this.$message({
- type: 'success',
- message: res.data.message
- })
- setTimeout(function () {
- _this.$nextTick(() => {
- _this.$emit('refreshPage', {})
- // TODO loading
- })
- }, 5000)
- // _this.$refs['WfHistory'].getHistoryTask()
- } else {
- this.$message({
- type: 'warning',
- message: res.data.message
- })
- }
- _this.dialogBusinessOfficeSeparateAuditVisible = false
- _this.btnloading = false
- }).catch(err => {
- console.error(err)
- })
- },
- // 日常评价业务处室分办 批量审批
- businessOfficeSeparateBatchAuditMakeSure () {
- if (this.ProfessionalAudit === '') {
- this.$message({
- type: 'warning',
- message: '请选择审批人!'
- })
- return
- }
- let params = {
- ProfessionalAudit: this.ProfessionalAudit,
- AuditRemark: this.shenheForm.AuditorRemark
- }
- this.btnloading = true
- let _this = this
- apiOilcontract['businessSeparateAudit'](this.eveId, params, this.$axios).then(res => {
- if (res.data.code === 0) {
- this.$message({
- type: 'success',
- message: res.data.message
- })
- setTimeout(function () {
- _this.$nextTick(() => {
- _this.$emit('refreshPage', {})
- // TODO loading
- })
- }, 5000)
- } else {
- this.$message({
- type: 'warning',
- message: res.data.message
- })
- }
- _this.dialogBusinessOfficeSeparateBatchAuditVisible = false
- _this.btnloading = false
- }).catch(err => {
- console.error(err)
- })
- },
- // 复审的方法。。。。。。。。。。。。。。。
- // 选择审批选项
- radioChange () {
- if (this.shenheForm.SuccessStatus === 1) {
- // this.textplaceholder = '审核意见须具体、明确(含企业资质、资信、能力等内容)'
- if (this.formData.Status === '5') {
- this.textplaceholder = '请填写审批意见'
- } else {
- this.textplaceholder = '审核意见须具体、明确(含企业资质、资信、能力等内容)'
- }
- } else {
- if (this.formData.Status === '5') {
- this.textplaceholder = ''
- } else {
- this.textplaceholder = '退回意见不能少于2个字'
- }
- this.shenheForm.AuditorRemark = ''
- }
- },
- // 确定提交
- commonAuditMakeSure () {
- let checkRes = this.commonAuditParamsCheck()
- console.log('审批结果公共提交,参数检查结果', checkRes)
- if (!checkRes) {
- return false
- }
- this.btnloading = true
- let params = {
- result: this.shenheForm.SuccessStatus,
- AuditRemark: this.shenheForm.AuditorRemark
- }
- console.log('审批结果提交参数:', params)
- let _this = this
- var apiName = ['contractCommonAudit', 'contractCommonAuditYear']
- apiOilcontract[apiName[this.examineType]](this.eveId, params, this.$axios).then(res => {
- if (res.data.code === 0) {
- console.log('审批提交,成功返回')
- this.$message({
- type: 'success',
- message: res.data.message
- })
- setTimeout(function () {
- _this.$nextTick(() => {
- _this.$emit('refreshPage', {})
- // TODO loading
- })
- }, 5000)
- } else {
- this.$message({
- type: 'warning',
- message: res.data.message
- })
- }
- _this.dialogCommonAuditMakeSureVisible = false
- _this.btnloading = false
- }).catch(err => {
- console.error(err)
- _this.btnloading = false
- })
- },
- commonAuditParamsCheck () {
- if (this.shenheForm.SuccessStatus === 1) {
- if ((!this.auditer || this.auditer === 0) && (this.formData.Status == '0' || this.formData.Status == '10' || this.formData.Status == '3')) {
- this.$message({
- type: 'warning',
- message: '请选择审核人!'
- })
- return
- }
- if (this.formData.Status == '10') {
- if (!this.fushenauditer || this.fushenauditer === 0) {
- this.$message({
- type: 'warning',
- message: '请选择复审人!'
- })
- return
- }
- if ((this.formData.InStyle != '2' && this.formData.InStyle != '6' && this.formData.InStyle != '4') && (this.formData.inStyle == '3' && this.MgrUnit)) {
- if (this.selectDept === 0 || this.selectDept == '') {
- this.$message({
- type: 'warning',
- message: '请选择专业处室!'
- })
- return
- }
- }
- if ((this.formData.InStyle != '2' && this.formData.InStyle != '6' && this.formData.InStyle != '4') && (this.formData.inStyle == '3' && this.MgrUnit)) {
- if (this.userOptions == null || this.userOptions.length === 0) {
- this.$message({
- type: 'warning',
- message: '该专业科室未配置接收人!'
- })
- return
- }
- }
- }
- if (this.shenheForm.AuditorRemark.trim().length < 2 && this.formData.Status !== '3' && this.formData
- .Status !== '5' && this.formData.Status !== '10') {
- this.$message({
- type: 'warning',
- message: '审批意见不能少于2个字!'
- })
- return false
- }
- if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
- this.$message({
- type: 'warning',
- message: '请填写审批意见!'
- })
- return false
- }
- } else {
- if (this.formData.Status === '10') {
- this.shenheForm.AuditorRemark = this.backRemark
- }
- if (this.shenheForm.AuditorRemark.trim().length < 2 && this.formData.Status !== '3' && this.formData
- .Status !== '5') {
- this.$message({
- type: 'warning',
- message: '退回意见不能少于2个字!'
- })
- return
- }
- if (this.shenheForm.AuditorRemark.trim().length < 1 && this.formData.Status === '5') {
- this.$message({
- type: 'warning',
- message: '请填写退回意见!'
- })
- return false
- }
- }
- return true
- },
- // 。。。。
- setAuditerFen (val, name) {
- this.auditer = val
- this.auditerName = name
- this.chooseAuditorVisibleFen = false
- this.auditOrgChang(this.auditer)
- },
- orgtreeChange (val) {
- this.userOptions = []
- console.log(val, '22222222')
- let deptid = val[val.length - 1]
- let auditstepcode = 'PROF_RECE'
- api.getAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
- console.log('专业处室人111', res)
- this.userOptions = res.data.item
- }).catch(err => {
- console.error(err)
- })
- },
- getFirAuditerByDept () {
- console.log('submitPopup')
- let deptId = this.authUser.Profile.DepartmentId
- this.userOptions = []
- let auditStepCode = 'FIRST_TRIAL' // 初审人
- api.getFirAuditerByDept(deptId, auditStepCode, this.$axios).then(res => {
- this.firOptions = res.data.item
- }).catch(err => {
- console.error(err)
- })
- },
- secondaryUnitSubmitApply (val) {
- if (!this.auditer) {
- this.$message({
- type: 'warning',
- message: '请选择审批人!'
- })
- return false
- }
- if (!this.fushenauditer) {
- this.$message({
- type: 'warning',
- message: '请选择复审人!'
- })
- return false
- }
- if (!this.selectDept) {
- this.$message({
- type: 'warning',
- message: '请选择专业处室!'
- })
- return false
- }
- if (!this.userOptions || this.userOptions.length === 0) {
- this.$message({
- type: 'warning',
- message: '该专业科室未配置接收人!'
- })
- return false
- }
- this.loading = true
- // this.applyLoading = true
- let params = {
- 'FirstAudit': String(this.auditer),
- 'SecondAudit': String(this.fushenauditer),
- 'ThirdAudit': String(this.selectDept), // this.majorDept[this.majorDept.length - 1] 专业处室部门id
- 'AuditRemark': this.auditform.AuditRemark
- }
- var apiName = ['contractUnitAudit', 'contractUnitAuditYear']
- apiOilcontract[apiName[this.examineType]](this.eveId, params, this.$axios).then(res => {
- if (res.data.code === 0) {
- // 保存成功后,初始化数据,变成修改
- // this.initDatas()
- // if (this.$refs['WfHistory']) {
- // this.$refs['WfHistory'].getHistoryTask()
- // }
- this.$parent.showIdDatas(this.eveId);
- this.dialogVisibleCom = false
- this.$message({
- type: 'success',
- message: res.data.message
- })
- } else {
- this.$message({
- type: 'warning',
- message: res.data.message
- })
- }
- // this.applyLoading = false
- this.loading = false
- }).catch(err => {
- console.error(err)
- })
- },
- auditOrgChang () {
- let auditstepcode = 'SECOND_TRIAL'
- api
- .getAuditerByFirst(this.auditer, auditstepcode, this.$axios)
- .then(res => {
- this.secauditerOptions = res.data.item
- })
- .catch(err => {
- console.error(err)
- })
- },
- changeOrgUnit (val) {
- let auditstepcode = 'PROF_RECE'
- api.getAuditerByDept(val, auditstepcode, this.$axios).then(res => {
- console.log('专业处室人222', res)
- this.userOptions = res.data.item
- }).catch(err => {
- console.error(err)
- })
- },
- getDictOptions () {
- let params = {
- status: this.formData.Status,
- majorAduit: this.formData.ThirdAudit
- }
- api.getDictListByStatus(params, this.$axios).then(res => {
- this.dictData = res.data.items
- this.orgtreelist = window.toolfun_gettreejson(res.data.items['ProOrgList'], 'id', 'pId', 'id,name')
- var selectID = res.data.items['Register'].CheckUnitId
- var item = res.data.items['UnitOrgList'].find(n => n.Id == selectID)
- var list = res.data.items['UnitOrgList'].filter(n => n.Id != selectID)
- if (item != null && item != undefined) {
- list.unshift(item)
- }
- this.UnitOrgOptions = list
- // this.UnitOrgOptions = res.data.items['UnitOrgList']
- // this.UnitOrg = res.data.items['Register'].CheckUnitId
- this.allorgunitOptions = res.data.items['Allunitorglist']
- this.orgunitChange(this.UnitOrg)
- // this.auditerOptions = res.data.items['Auditer']
- // this.organizeOption = res.data.items['Organizes']
- }).catch(err => {
- console.error(err)
- })
- },
- orgunitChange (val) {
- if (!val) {
- return false
- }
- let deptid = val
- let auditstepcode = 'SUB_OFFICE_JS'
- api.getAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
- this.orgauditOptions = res.data.item
- }).catch(err => {
- console.error(err)
- })
- },
- companySubmitToSecUnitSeparateMakeSure () {
- if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
- this.$message({
- type: 'warning',
- message: '该单位没有分办人员!'
- })
- return
- }
- this.applyLoading = true
- this.auditform.UnitId = this.UnitOrg
- this.auditform.CertId = this.certId
- this.loading = true
- console.log('企业用户提交参数', this.auditform)
- apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios)
- .then(res => {
- if (res.data.code === 0) {
- // 保存成功后,初始化数据,变成修改
- this.initDatas()
- this.isAccess()
- this.dialogVisibleCom = false
- this.$message({
- type: 'success',
- message: res.data.message
- })
- } else {
- this.$message({
- type: 'warning',
- message: res.data.message
- })
- }
- this.loading = false
- })
- .catch(err => {
- console.error(err)
- })
- }
- }
- }
- </script>
- <style scoped="scoped">
- </style>
|