expenseCalendar.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view>
  3. <view>
  4. <view>
  5. <u-list @scrolltolower="scrolltolower">
  6. <!-- <view class="listTermDate">
  7. <u-cell-group>
  8. <u-cell :title="from.date" arrow-direction="down" @click="dateShow = true" isLink></u-cell>
  9. </u-cell-group>
  10. <view>
  11. <u-datetime-picker :show="dateShow" closeOnClickOverlay v-model="from.date" mode="date"
  12. @cancel="dateShow = false" @confirm="submitDate" :formatter="formatter"
  13. @change="change">
  14. </u-datetime-picker>
  15. </view>
  16. </view> -->
  17. <view class="hand">
  18. <u-row>
  19. <u-col span="8">
  20. <view class="orgTop">
  21. <uni-row>
  22. <uni-col :span="10">
  23. <u--text text="所属机构" size="22" bold color="#619f8a"></u--text>
  24. </uni-col>
  25. <uni-col :span="24">
  26. <u--text :text="from.organizationName" size="22" bold color="#757575">
  27. </u--text>
  28. </uni-col>
  29. </uni-row>
  30. </view>
  31. </u-col>
  32. <!--<u-col span="4">
  33. <view>
  34. <u-button class="sxButton" size="normal" loadingMode="circle" color="#65c1aa">统计查看
  35. </u-button>
  36. </view>
  37. </u-col> -->
  38. </u-row>
  39. </view>
  40. <view v-if="indexList.length === 0" style="padding: 0 50px;">
  41. <image style="margin: 0 auto; width: 100%;" src="../../../static/img/page/empty_view.png">
  42. </image>
  43. </view>
  44. <view v-for="(item, index) in indexList" :key="index">
  45. <view :data-index="index" class="order-item">
  46. <view class="listItemStyle">
  47. <u-row>
  48. <u-col span="3">
  49. <view class="orderFoodStyle orderFoodType0">
  50. {{item.statusText}}
  51. </view>
  52. </u-col>
  53. <u-col span="5" class="orderFoodStyle orderFoodType">
  54. <view style="font-size: 26rpx;">
  55. 订单:{{item.orderNumber}}
  56. </view>
  57. </u-col>
  58. <u-col span="4" textAlign="right">
  59. <view class="moneyText">
  60. {{"- "+item.orderTotal+""}}
  61. </view>
  62. </u-col>
  63. </u-row>
  64. <u-row>
  65. <u-col span="5" class="orderTimeText">{{item.paytime}}</u-col>
  66. <u-col span="1" class="orderTimeText">
  67. </u-col>
  68. <u-col span="2" class="orderTimeText">
  69. <view style="color: #1787ff;font-size: 34rpx;" @click="toJDPage(item)">
  70. 进度
  71. </view>
  72. </u-col>
  73. <u-col span="3" class="orderTimeText">
  74. <view style="color: #1787ff;font-size: 34rpx;" @click="getDetails(item)">
  75. 详情
  76. </view>
  77. </u-col>
  78. <u-col span="2" class="orderTimeText">
  79. <view v-if="item.isNews === '1'"
  80. style="font-size: 22rpx;color: rgb(55,186,189);" @click="toJDPage(item)">
  81. 新消息
  82. </view>
  83. </u-col>
  84. </u-row>
  85. </view>
  86. </view>
  87. </view>
  88. </u-list>
  89. <u-modal :show="modalContent1.show" :title="modalContent1.title" :showCancelButton="true"
  90. confirmColor="#53a591" @confirm="backSubmit()" @cancel="modalContent1.show = false">
  91. {{modalContent1.content}}
  92. </u-modal>
  93. <u-modal :show="modalContent2.show" :title="modalContent2.title" :content='modalContent2.content'
  94. confirmColor="#53a591" @confirm="modalContent2.show = false">
  95. </u-modal>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. export default {
  102. data() {
  103. return {
  104. type: uni.getStorageSync("tabType"),
  105. dateShow: false,
  106. data: {},
  107. from: {
  108. organizationName: ''
  109. },
  110. indexList: [],
  111. modalContent1: {
  112. show: false,
  113. title: '提示',
  114. content: '确认退单吗?'
  115. },
  116. modalContent2: {
  117. show: false,
  118. title: '提示',
  119. content: ''
  120. },
  121. //列表数据(
  122. indexList: [],
  123. //左滑默认宽度
  124. startX: 0,
  125. startY: 0,
  126. delBtnWidth: 90,
  127. pageNum: 1,
  128. pageSize: 10,
  129. total: 1
  130. }
  131. },
  132. onLoad() {
  133. this.getExpenseCalendarList()
  134. },
  135. onShow() {
  136. this.getExpenseCalendarList()
  137. },
  138. onHide() {
  139. this.getExpenseCalendarList()
  140. },
  141. methods: {
  142. toJDPage(item) {
  143. uni.setStorageSync('order', item)
  144. this.$goto('../orderProcess')
  145. },
  146. getDetails(item) {
  147. uni.setStorageSync('order', item)
  148. this.$goto('details')
  149. },
  150. async getExpenseCalendarList() {
  151. if (this.indexList.length >= this.total) {
  152. return;
  153. }
  154. const orgInfo = uni.getStorageSync("orgInfo")
  155. this.from.organizationName = orgInfo.organizationName
  156. this.from.userName = uni.getStorageSync('userInfo').userName
  157. this.from.organizationCode = orgInfo.organizationCode
  158. // 发送请求
  159. const {
  160. data: res
  161. } = await this.$httpRequest({
  162. url: '/app/getOrder?' + "pageNum=" + this.pageNum + "&" + "pageSize=" + this.pageSize,
  163. method: 'post',
  164. data: this.from,
  165. urlType: 2
  166. });
  167. if (res.code === 200) {
  168. this.total = res.total
  169. this.loadmore(res.rows)
  170. }
  171. },
  172. change(e) {
  173. //this.changeDate = this.result(e.value, e.mode)
  174. },
  175. scrolltolower() {
  176. this.pageNum++;
  177. this.getExpenseCalendarList()
  178. },
  179. loadmore(data) {
  180. if (data.length === 0) {
  181. return;
  182. }
  183. for (var i = 0; i < data.length; i++) {
  184. this.indexList.push(data[i])
  185. }
  186. },
  187. formatter(type, value) {
  188. if (type === 'year') {
  189. return `${value}年`
  190. }
  191. if (type === 'month') {
  192. return `${value}月`
  193. }
  194. if (type === 'day') {
  195. return `${value}日`
  196. }
  197. return value
  198. },
  199. //删除方法
  200. delData(item) {
  201. this.modalContent1.show = true;
  202. uni.setStorageSync("orderNumber", item.orderNumber)
  203. //关闭侧边滑动
  204. item.right = 0
  205. }
  206. }
  207. }
  208. </script>
  209. <style>
  210. .hand {
  211. margin-top: 2px;
  212. padding: 5%;
  213. border-radius: 10px 10px 0 0;
  214. background: linear-gradient(to bottom right, #85c1bf, #f1fef9);
  215. }
  216. .orgTop {
  217. margin-bottom: 5px;
  218. }
  219. .sxButton {
  220. width: 100px;
  221. display: flex;
  222. flex-direction: column;
  223. align-items: center;
  224. }
  225. .order-item {
  226. position: relative;
  227. }
  228. .remove {
  229. width: 100px;
  230. height: 100%;
  231. background-color: #57aa8e;
  232. color: white;
  233. position: absolute;
  234. top: 0;
  235. right: -100px;
  236. display: flex;
  237. justify-content: center;
  238. align-items: center;
  239. font-size: 18px;
  240. }
  241. .listTermDate {
  242. padding: 10px 0;
  243. }
  244. .listItemStyle {
  245. background-color: #ffffff;
  246. padding: 15px;
  247. border: 1px solid #d8d8d8;
  248. margin: 10rpx;
  249. }
  250. .orderFoodStyle {
  251. font-size: 20px;
  252. }
  253. .orderFoodType {
  254. color: #000000;
  255. }
  256. .orderFoodType0 {
  257. color: #1787ff;
  258. }
  259. .orderFoodType1 {
  260. color: #da0000;
  261. }
  262. .orderFoodType2 {
  263. color: #00af00;
  264. }
  265. .moneyText {
  266. font-size: 26rpx;
  267. color: #b30000;
  268. }
  269. .orderTimeText {
  270. position: relative;
  271. top: 5px;
  272. color: #bebebe;
  273. font-size: 16px;
  274. }
  275. </style>