plm前端
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.

136 lines
3.4 KiB

2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form-item style="">
  5. <el-button type="primary" @click="saveData()" v-if="!ifDisableFlag">保存备注</el-button>
  6. </el-form-item>
  7. <el-form-item style="height: 500px">
  8. <el-input
  9. type="textarea"
  10. v-model="dataForm.remarkPage "
  11. :rows="25"
  12. resize='none'
  13. maxlength="500"
  14. :disabled="ifDisableFlag"
  15. style="height: 500px" >
  16. </el-input>
  17. </el-form-item>
  18. </el-form>
  19. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  20. </div>
  21. </template>
  22. <script>
  23. import {
  24. searchBMRemarkPage,
  25. updateBMRemarkPage,
  26. } from "@/api/sampleManagement/technicalSpecificationList.js"
  27. import Chooselist from '@/views/modules/common/Chooselist'
  28. export default {
  29. components: {
  30. Chooselist
  31. },
  32. data() {
  33. return {
  34. searchData: {
  35. site: '',
  36. username: this.$store.state.user.name,
  37. codeNo: '',
  38. buNo:'',
  39. },
  40. ifDisableFlag:false,
  41. dataForm:{
  42. site: '',
  43. codeNo:'',
  44. remarkPage:'',
  45. },
  46. dataRole: {
  47. partTypeDesc: [
  48. {
  49. required: true,
  50. message: ' ',
  51. trigger: 'change'
  52. }
  53. ],
  54. partName: [
  55. {
  56. required: true,
  57. message: ' ',
  58. trigger: 'change'
  59. }
  60. ],
  61. }
  62. }
  63. },
  64. methods: {
  65. // 获取基础数据列表S
  66. getBaseList (val, type) {
  67. this.tagNo = val
  68. this.tagNo1 = type
  69. this.$nextTick(() => {
  70. let strVal = ''
  71. if (val === 1013) {
  72. if(type==1) {
  73. strVal = this.dataForm.partType
  74. }
  75. }
  76. this.$refs.baseList.init(val, strVal)
  77. })
  78. },
  79. /* 列表方法的回调 */
  80. getBaseData (val) {
  81. if (this.tagNo === 1013) {
  82. if(this.tagNo1==1) {
  83. this.dataForm.partType = val.Base_id
  84. this.dataForm.partTypeDesc = val.Base_desc
  85. }
  86. }
  87. },
  88. //初始化组件的参数
  89. init(inData) {
  90. //初始化参数
  91. this.searchData = JSON.parse(JSON.stringify(inData));
  92. if(this.searchData.ifDisableFlag){
  93. this.ifDisableFlag=true
  94. }
  95. //刷新表格
  96. this.searchTable();
  97. },
  98. searchTable(){
  99. searchBMRemarkPage(this.searchData).then(({data}) => {
  100. if(data.rows.length>0){
  101. this.dataForm = data.rows[0];
  102. }else {
  103. this.dataForm.site=this.searchData.site
  104. this.dataForm.codeNo=this.searchData.codeNo
  105. }
  106. });
  107. },
  108. saveData(){
  109. this.$confirm("是否保存信息?", '保存提示', {
  110. confirmButtonText: '确定',
  111. cancelButtonText: '取消',
  112. }).then(() => {
  113. console.log(this.dataForm)
  114. updateBMRemarkPage(this.dataForm).then(({data}) => {
  115. if (data && data.code === 0) {
  116. this.$message.success( '操作成功')
  117. } else {
  118. this.$message.error(data.msg)
  119. }
  120. })
  121. }).catch(() => {
  122. return
  123. })
  124. },
  125. },
  126. }
  127. </script>
  128. <style scoped>
  129. </style>