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

188 lines
5.4 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
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 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-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="textValue"
  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="right"
  62. min-width="60"
  63. label="数字值">
  64. </el-table-column>
  65. <el-table-column
  66. prop="valueType"
  67. header-align="center"
  68. align="left"
  69. min-width="60"
  70. label="属性类型">
  71. </el-table-column>
  72. </el-table>
  73. </div>
  74. </template>
  75. <script>
  76. import {
  77. getPartSubPropertiesValueData,
  78. getPartSubPropertiesValueHeaderData
  79. } from '@/api/pad.js'
  80. export default {
  81. name: 'padPartAttribute',
  82. data () {
  83. return {
  84. height:200,
  85. tableData:[],
  86. currentData: {},
  87. searchData:{
  88. site:'',
  89. partNo:'',
  90. },
  91. partDescription:'',
  92. num:'',
  93. subCodeDesc:'',
  94. list:[],
  95. }
  96. },
  97. mounted () {
  98. this.$nextTick(() => {
  99. this.height = window.innerHeight - 250
  100. })
  101. },
  102. methods: {
  103. getData(){
  104. this.currentData = JSON.parse(localStorage.getItem("partData"))
  105. this.searchData.partNo = this.currentData.partNo
  106. this.num=1;
  107. this.remark=this.currentData.remark;
  108. this.searchData.site= this.currentData.site;
  109. this.partDescription= this.currentData.partDescription+'/'+this.currentData.spec;
  110. getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
  111. this.list = data.rows;
  112. if(data.rows.length==0){
  113. this.$alert('该物料没有设置属性!', '错误', {
  114. confirmButtonText: '确定'
  115. })
  116. return false;
  117. }
  118. this.subCodeDesc=this.list[this.num-1].subCodeDesc;
  119. this.search();
  120. })
  121. },
  122. search(){
  123. if( this.list.length==0){
  124. return false;
  125. }
  126. let postData={
  127. site:this.searchData.site,
  128. partNo:this.searchData.partNo,
  129. subCodeSeqNo:this.num,
  130. }
  131. getPartSubPropertiesValueData(postData).then(({data}) => {
  132. this.tableData = data.rows
  133. })
  134. },
  135. jump(){
  136. this.$router.push('/padPart');
  137. },
  138. nextData(){
  139. if(this.list.length==0){
  140. this.$alert('该物料没有设置属性!', '错误', {
  141. confirmButtonText: '确定'
  142. })
  143. return false;
  144. }
  145. if(this.num==this.list.length){
  146. this.num=1;
  147. }else{
  148. this.num=this.num+1;
  149. }
  150. let i=this.num-1;
  151. this.subCodeDesc=this.list[i].subCodeDesc;
  152. this.search();
  153. },
  154. lastData(){
  155. if(this.list.length==0){
  156. this.$alert('该物料没有设置属性!', '错误', {
  157. confirmButtonText: '确定'
  158. })
  159. return false;
  160. }
  161. if(this.num==1){
  162. this.num=this.list.length;
  163. }else{
  164. this.num=this.num-1;
  165. }
  166. let i=this.num-1;
  167. this.subCodeDesc=this.list[i].subCodeDesc;
  168. this.search();
  169. },
  170. },
  171. created () {
  172. this.getData();
  173. }
  174. }
  175. </script>
  176. <style scoped>
  177. </style>