自主项目,食堂系统,前端uniapp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
5.7 KiB

  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="lf-row-between lf-color-gray list">
  5. <view>采购单 {{ order.p_sn }}</view>
  6. </view>
  7. <view class="lf-row-between list">
  8. <image src="../../../static/logo.png" class="image"></image>
  9. <view class="info">
  10. <view class="lf-font-32 lf-color-black lf-font-bold">广西美味生活有限公司</view>
  11. <view class="lf-font-24 lf-color-555">广西南宁青秀区民族大道118号可爱大厦A座0930室</view>
  12. </view>
  13. </view>
  14. </view>
  15. <self-line></self-line>
  16. <view class="lf-p-l-32 lf-p-r-32 lf-border-box lf-bg-white">
  17. <lf-ysteps :stepList="stepList" color="#11D189"></lf-ysteps>
  18. </view>
  19. <self-line></self-line>
  20. <view class="head">
  21. <view class="lf-row-between list">
  22. <view>车辆</view>
  23. <view class="lf-font-bold">桂AX2738</view>
  24. </view>
  25. <view class="lf-row-between list">
  26. <view>司机</view>
  27. <view class="lf-font-bold">李师傅</view>
  28. </view>
  29. <view class="lf-row-between list">
  30. <view>联系电话</view>
  31. <view class="lf-font-bold">{{ order.contact_phone }}</view>
  32. </view>
  33. <view class="list">
  34. <view>证明材料</view>
  35. <view class="lf-flex-wrap lf-m-t-10">
  36. <image src="../../../static/logo.png" class="ms-img" v-for="(item, index) in 4" :key="index"></image>
  37. </view>
  38. </view>
  39. </view>
  40. <self-line></self-line>
  41. <view class="lf-m-t-30 lf-m-l-32">
  42. <view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view>
  43. <wyb-table :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" @onButtonClick="onButtonClick" width="max-content" height="350rpx"></wyb-table>
  44. </view>
  45. <view style="height: 100rpx;"></view>
  46. <!-- 操作按钮 -->
  47. <view class="fixed-bottom">
  48. <button class="btn btn1">退单</button>
  49. <button class="btn btn2" @click="$url('/pages/canteen/purchase/receipt')">确认收货</button>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import lfYsteps from '@/components/lf-ysteps/lf-ysteps';
  55. import wybTable from '@/components/wyb-table/wyb-table';
  56. export default {
  57. components: { lfYsteps, wybTable },
  58. data(){
  59. return {
  60. stepList: [
  61. {
  62. time: '2021-07-23 13:23:52', // 左侧时间 -- 必选
  63. info: '订单创建', // 右侧内容 -- 可选
  64. isFinished: false, // 是否已完成(完成 index 为 √)-- 可选
  65. isActive: true, // 是否为当前节点 Active(当前节点 即使完成 index 也不会显示 √)-- 可选
  66. isShowSlot: false // 右侧是否有 Slot(显示在 右侧内容下方)-- 可选
  67. },
  68. {
  69. time: '2021-07-23 13:23:52',
  70. info: '采购订单发起,等待供应商接单',
  71. isFinished: false,
  72. isActive: true,
  73. isShowSlot: true
  74. },
  75. {
  76. time: '2021-07-23 13:23:52',
  77. info: '供应商已接单,正在装车运输中',
  78. isFinished: false,
  79. isActive: true,
  80. isShowSlot: true
  81. },
  82. {
  83. time: '2021-07-23 13:23:52',
  84. info: '您的包裹已到,已被本人签收',
  85. isFinished: true,
  86. isActive: false,
  87. isShowSlot: true
  88. }
  89. ],
  90. headers: [{
  91. key: 'name',
  92. label: '菜名'
  93. },{
  94. key: 'spec',
  95. label: '规格'
  96. },{
  97. key: 'pre_tax_price',
  98. label: '税前价格'
  99. },{
  100. key: 'after_tax_price',
  101. label: '税后价格'
  102. }],
  103. contents: [],
  104. order: {}
  105. }
  106. },
  107. onLoad(options){
  108. this.getData(options.p_sn);
  109. },
  110. methods: {
  111. getData(p_sn){
  112. this.$http(this.API.API_CANTEEN_PURCHASEDETAIL, {
  113. p_sn: p_sn
  114. // p_sn: '802316269455228606'
  115. }).then(res => {
  116. console.log("xxx",res)
  117. this.order = res.data.order;
  118. let list = res.data.order.sheet || [];
  119. let contents = list.map(item => {
  120. return {
  121. name: item.material.m_name,
  122. spec: item.spec.name,
  123. pre_tax_price: {edit: true, value: item.tax_standard_price},
  124. after_tax_price: {edit: true, value: item.non_tax_standard_price},
  125. spec_id: item.spec.id,
  126. material_id: item.material.id
  127. }
  128. })
  129. this.contents = contents;
  130. })
  131. },
  132. onButtonClick(event){
  133. uni.showModal({
  134. title: '温馨提示',
  135. content: '您确定移除该项吗?',
  136. success: result => {
  137. if(result.confirm){
  138. console.log("移除某一项", event);
  139. let { contentIndex } = event;
  140. this.contents.splice(contentIndex, 1);
  141. }
  142. }
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped="scoped">
  149. .head{
  150. padding: 0 32rpx;
  151. width: 750rpx;
  152. box-sizing: border-box;
  153. height: auto;
  154. .list{
  155. padding: 30rpx 0;
  156. border-bottom: 1rpx solid #e5e5e5;
  157. font-size: 28rpx;
  158. color: #555555;
  159. &:last-child{
  160. border-bottom: none;
  161. }
  162. .image{
  163. width: 140rpx;
  164. height: 140rpx;
  165. border-radius: 10rpx;
  166. }
  167. .info{
  168. display: flex;
  169. flex-direction: column;
  170. justify-content: space-around;
  171. width: 530rpx;
  172. height: 140rpx;
  173. }
  174. }
  175. }
  176. .fixed-bottom{
  177. position: fixed;
  178. bottom: 0rpx;
  179. left: 0rpx;
  180. z-index: 99;
  181. width: 750rpx;
  182. height: 98rpx;
  183. display: flex;
  184. justify-content: flex-end;
  185. align-items: center;
  186. border-top: 1rpx solid #E5E5E5;
  187. background-color: #FFFFFF;
  188. box-sizing: border-box;
  189. padding: 0 32rpx;
  190. .btn{
  191. width: 212rpx;
  192. height: 82rpx;
  193. border-radius: 41rpx;
  194. margin: 0;
  195. padding: 0;
  196. font-size: 32rpx;
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. }
  201. .btn1{
  202. border: 2rpx solid #555555;
  203. opacity: .5;
  204. }
  205. .btn2{
  206. background: #11D189;
  207. color: #FFFFFF;
  208. margin-left: 20rpx;
  209. }
  210. }
  211. .ms-img{
  212. width: 160rpx;
  213. height: 160rpx;
  214. margin-right: 15rpx;
  215. margin-top: 15rpx;
  216. &:nth-of-type(4n){
  217. margin-right: 0rpx;
  218. }
  219. }
  220. </style>