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.

186 lines
6.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 1px; margin-left: 0px;" >
  4. <el-form-item :label="'技术参数卡编码'">
  5. <el-input v-model="searchData.codeNo" readonly style="width: 150px" ></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'属性模板编码'">
  8. <el-input v-model="searchData.propertiesCodeNo" readonly style="width: 150px" ></el-input>
  9. </el-form-item>
  10. <el-form-item label=" ">
  11. <el-button type="primary" @click="refreshBMPageModal()" v-if="!ifDisableFlag">更新模板</el-button>
  12. <el-button type="primary" @click="searchTable()" >刷新数据</el-button>
  13. <el-button type="primary" @click="saveTable()" v-if="!ifDisableFlag">保存数据</el-button>
  14. </el-form-item>
  15. <div class="rq ">
  16. <el-table
  17. :height="height"
  18. :data="tableData"
  19. border
  20. style="width: 100%">
  21. <el-table-column
  22. prop="propertiesItemNo"
  23. header-align="center"
  24. align="left"
  25. width="150"
  26. label="属性编码">
  27. </el-table-column>
  28. <el-table-column
  29. prop="itemDesc"
  30. header-align="center"
  31. align="left"
  32. width="150"
  33. label="属性名称">
  34. </el-table-column>
  35. <el-table-column
  36. prop="valueTypeDb"
  37. header-align="center"
  38. align="center"
  39. width="80"
  40. label="数据类型">
  41. <template slot-scope="scope">
  42. {{scope.row.valueTypeDb=='N'?'数字':'文本'}}
  43. </template>
  44. </el-table-column>
  45. <el-table-column
  46. header-align="center"
  47. align="left"
  48. min-width="400"
  49. label="值">
  50. <template slot-scope="scope">
  51. <el-input v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.textValue" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  52. <el-input v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'N'" v-model="scope.row.numValue" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  53. <el-select v-if="scope.row.valueTypeDb === 'T'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.textValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create>
  54. <el-option
  55. v-for="item in scope.row.availableValueList"
  56. :key="index"
  57. :label="item.availableValue"
  58. :value="item.availableValue">
  59. </el-option>
  60. </el-select>
  61. <el-select v-if="scope.row.valueTypeDb === 'N'&&scope.row.valueChooseFlag === 'Y'" v-model="scope.row.numValue" placeholder="请选择" style="height: 11px;padding: 0px " allow-create>
  62. <el-option
  63. v-for="item in scope.row.availableValueList"
  64. :key="index"
  65. :label="item.availableValue"
  66. :value="item.availableValue">
  67. </el-option>
  68. </el-select>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. </div>
  73. </el-form>
  74. </div>
  75. </template>
  76. <script>
  77. import {
  78. searchBMPropertiesValue,
  79. saveBMPropertiesValue,
  80. refreshBMPageModal,
  81. searchBMPropertiesHeaderForBM,
  82. } from "@/api/sampleManagement/technicalSpecificationList.js"
  83. export default {
  84. components: {
  85. },
  86. data() {
  87. return {
  88. height:200,
  89. searchData: {
  90. site: '',
  91. username: this.$store.state.user.name,
  92. codeNo: '',
  93. buNo:'',
  94. type:'',
  95. propertiesCodeNo:'',
  96. },
  97. type:'prepress',
  98. ifDisableFlag:false,
  99. tableData:[],
  100. }
  101. },
  102. mounted () {
  103. this.$nextTick(() => {
  104. this.height =0.7* window.innerHeight
  105. })
  106. },
  107. methods: {
  108. //初始化组件的参数
  109. init(inData) {
  110. if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){
  111. return false;
  112. }
  113. //初始化参数
  114. this.searchData = JSON.parse(JSON.stringify(inData));
  115. if(this.searchData.ifDisableFlag){
  116. this.ifDisableFlag=true
  117. }
  118. //this.searchData.type= JSON.parse(JSON.stringify(this.type));
  119. //刷新表格
  120. this.$nextTick(()=>{this.searchTable();} )
  121. },
  122. searchTable(){
  123. searchBMPropertiesValue(this.searchData).then(({data}) => {
  124. this.tableData = data.rows;
  125. });
  126. searchBMPropertiesHeaderForBM(this.searchData).then(({data}) => {
  127. this.searchData.propertiesCodeNo = data.row.propertiesCodeNo;
  128. });
  129. },
  130. refreshBMPageModal(){
  131. this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
  132. confirmButtonText: '确定',
  133. cancelButtonText: '取消',
  134. type: 'warning'
  135. }).then(() => {
  136. refreshBMPageModal(this.searchData).then(({data}) => {
  137. if (data && data.code === 0) {
  138. this.searchTable();
  139. this.$message({
  140. message: '操作成功',
  141. type: 'success',
  142. duration: 1500,
  143. onClose: () => {
  144. }
  145. })
  146. } else {
  147. this.$alert(data.msg, '错误', {
  148. confirmButtonText: '确定'
  149. })
  150. }
  151. })
  152. }).catch(() => {
  153. })
  154. },
  155. saveTable(){
  156. saveBMPropertiesValue(this.tableData).then(({data}) => {
  157. if (data && data.code === 0) {
  158. this.$message({
  159. message: '操作成功',
  160. type: 'success',
  161. duration: 1500,
  162. onClose: () => {
  163. }
  164. })
  165. this.$emit("closeModel")
  166. } else {
  167. this.$alert(data.msg, '错误', {
  168. confirmButtonText: '确定'
  169. })
  170. }
  171. });
  172. },
  173. },
  174. }
  175. </script>
  176. <style scoped>
  177. </style>