123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <el-dialog
- :title="'审批'"
- :close-on-click-modal="false"
- :before-close="closeDialog"
- :visible.sync="visible"
- :append-to-body="true"
- :modal="false"
- width="55%">
- <el-form v-model="dataForm" :inline="true">
- <div class="form-group dialog">
- <el-form-item class="full" label="审批意见" prop="auditMsg">
- <el-input type="textarea" placeholder="审批意见" v-model="dataForm.auditMsg"></el-input>
- </el-form-item>
- <el-form-item label="审批人" class="full" prop="auditUserId">
- <el-select v-model="dataForm.auditUserId" disabled placeholder="审批人" style="width: 100%;">
- <el-option
- v-for="item in optionsBranch"
- :key="item.id"
- :label="item.cname"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDia">关闭</el-button>
- <el-button @click="approvalRejected">审批驳回</el-button>
- <el-button @click="approved">审批通过</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import { listCharge } from '@/api/system/startApproval'
- import { queryUserVal } from '@/api/warehouseBusiness/agreement'
- export default {
- name: 'startApproval',
- data () {
- return {
- dataForm: {
- id: null,
- actId: null,
- auditMsg: null,
- auditUserId: this.$store.state.user.id
- },
- visible: false,
- optionsBranch: [{
- id: this.$store.state.user.id,
- cname: this.$store.state.user.actualname
- }]
- }
- },
- components: {
- },
- methods: {
- init (id,actId) {
- // 默认录入人
- queryUserVal().then((response)=>{
- this.dataForm.auditUserId = response.user.userName
- })
- this.visible = true
- if (typeof id === 'undefined' || typeof actId === 'undefined') {
- this.$message.error('未检测到对应信息,请选择')
- return false
- }
- this.dataForm.id = id
- this.dataForm.actId = actId
- },
- approved () {
- this.$confirm(`是否通过审批?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- return listCharge(this.dataForm,'/warehouse/paths/approved')
- }).then(({data}) => {
- if (data && data.code === 200) {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 600,
- onClose: () => {
- this.closeDia()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- },
- approvalRejected () {
- this.$confirm(`是否驳回审批?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- return listCharge(this.dataForm,'/warehouse/paths/approvalRejected')
- }).then(({data}) => {
- if (data && data.code === 0) {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 600,
- onClose: () => {
- this.closeDia()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- },
- closeDialog (done) {
- done()
- // location.reload()
- this.visible = false
- this.$emit('returnApproval', this.dataForm.id, false)
- Object.assign(this.$data, this.$options.data.call(this))
- },
- closeDia () {
- this.visible = false
- this.$emit('returnApproval', this.dataForm.id, false)
- Object.assign(this.$data, this.$options.data.call(this))
- }
- }
- }
- </script>
- <style scoped>
- </style>
|