|
@@ -32,6 +32,33 @@
|
|
|
:readonly="readonly"
|
|
:readonly="readonly"
|
|
|
@refresh="loadData"
|
|
@refresh="loadData"
|
|
|
@close="() => showAdjustEdit = false" />
|
|
@close="() => showAdjustEdit = false" />
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="拒绝原因"
|
|
|
|
|
+ :visible.sync="rejectdialogVisible"
|
|
|
|
|
+ style="padding: 10px;"
|
|
|
|
|
+ top="5vh"
|
|
|
|
|
+ width="50%"
|
|
|
|
|
+ class="dialog adjust-dialog"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form class="adjust-form">
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="rejectReason"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :rows="4"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ :maxlength="256"
|
|
|
|
|
+ placeholder="请输入拒绝原因"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="rejectdialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleRejectConfirm">确定拒绝</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -40,7 +67,6 @@ import { queryAdjustment, removeAdjustment, saveAdjustment, sendMessage, getStaf
|
|
|
import { stateType } from '@/views/constants/schedule'
|
|
import { stateType } from '@/views/constants/schedule'
|
|
|
import ActionUtils from '@/utils/action'
|
|
import ActionUtils from '@/utils/action'
|
|
|
import FixHeight from '@/mixins/height'
|
|
import FixHeight from '@/mixins/height'
|
|
|
-import { status } from '@/api/platform/job/scheduler'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -64,6 +90,10 @@ export default {
|
|
|
showAgreeBtnList: [],
|
|
showAgreeBtnList: [],
|
|
|
readonly: false,
|
|
readonly: false,
|
|
|
params: {},
|
|
params: {},
|
|
|
|
|
+ ismass: false, // 标记是否批量操作
|
|
|
|
|
+ rejectdialogVisible: false,
|
|
|
|
|
+ rejectReason: '',
|
|
|
|
|
+ currentRejectData: {}, // 当前拒绝单据
|
|
|
listConfig: {
|
|
listConfig: {
|
|
|
/* toolbars: [
|
|
/* toolbars: [
|
|
|
{ key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary', hidden: false },
|
|
{ key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary', hidden: false },
|
|
@@ -389,12 +419,26 @@ export default {
|
|
|
// '待审批' 状态则直接通过
|
|
// '待审批' 状态则直接通过
|
|
|
return '已通过'
|
|
return '已通过'
|
|
|
},
|
|
},
|
|
|
|
|
+ // 拒绝dialog-确定
|
|
|
|
|
+ handleRejectConfirm () {
|
|
|
|
|
+ let data = this.currentRejectData
|
|
|
|
|
+ if (this.ismass) { // 批量拒绝
|
|
|
|
|
+ data.forEach((el) => {
|
|
|
|
|
+ el.rejectReason = this.rejectReason
|
|
|
|
|
+ })
|
|
|
|
|
+ this.updateMassData('disagree', data)
|
|
|
|
|
+ this.rejectdialogVisible = false
|
|
|
|
|
+ } else { // 单条拒绝
|
|
|
|
|
+ data.rejectReason = this.rejectReason
|
|
|
|
|
+ this.updateData('disagree', data, '已拒绝')
|
|
|
|
|
+ this.rejectdialogVisible = false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
- * 处理单条同意/不同意
|
|
|
|
|
|
|
+ * 单条同意/不同意请求
|
|
|
*/
|
|
*/
|
|
|
- async handleAgree (key, data) {
|
|
|
|
|
- // console.log(data)
|
|
|
|
|
- data.status = (key === 'agree' ? this.isNextStep(data) : '已拒绝')
|
|
|
|
|
|
|
+ updateData (key, data, statusval) {
|
|
|
|
|
+ data.status = statusval
|
|
|
// 改为通用接口
|
|
// 改为通用接口
|
|
|
const tableName = 't_adjustment'
|
|
const tableName = 't_adjustment'
|
|
|
const updateParams = {
|
|
const updateParams = {
|
|
@@ -406,6 +450,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
param: {
|
|
param: {
|
|
|
status: data.status,
|
|
status: data.status,
|
|
|
|
|
+ reject_reason_: data.rejectReason,
|
|
|
execute_date_: data.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
execute_date_: data.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
|
}
|
|
}
|
|
|
}]
|
|
}]
|
|
@@ -423,6 +468,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
param: {
|
|
param: {
|
|
|
status_: key === 'agree' ? '已通过' : '已拒绝',
|
|
status_: key === 'agree' ? '已通过' : '已拒绝',
|
|
|
|
|
+ // reject_reason_: data.rejectReason,
|
|
|
audit_time_: data.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
audit_time_: data.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
|
}
|
|
}
|
|
|
}]
|
|
}]
|
|
@@ -437,25 +483,23 @@ export default {
|
|
|
this.sendMsg(data) // 发送系统通知
|
|
this.sendMsg(data) // 发送系统通知
|
|
|
this.search()
|
|
this.search()
|
|
|
}).catch((e) => { console.error(e) })
|
|
}).catch((e) => { console.error(e) })
|
|
|
- /*
|
|
|
|
|
- saveAdjustment(data).then(() => {
|
|
|
|
|
- ActionUtils.successMessage()
|
|
|
|
|
- if (data.status === '已通过') {
|
|
|
|
|
- this.handleAccess(data)
|
|
|
|
|
- }
|
|
|
|
|
- this.sendMsg(data) // 发送系统通知
|
|
|
|
|
- this.search()
|
|
|
|
|
- }).catch((e) => { console.error(e) })*/
|
|
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 批量处理同意/不同意
|
|
|
|
|
|
|
+ /* 点击单条同意/不同意
|
|
|
*/
|
|
*/
|
|
|
- async handleMassAgree (key, data) {
|
|
|
|
|
- // console.log(key, data)
|
|
|
|
|
- if (data.length < 1) {
|
|
|
|
|
- ActionUtils.warning('请选择数据!')
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ async handleAgree (key, data) {
|
|
|
|
|
+ // 判断状态,如果是已通过直接执行更新逻辑,如果是已拒绝则打开对话框等待填写原因后执行更新逻辑
|
|
|
|
|
+ if (key === 'agree') {
|
|
|
|
|
+ const status = this.isNextStep(data)
|
|
|
|
|
+ this.updateData(key, data, status)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.currentRejectData = data
|
|
|
|
|
+ this.rejectdialogVisible = true
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 批量同意/不同意请求
|
|
|
|
|
+ */
|
|
|
|
|
+ updateMassData (key, data) {
|
|
|
const tableName = 't_adjustment'
|
|
const tableName = 't_adjustment'
|
|
|
let uparr = []
|
|
let uparr = []
|
|
|
let sonuparr = []
|
|
let sonuparr = []
|
|
@@ -472,6 +516,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
param: {
|
|
param: {
|
|
|
status: el.status,
|
|
status: el.status,
|
|
|
|
|
+ reject_reason_: data.rejectReason,
|
|
|
execute_date_: el.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
execute_date_: el.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -482,6 +527,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
param: {
|
|
param: {
|
|
|
status_: key === 'massAgree' ? '已通过' : '已拒绝',
|
|
status_: key === 'massAgree' ? '已通过' : '已拒绝',
|
|
|
|
|
+ // reject_reason_: data.rejectReason,
|
|
|
audit_time_: el.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
audit_time_: el.status === ('已通过' || '已拒绝') ? this.getTimeNow() : ''
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -512,23 +558,11 @@ export default {
|
|
|
/**
|
|
/**
|
|
|
* 批量处理同意/不同意
|
|
* 批量处理同意/不同意
|
|
|
*/
|
|
*/
|
|
|
- async handleMassAgree (key, data, selection) {
|
|
|
|
|
|
|
+ async handleMassAgree (key, data) {
|
|
|
if (!data || data.length < 1) {
|
|
if (!data || data.length < 1) {
|
|
|
ActionUtils.warning('请选择数据!')
|
|
ActionUtils.warning('请选择数据!')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- let flag = []
|
|
|
|
|
- data = data.filter((row, index) => {
|
|
|
|
|
- if (this.showAgreeBtn(row)) {
|
|
|
|
|
- flag.push(index + 1)
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- return true
|
|
|
|
|
- })
|
|
|
|
|
- if (flag.length > 0) {
|
|
|
|
|
- this.$message.warning('所选数据中【序号:' + flag.join(',') + '】您无权限处理或已结束审核审批!')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
if (key === 'massAgree') {
|
|
if (key === 'massAgree') {
|
|
|
this.updateMassData(key, data)
|
|
this.updateMassData(key, data)
|
|
|
} else {
|
|
} else {
|
|
@@ -606,4 +640,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
-<style lang="scss"></style>
|
|
|
|
|
|
|
+<style lang="scss">
|
|
|
|
|
+ .adjust-dialog {
|
|
|
|
|
+ ::v-deep {
|
|
|
|
|
+ .el-dialog {
|
|
|
|
|
+ min-width: 1024px;
|
|
|
|
|
+ &__header {
|
|
|
|
|
+ padding: 15px 20px 16px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+.adjust-form {
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ background: #f5f5f5;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|