putPeople.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div>
  3. <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>
  4. <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>
  5. <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>
  6. <!-- <el-drawer
  7. :visible.sync="drawer"
  8. append-to-body
  9. size="90%"
  10. @close="onClose"
  11. :with-header="false">
  12. <report :url="url"></report>
  13. </el-drawer>-->
  14. </div>
  15. </template>
  16. <script>
  17. import report from "@/HDrpManagement/projectChange/components/report";
  18. export default {
  19. name: "add",
  20. props:['data','rowData','flagTag','disabled'],
  21. components:{report},
  22. data(){
  23. return {
  24. butTag:'',
  25. drawer:false,
  26. url:'',
  27. form:{
  28. sa_projectid: '',
  29. tag: "" //报备中,已报备
  30. },
  31. flag:0, //0:未报备,1:报备中 2:报备审核
  32. }
  33. },
  34. methods:{
  35. onshow(){
  36. console.log(this.rowData)
  37. /*this.tagData()*/
  38. },
  39. onSubmit(){
  40. this.$confirm('确定进行提交报备操作吗?', '提示', {
  41. confirmButtonText: '确定',
  42. cancelButtonText: '取消',
  43. type: 'warning'
  44. }).then(async() => {
  45. const res = await this.$api.requested({
  46. "id": 20221114163402,
  47. "content": {
  48. "sa_projectid": this.rowData.sa_projectid,
  49. "type": 1 //报备中,已报备
  50. },
  51. })
  52. this.tool.showMessage(res,()=>{
  53. this.flag = 1
  54. this.$emit('putSuccess',this.flag)
  55. })
  56. }).catch(() => {
  57. this.$message({
  58. type: 'info',
  59. message: '已取消提交报备'
  60. });
  61. });
  62. },
  63. async onCheck(){
  64. if (JSON.parse(sessionStorage.getItem('active_account')).siteid == 'HY'){
  65. const res = await this.$api.requested({
  66. "id": 20230628155602,
  67. "content": {
  68. "sa_projectid": this.$route.query.id,
  69. "type":'pc'
  70. },
  71. })
  72. this.url = res.data
  73. if (this.url){
  74. /*this.drawer = true*/
  75. window.open(this.url)
  76. }else {
  77. this.$message({
  78. message: '无权限操作',
  79. type: 'warning'
  80. });
  81. }
  82. }else {
  83. this.$confirm('确定进行报备审核操作吗?', '提示', {
  84. confirmButtonText: '确定',
  85. cancelButtonText: '取消',
  86. type: 'warning'
  87. }).then(async() => {
  88. const res = await this.$api.requested({
  89. "id": 20221114163402,
  90. "content": {
  91. "sa_projectid": this.rowData.sa_projectid,
  92. "type": 2 //报备中,已报备
  93. },
  94. })
  95. this.tool.showMessage(res,()=>{
  96. this.flag = 2
  97. this.$emit('putSuccess',this.flag)
  98. })
  99. }).catch(() => {
  100. this.$message({
  101. type: 'info',
  102. message: '已取消报备审核'
  103. });
  104. });
  105. }
  106. },
  107. onUnCheck(){
  108. this.$confirm('确定进行报备驳回(退回)操作吗?', '提示', {
  109. confirmButtonText: '确定',
  110. cancelButtonText: '取消',
  111. type: 'warning'
  112. }).then(async() => {
  113. const res = await this.$api.requested({
  114. "id": 20221114163402,
  115. "content": {
  116. "sa_projectid": this.rowData.sa_projectid,
  117. "type": 3 //报备中,已报备
  118. },
  119. })
  120. this.tool.showMessage(res,()=>{
  121. this.flag = 0
  122. this.$emit('putSuccess',this.flag)
  123. })
  124. }).catch(() => {
  125. this.$message({
  126. type: 'info',
  127. message: '已取消报备驳回(退回)'
  128. });
  129. });
  130. },
  131. async tagData(){
  132. console.log(this.rowData.sa_projectid,"rowData数据")
  133. const res = await this.$api.requested({
  134. content: {
  135. ownertable: "sa_project",
  136. ownerid: this.rowData.sa_projectid
  137. },
  138. id: 20220929085401
  139. })
  140. console.log(res,'标签')
  141. if (res.data.systemtag.length === 0){
  142. console.log("还未有报备")
  143. this.flag = 0
  144. }else {
  145. for (let i=0;i<res.data.systemtag.length;i++){
  146. if (res.data.systemtag[i] === '报备中'){
  147. this.flag = 1
  148. break
  149. }else if (res.data.systemtag[i] === '已报备'){
  150. this.flag = 2
  151. break
  152. }else {
  153. this.flag = 0
  154. }
  155. }
  156. }
  157. console.log(this.flag,'报备状态')
  158. },
  159. onClose(){
  160. this.flag = 2
  161. this.$emit('putSuccess',this.flag)
  162. this.$emit('onClose')
  163. }
  164. },
  165. mounted() {
  166. this.flag = this.flagTag
  167. console.log("报备状态",this.flagTag,this.flag)
  168. },
  169. created() {
  170. }
  171. }
  172. </script>
  173. <style scoped>
  174. /deep/.el-select {
  175. width: 100%;
  176. }
  177. </style>