赫艾前端
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.

181 lines
5.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="mod-config pad" style="margin-top: 10px">
  3. <h5 style="margin-left: 20px">产品属性</h5>
  4. <el-form inline="true" style="margin-top: -10px;margin-left: 20px" label-position="top">
  5. <el-form-item :label="'工厂编号:'">
  6. <el-input v-model="searchData.site" readonly style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'产品编码:'" style="margin-left: 20px">
  9. <el-input v-model="searchData.partNo" readonly style="width: 200px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'产品名称/规格型号:'" style="margin-left: 20px">
  12. <el-input v-model="partDescription" readonly style="width: 300px"></el-input>
  13. </el-form-item>
  14. </el-form>
  15. <el-form inline="true" style="margin-top: 26px;margin-left: 20px" label-position="top">
  16. <el-form-item :label="'序号:'">
  17. <el-input v-model="num" style="width: 120px" readonly></el-input>
  18. </el-form-item>
  19. <el-form-item :label="'描述:'" style="margin-left: 20px">
  20. <el-input v-model="subCodeDesc" style="width: 200px" readonly></el-input>
  21. </el-form-item>
  22. <el-form-item :label="' '">
  23. <el-button @click="lastData()" style="margin-left: 24px;height: 35px;width: 90px" type="primary">上一条</el-button>
  24. </el-form-item>
  25. <el-form-item :label="' '">
  26. <el-button @click="nextData()" style="margin-left: 24px;height: 35px;width: 90px" type="primary">下一条</el-button>
  27. </el-form-item>
  28. <el-form-item :label="' '">
  29. <el-button @click="jump()" style="margin-left: 24px;height: 35px;width: 80px" type="primary">关闭</el-button>
  30. </el-form-item>
  31. </el-form>
  32. <el-table
  33. :height="height"
  34. :data="tableData"
  35. border
  36. style="width: 100%;margin-top: 20px">
  37. <el-table-column
  38. prop="propertiesItemNo"
  39. header-align="center"
  40. align="left"
  41. min-width="60"
  42. label="属性编码">
  43. </el-table-column>
  44. <el-table-column
  45. prop="itemDesc"
  46. header-align="center"
  47. align="left"
  48. min-width="60"
  49. label="属性描述">
  50. </el-table-column>
  51. <el-table-column
  52. prop="valueType"
  53. header-align="center"
  54. align="left"
  55. min-width="60"
  56. label="属性类型">
  57. </el-table-column>
  58. <el-table-column
  59. prop="numValue"
  60. header-align="center"
  61. align="left"
  62. min-width="60"
  63. label="属性值">
  64. </el-table-column>
  65. </el-table>
  66. </div>
  67. </template>
  68. <script>
  69. import {
  70. getPartSubPropertiesValueData,
  71. getPartSubPropertiesValueHeaderData
  72. } from '@/api/pad.js'
  73. export default {
  74. name: 'padPartAttribute',
  75. data () {
  76. return {
  77. height:200,
  78. tableData:[],
  79. currentData: {},
  80. searchData:{
  81. site:'',
  82. partNo:'',
  83. },
  84. partDescription:'',
  85. num:'',
  86. subCodeDesc:'',
  87. list:[],
  88. }
  89. },
  90. mounted () {
  91. this.$nextTick(() => {
  92. this.height = window.innerHeight - 250
  93. })
  94. },
  95. methods: {
  96. getData(){
  97. this.currentData = JSON.parse(localStorage.getItem("partData"))
  98. this.searchData.partNo = this.currentData.partNo
  99. this.num=1;
  100. this.remark=this.currentData.remark;
  101. this.searchData.site= this.currentData.site;
  102. this.partDescription= this.currentData.partDescription+'/'+this.currentData.spec;
  103. getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
  104. this.list = data.rows;
  105. if(data.rows.length==0){
  106. this.$alert('该物料没有设置属性!', '错误', {
  107. confirmButtonText: '确定'
  108. })
  109. return false;
  110. }
  111. this.subCodeDesc=this.list[this.num-1].subCodeDesc;
  112. this.search();
  113. })
  114. },
  115. search(){
  116. if( this.list.length==0){
  117. return false;
  118. }
  119. let postData={
  120. site:this.searchData.site,
  121. partNo:this.searchData.partNo,
  122. subCodeSeqNo:this.num,
  123. }
  124. getPartSubPropertiesValueData(postData).then(({data}) => {
  125. this.tableData = data.rows
  126. })
  127. },
  128. jump(){
  129. this.$router.push('/padPart');
  130. },
  131. nextData(){
  132. if(this.list.length==0){
  133. this.$alert('该物料没有设置属性!', '错误', {
  134. confirmButtonText: '确定'
  135. })
  136. return false;
  137. }
  138. if(this.num==this.list.length){
  139. this.num=1;
  140. }else{
  141. this.num=this.num+1;
  142. }
  143. let i=this.num-1;
  144. this.subCodeDesc=this.list[i].subCodeDesc;
  145. this.search();
  146. },
  147. lastData(){
  148. if(this.list.length==0){
  149. this.$alert('该物料没有设置属性!', '错误', {
  150. confirmButtonText: '确定'
  151. })
  152. return false;
  153. }
  154. if(this.num==1){
  155. this.num=this.list.length;
  156. }else{
  157. this.num=this.num-1;
  158. }
  159. let i=this.num-1;
  160. this.subCodeDesc=this.list[i].subCodeDesc;
  161. this.search();
  162. },
  163. },
  164. created () {
  165. this.getData();
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. </style>