refuse.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="content">
  3. <form @submit="selectSubmit" class="form">
  4. <view class="select-input">
  5. <input class="input" style="display:none;" />
  6. <text>订单编号:</text><input class="input" name="orderMumber" placeholder="请输入订单编号" />
  7. </view>
  8. <view class="select-input">
  9. <input class="input" style="display:none;" />
  10. <text>订单流水:</text><input class="input" name="orderWater" :value="orderWater" placeholder="请输入订单流水后10位" />
  11. <button type="primary" @click="saoma()" class="button1">
  12. <p class="p">扫码</p>
  13. </button>
  14. </view>
  15. <view class="select-input2">
  16. <text class="select-text">点击“扫码”能更方便获取订单流水,它可以去获取保存到手机的支付截图的条形码(订单流水),它也可以直接扫描消费者手机上的支付成功后账单详情中的条形码.如果没有条形码,无法使用扫码,请直接输入.</text>
  17. </view>
  18. <!-- 时间选择器 start -->
  19. <mx-date-picker :show="showPicker" :type="type" :value="value" :show-tips="true" :begin-text="'开始'"
  20. :end-text="'结束'" :show-seconds="true" @confirm="onSelected" @cancel="oncancel" />
  21. <view class="select-input">
  22. <input class="input" style="display:none;" />
  23. <text @click="onShowDatePicker('rangetime')">开始时间:</text><input class="input" name="startDate"
  24. :value="startDate" placeholder="支付开始时间" @click="onShowDatePicker('rangetime')" disabled/>
  25. </view>
  26. <view class="select-input">
  27. <input class="input" style="display:none;" />
  28. <text @click="onShowDatePicker('rangetime')">结束时间:</text><input class="input" name="endDate"
  29. :value="endDate" placeholder="支付结束时间" @click="onShowDatePicker('rangetime')" disabled/>
  30. </view>
  31. <!-- 时间选择器 end -->
  32. <view class="select-input">
  33. <text class="select-text">注意:4个信息,至少填写一个,填写的越多,查出来的越准确.时间跨度不能超过两天。</text>
  34. <!-- <text class="select-text">注意:2个信息,至少填写一个,填写的越多,查出来的越准确.</text> -->
  35. </view>
  36. <view class="btn-area">
  37. <button type="primary" formType="submit">确认</button>
  38. <!-- <button type="primary" @click="tran()" >提交</button> -->
  39. </view>
  40. </form>
  41. <view v-show="ok">
  42. <uni-collapse :accordion="true">
  43. <uni-list v-for="order in orders" :key="order.id">
  44. <uni-list-item :title="'商品名称:'+order.productName" :note="'支付时间:'+order.payDate"
  45. :rightText="order.status==1?('已支付'):(order.status==2?('退款中'):(order.status==3?('已退款'):(order.status==3?('支付'):('未支付'))))"
  46. showArrow clickable @click="trantoedit(order)"></uni-list-item>
  47. <!-- <uni-list-item :title="alarmClock.hour" :note="alarmClock.week+'---'+alarmClock.type"
  48. :rightText="alarmClock.status" clickable @click="onClick(alarmClock.id)" /> -->
  49. </uni-list>
  50. </uni-collapse>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import MxDatePicker from '../../components/mx-datepicker/mx-datepicker.vue';
  56. import {
  57. dateUtils
  58. } from '@/common/util.js';
  59. import uniCollapse from '@/components/uni-collapse/uni-collapse.vue';
  60. import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue';
  61. import uniList from '../../uni_modules/uni-list/components/uni-list/uni-list.vue';
  62. import uniListItem from '../../uni_modules/uni-list/components/uni-list-item/uni-list-item.vue';
  63. import uniIcons from '../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
  64. export default {
  65. components: {
  66. MxDatePicker,
  67. uniCollapse,
  68. uniCollapseItem,
  69. uniList,
  70. uniListItem,
  71. uniIcons
  72. },
  73. data() {
  74. return {
  75. ok: false,
  76. //时间选择器
  77. showPicker: false,
  78. date: '2021/01/01',
  79. time: '15:00:12',
  80. datetime: '2021/01/01 15:00:12',
  81. range: [],
  82. rangetime: [],
  83. startDate: null,
  84. endDate: null,
  85. type: 'rangetime',
  86. orders: [],
  87. orderWater:'',
  88. value: ''
  89. };
  90. },
  91. onShow() {
  92. var date = new Date();
  93. // var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
  94. this.date = dateUtils.formateDate(date, 'yyyy/MM/dd');
  95. this.time = dateUtils.formateDate(date, 'HH:mm:ss');
  96. this.datetime = dateUtils.formateDate(date, 'yyyy/MM/dd HH:mm:ss');
  97. this.refse();
  98. },
  99. computed: {
  100. // ...mapState(['isLoading']),
  101. // loginBtnLabel(){
  102. // return this.isLoading ? '':'登录'
  103. // }
  104. },
  105. methods: {
  106. selectSubmit(e) {
  107. // this.ok = true;
  108. // console.log(e.detail.value);
  109. if (e.detail.value.orderMumber != "" || e.detail.value.orderWater != "" || (e.detail.value.startDate !=
  110. "" && e.detail.value.endDate != "")) {
  111. var orderMumber = e.detail.value.orderMumber;
  112. var orderWater = e.detail.value.orderWater;
  113. var startTime = e.detail.value.startDate;
  114. var endTime = e.detail.value.endDate;
  115. var startDate = '';
  116. var endDate = '';
  117. if (startTime != null && endTime != null&&startTime != '' && endTime !='') {
  118. var start = new Date(startTime);
  119. var end = new Date(endTime);
  120. var t = end.getTime() - start.getTime();
  121. if (t > 2 * 24 * 60 * 60 * 1000) {
  122. uni.showModal({
  123. title: '提示',
  124. content: '时间跨度超出范围',
  125. success: function(res) {
  126. if (res.confirm) {} else if (res.cancel) {}
  127. }
  128. });
  129. return;
  130. // console.log("超过2天");
  131. } else {
  132. var start = new Date(startTime);
  133. var A = dateUtils.formateDate(start, 'yyyy-MM-dd');
  134. var B = startTime.split(/[\s]/)[1];
  135. startDate = A + ' ' + B;
  136. var end = new Date(endTime);
  137. var C = dateUtils.formateDate(end, 'yyyy-MM-dd');
  138. var D = endTime.split(/[\s]/)[1];
  139. endDate = C + ' ' + D;
  140. // console.log("少于2天");
  141. }
  142. }
  143. var token = uni.getStorageSync("token");
  144. var globalUser = uni.getStorageSync("globalUser");
  145. uni.request({
  146. url: this.serverurl + '/TOrder/seleceOrder',
  147. data: {
  148. "sn": orderMumber,
  149. "trxNo": orderWater,
  150. "adminId": globalUser.id,
  151. "createDate": startDate,
  152. "modifyDate": endDate,
  153. },
  154. header: {
  155. 'token': token
  156. },
  157. method: "POST",
  158. success: (res) => {
  159. var orders = res.data.data;
  160. // console.log(orders)
  161. this.orders = orders;
  162. if (orders.length > 0) {
  163. this.ok = true;
  164. }
  165. },
  166. });
  167. } else {
  168. uni.showModal({
  169. title: '提示',
  170. content: '信息不能为空',
  171. success: function(res) {
  172. if (res.confirm) {} else if (res.cancel) {}
  173. }
  174. });
  175. return;
  176. }
  177. },
  178. saoma() {
  179. var that = this;
  180. // 允许从相机和相册扫码
  181. uni.scanCode({
  182. success(res) {
  183. that.orderWater = res.result;
  184. // console.log('条码类型:' + res.scanType);
  185. // console.log('条码内容:' + res.result);
  186. }
  187. });
  188. },
  189. refse() {
  190. var token = uni.getStorageSync("token");
  191. var globalUser = uni.getStorageSync("globalUser");
  192. uni.request({
  193. url: this.serverurl + '/TJoinpayMch/refere',
  194. data: {
  195. "adminId": globalUser.id,
  196. },
  197. header: {
  198. 'token': token
  199. },
  200. method: "POST",
  201. success: (res) => {
  202. // var date = res.data.data;
  203. },
  204. });
  205. },
  206. trantoedit(order) {
  207. uni.navigateTo({
  208. url: 'orderEit?order=' + encodeURIComponent(JSON.stringify(order)),
  209. });
  210. },
  211. onShowDatePicker(type) { //显示
  212. this.type = type;
  213. this.showPicker = true;
  214. this.value = this[type];
  215. },
  216. onSelected(e) { //选择
  217. this.showPicker = false;
  218. if (e) {
  219. this[this.type] = e.value;
  220. //选择的值
  221. // console.log('value => '+ e.value);
  222. this.startDate = e.value[0];
  223. this.endDate = e.value[1];
  224. //原始的Date对象
  225. // console.log('date => ' + e.date);
  226. }
  227. },
  228. oncancel(){
  229. this.showPicker = false;
  230. this.startDate = '';
  231. this.endDate = '';
  232. }
  233. }
  234. }
  235. </script>
  236. <style lang="scss">
  237. @import "../../static/common/selectOrder.scss";
  238. </style>