华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
5.1 KiB

  1. <template>
  2. <div class="study-syxx">
  3. <div class="syxx-top" v-show="!showDetail" style="margin-bottom: 10px;">
  4. <div class="syxx-operate">
  5. <div class="operate-img"></div>
  6. <div class="operate-left">{{ $t('page.business.study.studyFormPlan.syxx') }}</div>
  7. </div>
  8. <el-form ref="form" label-width="150px">
  9. <el-row>
  10. <el-col :span="6">
  11. <el-form-item :label="$t('page.business.study.studyFormPlan.symc')">
  12. {{ studyInfo.name }}
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="6">
  16. <el-form-item :label="$t('page.business.study.studyFormPlan.sybh')">
  17. {{ studyInfo.sn }}
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="6">
  21. <el-form-item :label="$t('page.business.study.studyFormPlan.syfzr')">
  22. {{ studyInfo.leaderName }}
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-form-item :label="$t('page.business.study.studyFormPlan.cjsj')">
  27. {{ studyInfo.createTime }}
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. <el-row>
  32. <el-col :span="24">
  33. <el-form-item :label="$t('page.business.study.studyFormPlan.syjj')">
  34. {{ studyInfo.remark }}
  35. </el-form-item>
  36. </el-col>
  37. <el-col>
  38. <el-button type="primary" @click="sdsy" v-hasPermi="['business:study:sd']" v-if="(studyInfo.leader==id || checkRole(['TFM']))" :disabled="studyInfo.status>=5">{{ $t('page.business.study.studyFormPlan.sdsy') }}</el-button>
  39. </el-col>
  40. </el-row>
  41. </el-form>
  42. <div class="syxx-operate" style="margin-top: 10px;">
  43. <div class="operate-img"></div>
  44. <div class="operate-left">{{ $t('page.business.study.studyFormPlan.syxkxx') }}</div>
  45. </div>
  46. <div style="display: flex;">
  47. <div style="margin-right: 30px;" v-for="(item, index) in subjectList" :key="index">
  48. {{ item.deptName }}{{ item.leaderName }}
  49. </div>
  50. </div>
  51. </div>
  52. <div class="syxx-content" v-if="studyInfo.id&&studyInfo.id!=''">
  53. <jhbdList :study="studyInfo" @showDetail="showDetailCallback" @changeTab="changeTab" />
  54. </div>
  55. <Sign ref="syxxSignRef" @callback="doSign" />
  56. </div>
  57. </template>
  58. <script>
  59. import { checkPermi, checkRole } from "@/utils/permission";
  60. import Sign from './sign.vue'
  61. import jhbdList from './jhbdList.vue'
  62. import { study_info,study_checkSd,study_sd } from "@/api/business/study/study"
  63. import { studySubject_listByStudyId } from '@/api/business/study/studySubject'
  64. import { mapGetters } from 'vuex'
  65. export default {
  66. name: 'StudyTbbd',
  67. props: {
  68. study: {
  69. type: Object,
  70. default: () => {
  71. return {}
  72. }
  73. }
  74. },
  75. watch: {
  76. study: {
  77. immediate: true,
  78. deep:true,
  79. handler(v) {
  80. this.studyId = v.id
  81. this.getStudyInfo()
  82. }
  83. },
  84. },
  85. components: { jhbdList,Sign },
  86. computed: {
  87. ...mapGetters([
  88. 'id'
  89. ]),
  90. },
  91. data() {
  92. return {
  93. showDetail: false,
  94. studyId: '',
  95. studyInfo:{},
  96. subjectList: []
  97. }
  98. },
  99. created() {
  100. },
  101. methods: {
  102. checkPermi,
  103. checkRole,
  104. getstudySubject() {
  105. studySubject_listByStudyId({ studyId: this.studyId }).then(response => {
  106. this.subjectList = response.data;
  107. }).finally(() => {
  108. this.$modal.closeLoading()
  109. })
  110. },
  111. getStudyInfo() {
  112. this.$modal.loading()
  113. study_info({ id: this.studyId }).then(response => {
  114. this.studyInfo = response.data
  115. this.getstudySubject()
  116. }).finally(() => {
  117. this.$modal.closeLoading()
  118. })
  119. },
  120. sdsy() {
  121. this.$modal.loading()
  122. study_checkSd({
  123. study:{id:this.studyId},
  124. }).then(() => {
  125. this.$refs.syxxSignRef.show(this.$t('page.business.study.study.sdsy'),this.$t('page.business.study.study.sdsy'))
  126. }).finally(() => {
  127. this.$modal.closeLoading()
  128. })
  129. },
  130. doSign(val){
  131. this.doSd(val)
  132. },
  133. doSd(sign){
  134. this.$modal.loading()
  135. study_sd({
  136. study:{id:this.studyId},
  137. sign:sign
  138. }).then(() => {
  139. this.$refs.syxxSignRef.cancel()
  140. this.getStudyInfo()
  141. }).finally(() => {
  142. this.$modal.closeLoading()
  143. })
  144. },
  145. showDetailCallback(val) {
  146. this.showDetail = val
  147. this.$emit('showDetail', val)
  148. },
  149. changeTab(val){
  150. this.$emit('changeTab',val)
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .study-syxx {
  157. .syxx-top {
  158. background: #fff;
  159. padding: 20px;
  160. width: 100%;
  161. .syxx-operate {
  162. margin: 0px 0 10px 0;
  163. display: flex;
  164. flex-direction: row;
  165. align-items: center;
  166. color: #409eff;
  167. .operate-img {
  168. flex-shrink: 0;
  169. height: 15px;
  170. background: #409eff;
  171. width: 3px;
  172. }
  173. .operate-left {
  174. flex-shrink: 0;
  175. font-weight: bold;
  176. padding-left: 10px;
  177. }
  178. .operate-right {
  179. flex-grow: 1;
  180. text-align: right;
  181. .operate-icon {
  182. cursor: pointer;
  183. }
  184. }
  185. }
  186. }
  187. .syxx-content {
  188. }
  189. }
  190. </style>