notApproved.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <view v-if="list.length > 0">
  4. <view class="display" v-for="(item,index) in list">
  5. <view class="store-content" @click="handleClick(item)">
  6. <image :src="image(item.goodsPic)" mode="" class="store-image"></image>
  7. <view class="text-content">
  8. <view class="font-thirty-two font-color2">
  9. {{item.goodsName}}
  10. </view>
  11. <view class="font-twenty font-color5" style="margin-top: 20rpx;">
  12. 类别:商品信息修改
  13. </view>
  14. </view>
  15. </view>
  16. <view class="button-dis">
  17. <button type="default" class="btn" @click="show(item.goodsId,item.shopsId, '通过')">通过</button>
  18. <button type="default" class="btn color" @click="show(item.goodsId,item.shopsId, '不通过')">不通过</button>
  19. </view>
  20. </view>
  21. </view>
  22. <view v-else style="padding-top: 200rpx;">
  23. <u-empty text="暂无数据" mode="list"></u-empty>
  24. </view>
  25. <ming-pop ref="statement" direction="below" :is_mask="true" :width="100" height="50%" :maskFun="true">
  26. <pop @close="close()" @noPass='handle' ref="pop"></pop>
  27. </ming-pop>
  28. <u-toast ref="uToast" />
  29. </view>
  30. </template>
  31. <script>
  32. import server from "@/api/index";
  33. import http from '@/common/http.js'
  34. export default {
  35. data() {
  36. return {
  37. id: null,
  38. list: [],
  39. userInfo: {},
  40. type: null,
  41. shopsId: null
  42. }
  43. },
  44. mounted() {
  45. this.userInfo = uni.getStorageSync('userInfo');
  46. this.getList();
  47. },
  48. methods: {
  49. showMOdel(){
  50. this.userInfo = uni.getStorageSync('userInfo');
  51. this.getList();
  52. },
  53. image(e) {
  54. return http.webUrl + e
  55. },
  56. getList(){
  57. server.getShenGoodsList({goodsStatus :'1'}).then(res =>{
  58. this.list = [];
  59. if(res){
  60. this.list = res
  61. }
  62. })
  63. },
  64. handleClick(item){
  65. uni.navigateTo({
  66. url: '/pages/manage/modifyInfo/addToOrder?id=' + item.goodsId
  67. })
  68. },
  69. handlePass(data, id){
  70. let _this = this;
  71. uni.showModal({
  72. title: '提示',
  73. content: '确定通过审核吗?',
  74. success: function (res) {
  75. if (res.confirm) {
  76. let params ={
  77. goodsId: id,
  78. goodsStatus: '2',
  79. goodsReviewer: _this.userInfo.userId,
  80. reviewerName: _this.userInfo.nickName,
  81. remark: data,
  82. shopsId: _this.shopsId
  83. }
  84. server.getUodateGoods(params).then(res =>{
  85. _this.$refs.uToast.show({
  86. title: '通过成功!',
  87. type: 'default',
  88. })
  89. _this.getList();
  90. })
  91. } else if (res.cancel) {
  92. console.log('用户点击取消');
  93. }
  94. }
  95. });
  96. },
  97. handle(data){
  98. if(this.type === '不通过'){
  99. this.handleNoPass(data)
  100. }else if(this.type === '通过'){
  101. console.log('this.id', this.id)
  102. this.handlePass(data, this.id)
  103. }
  104. },
  105. handleNoPass(data){
  106. let _this = this;
  107. let params ={
  108. goodsId: _this.id,
  109. goodsStatus: '3',
  110. goodsReviewer: _this.userInfo.userId,
  111. reviewerName: _this.userInfo.nickName,
  112. remark: data,
  113. shopsId: _this.shopsId
  114. }
  115. server.getUodateGoods(params).then(res =>{
  116. _this.$refs.uToast.show({
  117. title: '操作成功!',
  118. type: 'default',
  119. })
  120. _this.getList();
  121. })
  122. },
  123. show(id, shopsId, type) {
  124. this.$refs.statement.show(type);
  125. this.$refs.pop.show(type);
  126. this.id = id;
  127. this.type = type;
  128. this.shopsId = shopsId;
  129. },
  130. close() {
  131. this.$refs.statement.close();
  132. this.id = null
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. .display {
  139. margin: 30rpx 30rpx 0;
  140. padding: 30rpx;
  141. background: #FFFFFF;
  142. opacity: 1;
  143. border-radius: 8rpx;
  144. .store-content {
  145. display: flex;
  146. align-items: center;
  147. padding-bottom: 30rpx;
  148. border-bottom: 2rpx solid #DEDEDE;
  149. .store-image {
  150. width: 220rpx;
  151. height: 150rpx;
  152. }
  153. .text-content {
  154. margin-left: 30rpx;
  155. }
  156. }
  157. .button-dis {
  158. display: flex;
  159. margin-top: 30rpx;
  160. .btn {
  161. width: 300rpx;
  162. background: #2E4F1C;
  163. color: #FFFFFF;
  164. border-radius: 48rpx;
  165. }
  166. .color {
  167. background: #CC1019;
  168. }
  169. }
  170. }
  171. </style>