自主项目,食堂系统,前端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.

166 lines
3.8 KiB

  1. <template>
  2. <view>
  3. <view class="lf-p-32 lf-p-t-30 lf-p-b-30 lf-w-100 lf-h-maxcontent lf-border-box">
  4. <view class="lf-font-28 lf-color-black lf-row-between">
  5. <view>出库清单</view>
  6. <view class="lf-icon" @click="$url('/pages/canteen/classification/index')">
  7. <u-icon name="plus-circle" size="42"></u-icon>
  8. </view>
  9. </view>
  10. <view class="lf-font-24 lf-color-gray lf-m-t-5">添加物资后可以编辑数量</view>
  11. </view>
  12. <!-- 修饰条 -->
  13. <self-line></self-line>
  14. <!-- 物料table -->
  15. <view class="lf-p-32 lf-p-t-30 lf-p-b-30 lf-w-100 lf-h-maxcontent lf-border-box">
  16. <view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view>
  17. <wyb-table :headers="headers" contentBgColor="#ecfaf5" :first-line-fixed="true" :contents="contents" @onInputChange="onInputChange" width="100%" height="800rpx"></wyb-table>
  18. </view>
  19. <!-- 操作按钮 -->
  20. <view class="fixed-bottom">
  21. <button class="btn btn1">临时保存</button>
  22. <button class="btn btn2">直接申请</button>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import wybTable from '@/components/wyb-table/wyb-table';
  28. export default {
  29. components: {
  30. wybTable
  31. },
  32. data(){
  33. return {
  34. headers: [{
  35. label: '菜品名称',
  36. key: 'name'
  37. },{
  38. label: '规格',
  39. key: 'spec'
  40. },{
  41. label: '税前价',
  42. key: 'preTax'
  43. },{
  44. label: '税后价',
  45. key: 'afterTax'
  46. }],
  47. contents: [{
  48. name: '黄瓜',
  49. spec: '一打/500g',
  50. preTax: {edit: true, value: ''},
  51. afterTax: {edit: true, value: ''}
  52. },{
  53. name: '黄豆',
  54. spec: '5kg',
  55. preTax: {edit: true, value: ''},
  56. afterTax: {edit: true, value: ''}
  57. },{
  58. name: '黄豆',
  59. spec: '5kg',
  60. preTax: {edit: true, value: ''},
  61. afterTax: {edit: true, value: ''}
  62. },{
  63. name: '黄豆',
  64. spec: '5kg',
  65. preTax: {edit: true, value: ''},
  66. afterTax: {edit: true, value: ''}
  67. },{
  68. name: '黄豆',
  69. spec: '5kg',
  70. preTax: {edit: true, value: ''},
  71. afterTax: {edit: true, value: ''}
  72. },{
  73. name: '黄豆',
  74. spec: '5kg',
  75. preTax: {edit: true, value: ''},
  76. afterTax: {edit: true, value: ''}
  77. },{
  78. name: '黄豆',
  79. spec: '5kg',
  80. preTax: {edit: true, value: ''},
  81. afterTax: {edit: true, value: ''}
  82. },{
  83. name: '黄豆',
  84. spec: '5kg',
  85. preTax: {edit: true, value: ''},
  86. afterTax: {edit: true, value: ''}
  87. },{
  88. name: '黄豆',
  89. spec: '5kg',
  90. preTax: {edit: true, value: ''},
  91. afterTax: {edit: true, value: ''}
  92. },{
  93. name: '黄豆',
  94. spec: '5kg',
  95. preTax: {edit: true, value: ''},
  96. afterTax: {edit: true, value: ''}
  97. },{
  98. name: '黄豆',
  99. spec: '5kg',
  100. preTax: {edit: true, value: ''},
  101. afterTax: {edit: true, value: ''}
  102. },{
  103. name: '黄豆',
  104. spec: '5kg',
  105. preTax: {edit: true, value: ''},
  106. afterTax: {edit: true, value: ''}
  107. }]
  108. }
  109. },
  110. onLoad(){
  111. },
  112. methods: {
  113. onInputChange(event){
  114. console.log("检测到table input被更改", event);
  115. this.contents[event.contentIndex][event.key].value = event.detailValue;
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped="scoped">
  121. .lf-m-t-5{
  122. margin-top: 5rpx;
  123. }
  124. .lf-icon{
  125. padding: 2rpx 10rpx;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. }
  130. .fixed-bottom{
  131. position: fixed;
  132. bottom: 0rpx;
  133. left: 0rpx;
  134. z-index: 99;
  135. width: 750rpx;
  136. height: 98rpx;
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. border-top: 1rpx solid #E5E5E5;
  141. .btn{
  142. width: 320rpx;
  143. height: 82rpx;
  144. border-radius: 41rpx;
  145. margin: 0;
  146. padding: 0;
  147. font-size: 32rpx;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. }
  152. .btn1{
  153. border: 2rpx solid #555555;
  154. opacity: .5;
  155. }
  156. .btn2{
  157. background: #11D189;
  158. color: #FFFFFF;
  159. margin-left: 50rpx;
  160. }
  161. }
  162. </style>