按钮修改

This commit is contained in:
a0049873 2022-07-21 09:57:47 +08:00
parent 30afa74344
commit 578c941f1c
2 changed files with 130 additions and 77 deletions

View File

@ -36,7 +36,9 @@
<div class="agreeOr"> <div class="agreeOr">
<h3>审批</h3> <h3>审批</h3>
<div> <div>
<el-radio-group v-model="agreeOrList" style="width: 230px"> <el-button type="primary" @click="showDialog('同意')">同意</el-button>
<el-button type="danger" plain @click="showDialog('拒绝')">拒绝</el-button>
<!-- <el-radio-group v-model="agreeOrList" style="width: 230px">
<el-radio-button label="同意" class="blueAll">同意</el-radio-button> <el-radio-button label="同意" class="blueAll">同意</el-radio-button>
<el-radio-button label="退回" class="redAll">退回</el-radio-button> <el-radio-button label="退回" class="redAll">退回</el-radio-button>
</el-radio-group> </el-radio-group>
@ -54,9 +56,20 @@
class="inputBule" class="inputBule"
@click.native="agreeOrNot($store.state.contentTabsActiveName)" @click.native="agreeOrNot($store.state.contentTabsActiveName)"
>提交</el-button >提交</el-button
> > -->
</div> </div>
</div> </div>
<el-dialog
title="审批意见"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-input v-model="input" placeholder="请输入审批意见"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose2"> </el-button>
<el-button type="primary" @click="agreeOrNot()"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -81,6 +94,9 @@ export default {
}, },
data () { data () {
return { return {
dialogVisible: false,
dialogType: '',
input: '',
flagShow: false, flagShow: false,
// processVisible: true, // processVisible: true,
visible: false, visible: false,
@ -135,6 +151,22 @@ export default {
} }
}) })
}, },
showDialog (title) {
this.dialogVisible = true
this.dialogType = title
},
handleClose (done) {
this.$confirm('确认关闭?')
.then(_ => {
this.input = ''
done()
})
.catch(_ => {})
},
handleClose2 () {
this.dialogVisible = false
this.input = ''
},
methodsThree () { methodsThree () {
this.$http.get('/category/getCategoryTree').then((res) => { this.$http.get('/category/getCategoryTree').then((res) => {
this.insertList = res.data.data this.insertList = res.data.data
@ -152,19 +184,16 @@ export default {
// } // }
}) })
}, },
agreeOrNot: debounce( // 退
function (data) { agreeOrNot: debounce(function () {
console.log(data) if (this.dialogType === '同意') {
if (this.agreeOrList === '同意') { console.log('this.dataForm', this.dataForm)
console.log('this.dataForm.taskId', this.taskId)
const params = qs.stringify({ const params = qs.stringify({
taskId: this.taskId, taskId: this.dataForm.taskId,
comment: this.inputAgree comment: this.input
}) })
console.log(params) console.log(params)
this.$http this.$http.post('/act/task/complete?' + params).then(({ data: res }) => {
.post('/act/task/complete?' + params)
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.$message.error(res.msg) this.$message.error(res.msg)
if (this.callbacks.taskHandleErrorCallback) { if (this.callbacks.taskHandleErrorCallback) {
@ -183,17 +212,13 @@ export default {
} }
} }
}) })
}) }).catch(() => {})
.catch(() => {}) } else if (this.dialogType === '拒绝') {
} else if (this.agreeOrList === '退回') {
console.log('this.dataForm.taskId', this.taskId)
const params = qs.stringify({ const params = qs.stringify({
taskId: this.taskId, taskId: this.dataForm.taskId,
comment: this.inputNo comment: this.input
}) })
this.$http this.$http.post('/act/task/backToFirst?', params).then(({ data: res }) => {
.post('/act/task/backToFirst?', params)
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.$message.error(res.msg) this.$message.error(res.msg)
if (this.callbacks.taskHandleErrorCallback) { if (this.callbacks.taskHandleErrorCallback) {
@ -214,11 +239,7 @@ export default {
}) })
}) })
} }
this.tabRemoveHandle(data) }, 1000, { leading: true, trailing: false }),
},
1000,
{ leading: true, trailing: false }
),
tabRemoveHandle (tabName) { tabRemoveHandle (tabName) {
console.log(tabName, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') console.log(tabName, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
if (tabName === 'home') { if (tabName === 'home') {

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-29 15:59:51 * @Date: 2022-06-29 15:59:51
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-04 16:17:22 * @LastEditTime: 2022-07-21 09:39:13
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<!-- 流程业务表单 --> <!-- 流程业务表单 -->
@ -61,18 +61,31 @@
<div class="agreeOr"> <div class="agreeOr">
<h3>审批</h3> <h3>审批</h3>
<div> <div>
<el-radio-group v-model="agreeOrList" style="width:230px;"> <!-- <el-radio-group v-model="agreeOrList" style="width:230px;">
<el-radio-button label="同意" class="blueAll">同意</el-radio-button> <el-radio-button label="同意" class="blueAll" @click="showDialog('同意')">同意</el-radio-button>
<el-radio-button label="退回" class="redAll">退回</el-radio-button> <el-radio-button label="退回" class="redAll" @click="showDialog('退回')">退回</el-radio-button>
</el-radio-group> </el-radio-group> -->
<el-input v-if="agreeOrList ==='同意' " v-model="inputAgree" placeholder="请输入同意意见"></el-input> <el-button type="primary" @click="showDialog('同意')">同意</el-button>
<el-button type="danger" plain @click="showDialog('拒绝')">拒绝</el-button>
<!-- <el-input v-if="agreeOrList ==='同意' " v-model="inputAgree" placeholder="请输入同意意见"></el-input>
<el-input v-if="agreeOrList ==='退回'" v-model="inputNo" placeholder="请输入退回意见"></el-input> <el-input v-if="agreeOrList ==='退回'" v-model="inputNo" placeholder="请输入退回意见"></el-input>
<el-button class="inputBule" @click="agreeOrNot">提交</el-button> <el-button class="inputBule" @click="agreeOrNot">提交</el-button> -->
</div> </div>
</div> </div>
<!-- 流程详情 --> <!-- 流程详情 -->
<ren-process-detail></ren-process-detail> <ren-process-detail></ren-process-detail>
<el-dialog
title="审批意见"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-input v-model="input" placeholder="请输入审批意见"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose2"> </el-button>
<el-button type="primary" @click="agreeOrNot()"> </el-button>
</span>
</el-dialog>
</el-card> </el-card>
</template> </template>
@ -87,6 +100,9 @@ export default {
mixins: [processModule], mixins: [processModule],
data () { data () {
return { return {
dialogVisible: false,
dialogType: '',
input: '',
visible: true, visible: true,
showKey: 0, showKey: 0,
// //
@ -156,6 +172,22 @@ export default {
} }
}) })
}, },
showDialog (title) {
this.dialogVisible = true
this.dialogType = title
},
handleClose (done) {
this.$confirm('确认关闭?')
.then(_ => {
this.input = ''
done()
})
.catch(_ => {})
},
handleClose2 () {
this.dialogVisible = false
this.input = ''
},
downloadFile2 (url) { downloadFile2 (url) {
console.log(window.SITE_CONFIG.previewUrl) console.log(window.SITE_CONFIG.previewUrl)
window.open( window.open(
@ -228,11 +260,11 @@ export default {
}, },
// 退 // 退
agreeOrNot: debounce(function () { agreeOrNot: debounce(function () {
if (this.agreeOrList === '同意') { if (this.dialogType === '同意') {
console.log('this.dataForm', this.dataForm) console.log('this.dataForm', this.dataForm)
const params = qs.stringify({ const params = qs.stringify({
taskId: this.dataForm.taskId, taskId: this.dataForm.taskId,
comment: this.inputAgree comment: this.input
}) })
console.log(params) console.log(params)
this.$http.post('/act/task/complete?' + params).then(({ data: res }) => { this.$http.post('/act/task/complete?' + params).then(({ data: res }) => {
@ -255,10 +287,10 @@ export default {
} }
}) })
}).catch(() => {}) }).catch(() => {})
} else if (this.agreeOrList === '退回') { } else if (this.dialogType === '拒绝') {
const params = qs.stringify({ const params = qs.stringify({
taskId: this.dataForm.taskId, taskId: this.dataForm.taskId,
comment: this.inputNo comment: this.input
}) })
this.$http.post('/act/task/backToFirst?', params).then(({ data: res }) => { this.$http.post('/act/task/backToFirst?', params).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {