AccountDetails.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="detail-view">
  3. <view class="top-view clearfix">
  4. <view class="float_left">
  5. <text v-if="order_detail.enableStatus === 5" class="status-text">启用</text>
  6. <text v-else class="status-text">禁用</text>
  7. </view>
  8. </view>
  9. <view class="detail-cont">
  10. <view class="info-li clearfix">
  11. <view class="label">账户名称</view>
  12. <view class="value">{{ order_detail.name }}</view>
  13. </view>
  14. <view class="info-li clearfix">
  15. <view class="label">账户号</view>
  16. <view class="value">{{ order_detail.accountNumber }}</view>
  17. </view>
  18. <view class="info-li clearfix">
  19. <view class="label">制单时间</view>
  20. <view class="value">{{ $u.timeFormat(order_detail.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  21. </view>
  22. <view class="info-li clearfix">
  23. <view class="label">期初余额</view>
  24. <view class="value">{{ $utils.formattedNumber(order_detail.money) }}</view>
  25. </view>
  26. <view class="info-li clearfix">
  27. <view class="label">所属店铺</view>
  28. <view class="value">{{order_detail.shopName }}</view>
  29. </view>
  30. <view class="info-li clearfix">
  31. <!-- <u-radio-group v-model="value" @change="radioGroupChange">
  32. <u-radio v-for="(item, index) in list" :key="index" :name="item.name">
  33. {{item.name}}
  34. </u-radio>
  35. </u-radio-group> -->
  36. <!-- <view class="label">禁用/启用</view>
  37. <view class="remark">
  38. <u-switch v-model="checked" inactive-color="#eee"></u-switch>
  39. </view> -->
  40. </view>
  41. <view class="remark-li">
  42. <view class="label">备注</view>
  43. <view class="remark">
  44. <text>{{ order_detail.remark || '无' }}</text>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="detail-bottom">
  49. <view v-if="$accessCheck($Access.AccountListDelAccount)&&order_detail.enableStatus === 4" class="handel-btn info-btn"
  50. @click="openModel('请确认是否要删除?', '删除')">删除</view>
  51. <view v-if="$accessCheck($Access.AccountListEditAccount)&&order_detail.enableStatus === 4" class="handel-btn"
  52. @click="goPage('/pagesT/account/AddAcount?id=' + order_id)">编辑</view>
  53. <view v-if="$accessCheck($Access.PurchaseOrderUpdateAuditStatus)" class="handel-btn"
  54. @click="openModel(1, '启用')">{{order_detail.enableStatus === 4?'启用':'禁用'}}</view>
  55. </view>
  56. <u-modal v-model="model_show" :show-cancel-button="true" :content="model_content" @confirm="modelConfirm">
  57. </u-modal>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. value: "",
  65. list: [{
  66. name: '禁用',
  67. audito: 4
  68. },
  69. {
  70. name: '启用',
  71. audito: 5
  72. },
  73. ],
  74. model_tag: '',
  75. model_show: false,
  76. model_content: '',
  77. order_id: 0,
  78. order_detail: {}
  79. };
  80. },
  81. onPullDownRefresh() {
  82. this.getAccountInfo();
  83. },
  84. computed: {
  85. userInfo() {
  86. return this.$store.state.userInfo;
  87. },
  88. },
  89. onLoad(options) {
  90. this.order_id = options.id;
  91. },
  92. onShow() {
  93. this.getAccountInfo();
  94. },
  95. methods: {
  96. radioGroupChange(e) {
  97. console.log(e)
  98. },
  99. // 详情
  100. getAccountInfo() {
  101. this.$u.api
  102. .getAccountInfo(this.order_id)
  103. .then(res => {
  104. uni.stopPullDownRefresh();
  105. this.order_detail = res.data;
  106. console.log(res.data)
  107. })
  108. .catch(err => {
  109. uni.stopPullDownRefresh();
  110. });
  111. },
  112. // 打开提示框
  113. openModel(content, tag) {
  114. if(content===1){
  115. if(this.order_detail.enableStatus===4){
  116. this.model_content='您是否要启用'
  117. this.model_show = true;
  118. this.model_tag = tag;
  119. // this.order_detail.enableStatus=5
  120. }else{
  121. this.model_content='您是否要禁用'
  122. this.model_show = true;
  123. this.model_tag = tag;
  124. // this.order_detail.enableStatus=4
  125. }
  126. }else{
  127. this.model_content = content;
  128. this.model_show = true;
  129. this.model_tag = tag;
  130. }
  131. },
  132. // 审核
  133. modelConfirm() {
  134. if(this.order_detail.enableStatus===4){
  135. this.order_detail.enableStatus=5
  136. }else{
  137. this.order_detail.enableStatus=4
  138. }
  139. switch (this.model_tag) {
  140. case '启用':
  141. this.updateAuditStatusPurchase();
  142. break;
  143. case '删除':
  144. this.delPurchase(this.order_id);
  145. break;
  146. }
  147. },
  148. // 审核订单
  149. updateAuditStatusPurchase() {
  150. this.$u.api
  151. .updateAccountStatus( {
  152. id: this.order_id,
  153. enableStatus: this.order_detail.enableStatus,
  154. })
  155. .then(res => {
  156. this.$u.toast('操作成功');
  157. setTimeout(() => {
  158. uni.navigateBack();
  159. }, 1000);
  160. });
  161. },
  162. // 删除账户
  163. delPurchase() {
  164. this.$u.api.delAccount(this.order_id).then(res => {
  165. this.$u.toast('已删除');
  166. setTimeout(() => {
  167. uni.navigateBack();
  168. }, 2000);
  169. });
  170. }
  171. }
  172. };
  173. </script>
  174. <style lang="scss" scoped>
  175. .detail-view {
  176. padding-bottom: 100rpx;
  177. }
  178. .top-view {
  179. background-color: $uni-color-primary;
  180. height: 200rpx;
  181. padding: 0 30rpx;
  182. color: #ffffff;
  183. font-size: 40rpx;
  184. line-height: 100rpx;
  185. .status-text {
  186. margin-right: 10rpx;
  187. }
  188. .float_right {
  189. font-size: 28rpx;
  190. }
  191. }
  192. .detail-cont {
  193. width: 710rpx;
  194. margin: 0 auto;
  195. background-color: #ffffff;
  196. border-radius: 20rpx;
  197. padding: 20rpx 0;
  198. overflow: hidden;
  199. transform: translateY(-80rpx);
  200. .info-li {
  201. padding: 0 30rpx;
  202. line-height: 80rpx;
  203. .label {
  204. float: left;
  205. color: #6c6c6c;
  206. }
  207. .value {
  208. float: right;
  209. }
  210. .money-label {
  211. font-weight: bold;
  212. }
  213. .money-value {
  214. font-weight: bold;
  215. font-size: 30rpx;
  216. }
  217. }
  218. .remark-li {
  219. padding: 0 30rpx;
  220. .label {
  221. color: #6c6c6c;
  222. line-height: 60rpx;
  223. }
  224. }
  225. .b-b {
  226. border-bottom: 1px solid #eeeeee;
  227. }
  228. .goods-title {
  229. background-color: #5e6a84;
  230. line-height: 72rpx;
  231. width: 644rpx;
  232. margin: 30rpx auto 0;
  233. color: #ffffff;
  234. border-top-left-radius: 20rpx;
  235. border-top-right-radius: 20rpx;
  236. padding: 0 24rpx;
  237. position: relative;
  238. z-index: 1;
  239. }
  240. .goods-ul {
  241. padding: 0 30rpx 30rpx;
  242. box-shadow: 0px -3px 12rpx 0px #e4eaf5;
  243. border-bottom: 1px solid #eeeeee;
  244. .goods-li {
  245. padding-top: 24rpx;
  246. .goods-img {
  247. margin-right: 20rpx;
  248. image {
  249. width: 150rpx;
  250. height: 150rpx;
  251. border-radius: 8rpx;
  252. display: block;
  253. }
  254. }
  255. .info {
  256. .goods-name {
  257. width: 470rpx;
  258. height: 34rpx;
  259. line-height: 34rpx;
  260. }
  261. .goods-code {
  262. font-size: 24rpx;
  263. padding-top: 10rpx;
  264. }
  265. .goods-num {
  266. padding-top: 10rpx;
  267. font-size: 24rpx;
  268. .price {
  269. font-size: 28rpx;
  270. font-weight: bold;
  271. color: $uni-color-error;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. </style>