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

147 lines
5.3 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
2 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="mod-config" style="">
  3. <div class="pad" style="float: left;width: 33%;margin-top: 2%">
  4. <h5 style="margin-left: 30px;font-size: 20px">产品图片</h5>
  5. <el-form inline="true" style="margin-left: 30px" label-position="top">
  6. <el-form-item :label="'工厂编号:'">
  7. <el-input v-model="searchData.site" readonly style="width: 120px"></el-input>
  8. </el-form-item>
  9. <el-form-item :label="'产品编码:'" style="margin-left: 20px">
  10. <el-input v-model="searchData.partNo" readonly style="width: 220px"></el-input>
  11. </el-form-item>
  12. </el-form>
  13. <el-form inline="true" style="margin-top: 20px;margin-left: 30px" label-position="top">
  14. <el-form-item :label="'产品名称/规格型号:'" style="font-size: 20px">
  15. <el-input v-model="partDescription" readonly style="width: 374px"></el-input>
  16. </el-form-item>
  17. </el-form>
  18. <el-form inline="true" style="margin-top: 20px;margin-left: 30px" label-position="top">
  19. <el-form-item :label="fileTitle">
  20. <el-input v-model="fileName" style="width: 374px" readonly></el-input>
  21. </el-form-item>
  22. </el-form>
  23. <el-form inline="true" style="margin-top: 20px;margin-left: 30px" label-position="top">
  24. <el-form-item :label="' '">
  25. <el-button @click="lastPicture()" style="margin-left: 10px;height: 35px;width: 90px" type="primary">上一张</el-button>
  26. </el-form-item>
  27. <el-form-item :label="' '">
  28. <el-button @click="nextPicture()" style="margin-left: 25px;height: 35px;width: 90px" type="primary">下一张</el-button>
  29. </el-form-item>
  30. <el-form-item :label="' '">
  31. <el-button @click="jump()" style="margin-left: 25px;height: 35px;width: 80px" type="primary">关闭</el-button>
  32. </el-form-item>
  33. </el-form>
  34. </div>
  35. <div id="padPhoto" style="text-align: center;float: left;height: 750px;width: 66%;vertical-align:middle;" >
  36. <img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="photoUrl">
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import {
  42. getPhotoAddressData
  43. } from '@/api/pad.js'
  44. export default {
  45. name: 'padPartPhoto',
  46. data() {
  47. return{
  48. photoUrl:'',
  49. searchData:{
  50. site:'',
  51. partNo:'',
  52. },
  53. partDescription:'',
  54. fileTitle:'',
  55. fileName:'',
  56. num:1,
  57. currentData:'',
  58. photoDatas:[],
  59. uploadImg:[],
  60. showviewer: false,
  61. url: ''
  62. }
  63. },
  64. mounted () {
  65. },
  66. methods: {
  67. getData(){
  68. this.currentData = JSON.parse(localStorage.getItem("pictureData"));
  69. this.searchData.partNo = this.currentData.partNo;
  70. this.searchData.site= this.currentData.site;
  71. this.partDescription= this.currentData.partDescription+'/'+this.currentData.spec;
  72. this.getPhoto();
  73. },
  74. jump(){
  75. // this.$router.push('/padPart');
  76. this.$router.back();
  77. },
  78. getPhoto(){
  79. getPhotoAddressData(this.searchData).then(({data}) => {
  80. this.photoDatas = data.rows;
  81. if(this.photoDatas.length==0){
  82. this.fileTitle="文件名 ("+0+"/"+0+")";
  83. this.$alert('该物料没有上传图片!', '错误', {
  84. confirmButtonText: '确定'
  85. })
  86. return false;
  87. }
  88. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  89. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  90. this.photoUrl=this.$store.state.user.padSopUrl+this.photoDatas[this.num-1].attaFileNameDb;
  91. // this.photoUrl='http://192.168.1.83:81/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  92. })
  93. },
  94. nextPicture(){
  95. if(this.photoDatas.length==0){
  96. this.fileTitle="文件名 ("+0+"/"+0+")";
  97. this.$alert('该物料没有上传图片!', '错误', {
  98. confirmButtonText: '确定'
  99. })
  100. return false;
  101. }
  102. if(this.num==this.photoDatas.length){
  103. this.num=1;
  104. }else{
  105. this.num=this.num+1;
  106. }
  107. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  108. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  109. this.photoUrl=this.$store.state.user.padSopUrl+this.photoDatas[this.num-1].attaFileNameDb;
  110. // this.photoUrl='http://192.168.1.83:81/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  111. },
  112. lastPicture(){
  113. if(this.photoDatas.length==0){
  114. this.fileTitle="文件名 ("+0+"/"+0+")";
  115. this.$alert('该物料没有上传图片!', '错误', {
  116. confirmButtonText: '确定'
  117. })
  118. return false;
  119. }
  120. if(this.num==1){
  121. this.num=this.photoDatas.length;
  122. }else{
  123. this.num=this.num-1;
  124. }
  125. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  126. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  127. this.photoUrl=this.$store.state.user.padSopUrl+this.photoDatas[this.num-1].attaFileNameDb;
  128. // this.photoUrl='http://192.168.1.83:81/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  129. },
  130. },
  131. created () {
  132. this.getData();
  133. }
  134. }
  135. </script>
  136. <style >
  137. .padPhoto .img{
  138. object-fit: cover;
  139. }
  140. </style>