123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <div>
- <el-button class="inline-16" v-if="flag === 0 && tool.checkAuth($route.name,'putSubmit')" size="mini" :type="!disabled || rowData.status === '已失败' ?'':'primary'" slot="reference" @click="onSubmit" :disabled="!disabled || rowData.status === '已失败'">提交报备</el-button>
- <el-button v-if="flag === 1 && tool.checkAuth($route.name,'putCheck')" size="mini" type="primary" slot="reference" @click="onCheck" :disabled="rowData.status === '已失败'" :type="rowData.status === '已失败' ?'':'primary'">报备审核</el-button>
- <el-button class="inline-16" v-if="(flag === 2 || flag === 1) && tool.checkAuth($route.name,'putBack') " size="mini" type="primary" slot="reference" @click="onUnCheck" :disabled="rowData.status === '已失败'" :type="rowData.status === '已失败' ?'':'primary'">报备驳回(退回)</el-button>
- <!-- <el-drawer
- :visible.sync="drawer"
- append-to-body
- size="90%"
- @close="onClose"
- :with-header="false">
- <report :url="url"></report>
- </el-drawer>-->
- </div>
- </template>
- <script>
- import report from "@/HDrpManagement/projectChange/components/report";
- export default {
- name: "add",
- props:['data','rowData','flagTag','disabled'],
- components:{report},
- data(){
- return {
- butTag:'',
- drawer:false,
- url:'',
- form:{
- sa_projectid: '',
- tag: "" //报备中,已报备
- },
- flag:0, //0:未报备,1:报备中 2:报备审核
- }
- },
- methods:{
- onshow(){
- console.log(this.rowData)
- /*this.tagData()*/
- },
- onSubmit(){
- this.$confirm('确定进行提交报备操作吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async() => {
- const res = await this.$api.requested({
- "id": 20221114163402,
- "content": {
- "sa_projectid": this.rowData.sa_projectid,
- "type": 1 //报备中,已报备
- },
- })
- this.tool.showMessage(res,()=>{
- this.flag = 1
- this.$emit('putSuccess',this.flag)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消提交报备'
- });
- });
- },
- async onCheck(){
- if (JSON.parse(sessionStorage.getItem('active_account')).siteid == 'HY'){
- const res = await this.$api.requested({
- "id": 20230628155602,
- "content": {
- "sa_projectid": this.$route.query.id,
- "type":'pc'
- },
- })
- this.url = res.data
- if (this.url){
- /*this.drawer = true*/
- window.open(this.url)
- }else {
- this.$message({
- message: '无权限操作',
- type: 'warning'
- });
- }
- }else {
- this.$confirm('确定进行报备审核操作吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async() => {
- const res = await this.$api.requested({
- "id": 20221114163402,
- "content": {
- "sa_projectid": this.rowData.sa_projectid,
- "type": 2 //报备中,已报备
- },
- })
- this.tool.showMessage(res,()=>{
- this.flag = 2
- this.$emit('putSuccess',this.flag)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消报备审核'
- });
- });
- }
- },
- onUnCheck(){
- this.$confirm('确定进行报备驳回(退回)操作吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async() => {
- const res = await this.$api.requested({
- "id": 20221114163402,
- "content": {
- "sa_projectid": this.rowData.sa_projectid,
- "type": 3 //报备中,已报备
- },
- })
- this.tool.showMessage(res,()=>{
- this.flag = 0
- this.$emit('putSuccess',this.flag)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消报备驳回(退回)'
- });
- });
- },
- async tagData(){
- console.log(this.rowData.sa_projectid,"rowData数据")
- const res = await this.$api.requested({
- content: {
- ownertable: "sa_project",
- ownerid: this.rowData.sa_projectid
- },
- id: 20220929085401
- })
- console.log(res,'标签')
- if (res.data.systemtag.length === 0){
- console.log("还未有报备")
- this.flag = 0
- }else {
- for (let i=0;i<res.data.systemtag.length;i++){
- if (res.data.systemtag[i] === '报备中'){
- this.flag = 1
- break
- }else if (res.data.systemtag[i] === '已报备'){
- this.flag = 2
- break
- }else {
- this.flag = 0
- }
- }
- }
- console.log(this.flag,'报备状态')
- },
- onClose(){
- this.flag = 2
- this.$emit('putSuccess',this.flag)
- this.$emit('onClose')
- }
- },
- mounted() {
- this.flag = this.flagTag
- console.log("报备状态",this.flagTag,this.flag)
- },
- created() {
- }
- }
- </script>
- <style scoped>
- /deep/.el-select {
- width: 100%;
- }
- </style>
|