华西海圻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.

197 lines
5.0 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="90px">
  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'])) && 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">
  53. <jhbdList :study="studyInfo" @showDetail="showDetailCallback" />
  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'),'锁定试验')
  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. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .study-syxx {
  154. .syxx-top {
  155. background: #fff;
  156. padding: 20px;
  157. width: 100%;
  158. .syxx-operate {
  159. margin: 0px 0 10px 0;
  160. display: flex;
  161. flex-direction: row;
  162. align-items: center;
  163. color: #409eff;
  164. .operate-img {
  165. flex-shrink: 0;
  166. height: 15px;
  167. background: #409eff;
  168. width: 3px;
  169. }
  170. .operate-left {
  171. flex-shrink: 0;
  172. font-weight: bold;
  173. padding-left: 10px;
  174. }
  175. .operate-right {
  176. flex-grow: 1;
  177. text-align: right;
  178. .operate-icon {
  179. cursor: pointer;
  180. }
  181. }
  182. }
  183. }
  184. .syxx-content {
  185. }
  186. }
  187. </style>