addToOrder.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view>
  3. <view style="margin-top: 60rpx;">
  4. <u-form :model="form" ref="uForm" :rules="rules">
  5. <view class="store">
  6. <u-form-item label="商品名称" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  7. <u-input input-align='right' disabled=true
  8. v-model="form.goodsName"></u-input>
  9. </u-form-item>
  10. </view>
  11. <view class="store">
  12. <u-form-item label="商品原价" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  13. <u-input input-align='right' disabled=true
  14. v-model="form.goodsRatePrice"></u-input>
  15. </u-form-item>
  16. </view>
  17. <!-- <view class="store">
  18. <u-form-item label="商品优惠价" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  19. <u-input input-align='right'
  20. v-model="form.concessionalRate"></u-input>
  21. </u-form-item>
  22. </view> -->
  23. <view class="store">
  24. <u-form-item label="优惠" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  25. <u-input input-align='right' disabled=true
  26. v-model="form.goodsPrice"></u-input>
  27. </u-form-item>
  28. </view>
  29. </u-form>
  30. <view class="store">
  31. <view class="font-color3 font-twenty distance">
  32. 商品简介
  33. </view>
  34. <textarea style="height: 200rpx;" disabled=true v-model="form.goodsContent"/>
  35. </view>
  36. <view class="store">
  37. <view class="font-color3 font-twenty distance">
  38. 商品头图
  39. </view>
  40. <view style="padding-bottom:40rpx; display: flex;">
  41. <image :src="image(form.goodsPic)" class="img"></image>
  42. </view>
  43. </view>
  44. <view class="store" v-if="!flag">
  45. <view class="font-color3 font-twenty distance">
  46. 审核意见
  47. </view>
  48. <textarea v-model="form.remark" disabled=true />
  49. </view>
  50. <view class="btn-display" v-if="flag">
  51. <button type="default" class="button btn-color1" @click="show('通过')">通过</button>
  52. <button type="default" class="button btn-color2" @click="show('不通过')">不通过</button>
  53. </view>
  54. </view>
  55. <ming-pop ref="statement" direction="below" :is_mask="true" :width="100" height="42%" :maskFun="true">
  56. <pop @close="close()" @noPass='handle' ref="pop"></pop>
  57. </ming-pop>
  58. <u-toast ref="uToast" />
  59. </view>
  60. </template>
  61. <script>
  62. import server from "@/api/index";
  63. import http from '@/common/http.js'
  64. export default {
  65. data() {
  66. return {
  67. form:{
  68. goodsName: '商品名称', //商品名称
  69. goodsRatePrice: '商品原价', //商品原价
  70. concessionalRate: '商品优惠价', //商品优惠价
  71. concessional: '优惠', //优惠
  72. goodsContent: '商品简介', //商品简介
  73. pic:[]
  74. },
  75. width: '240rpx',
  76. height: '135rpx',
  77. action: '',
  78. id: null,
  79. flag: true,
  80. userInfo: {},
  81. type: null
  82. }
  83. },
  84. onLoad(e) {
  85. this.id = e.id;
  86. if(e.flag){
  87. this.flag = false
  88. }else{
  89. this.flag = true
  90. }
  91. this.getListFn();
  92. this.userInfo = uni.getStorageSync('userInfo');
  93. },
  94. methods:{
  95. image(e) {
  96. return http.webUrl + e
  97. },
  98. handle(data){
  99. if(this.type === '不通过'){
  100. this.handleNoPass(data)
  101. }else if(this.type === '通过'){
  102. this.handlePass(data)
  103. }
  104. },
  105. handlePass(data){
  106. let _this = this;
  107. uni.showModal({
  108. title: '提示',
  109. content: '确定通过审核吗?',
  110. success: function (res) {
  111. if (res.confirm) {
  112. server.getUodateGoods({
  113. goodsId: _this.id,
  114. goodsStatus: '2',
  115. goodsReviewer: _this.userInfo.userId,
  116. reviewerName: _this.userInfo.nickName,
  117. remark: data,
  118. }).then(res =>{
  119. _this.$refs.uToast.show({
  120. title: '通过审核成功!',
  121. type: 'default',
  122. })
  123. setTimeout(function() {
  124. uni.navigateBack({
  125. delta: 1
  126. });
  127. }, 2000);
  128. })
  129. } else if (res.cancel) {
  130. console.log('用户点击取消');
  131. }
  132. }
  133. });
  134. },
  135. handleNoPass(data){
  136. let _this = this;
  137. server.getUodateGoods({
  138. goodsId: _this.id,
  139. goodsStatus: '3',
  140. remark: data,
  141. goodsReviewer: _this.userInfo.userId,
  142. reviewerName: _this.userInfo.nickName}).then(res =>{
  143. _this.$refs.uToast.show({
  144. title: '操作成功!',
  145. type: 'default',
  146. })
  147. setTimeout(function() {
  148. uni.navigateBack({
  149. delta: 1
  150. });
  151. }, 2000);
  152. })
  153. },
  154. getListFn(){
  155. server.getGoodsInfonew(this.id).then(res =>{
  156. if(res){
  157. this.form = res
  158. }
  159. })
  160. },
  161. show(type) {
  162. this.type = type;
  163. this.$refs.statement.show(type);
  164. this.$refs.pop.show(type);
  165. },
  166. close() {
  167. this.$refs.statement.close();
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. page {
  174. background-color: #F8F8F8;
  175. }
  176. .store {
  177. width: 690rpx;
  178. background: rgba(46, 79, 28, 0.13);
  179. border-radius: 16rpx;
  180. margin: 20rpx auto;
  181. padding: 0 35rpx;
  182. .img{
  183. width: 200rpx;
  184. height: 135rpx;
  185. margin-right: 10rpx;
  186. }
  187. }
  188. .distance {
  189. padding: 20rpx 0rpx;
  190. }
  191. .btn-display {
  192. display: flex;
  193. justify-content: space-between;
  194. margin-top: 60rpx;
  195. .button {
  196. width: 330rpx;
  197. border-radius: 48rpx;
  198. color: #ffffff;
  199. }
  200. .btn-color1 {
  201. background: #2E4F1C
  202. }
  203. .btn-color2 {
  204. background: #CC1019
  205. }
  206. }
  207. </style>