自主产品,供应链食堂系统。将两个端拆开了。
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.

156 lines
3.6 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/classification/warehouse')">
  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" :contents="contents" contentBgColor="#ecfaf5" :first-line-fixed="true" @onInputChange="onInputChange" width="max-content" height="800rpx"></wyb-table>
  18. </view>
  19. <!-- 操作按钮 -->
  20. <view class="fixed-bottom">
  21. <button class="btn btn1" @click="save(0)">临时保存</button>
  22. <button class="btn btn2" @click="save(1)">直接申请</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: 'material_name'
  37. },{
  38. label: '规格',
  39. key: 'spec_name'
  40. },{
  41. key: 'brand',
  42. label: '品牌'
  43. },{
  44. key: 'quality_level',
  45. label: '品级'
  46. },{
  47. label: '编号',
  48. key: 'm_sn'
  49. },{
  50. label: '供应商',
  51. key: 'supplier_name'
  52. },{
  53. label: '批次',
  54. key: 'purchase_id'
  55. },{
  56. key: 'delivery_number',
  57. label: '出库数量'
  58. }],
  59. contents: [],
  60. warehouse_list: {}
  61. }
  62. },
  63. onLoad(){
  64. // 监听warehouse_list被操作
  65. uni.$on('addWarehouseList', res => {
  66. this.warehouse_list = res;
  67. })
  68. },
  69. onShow(){
  70. let contents = [];
  71. let warehouse_list = this.warehouse_list;
  72. for(let i in warehouse_list){
  73. contents.push(warehouse_list[i]);
  74. }
  75. this.contents = contents;
  76. },
  77. methods: {
  78. // todo table输入框
  79. onInputChange(event){
  80. console.log("检测到table input被更改", event);
  81. // this.contents[event.contentIndex][event.key].value = event.detailValue;
  82. },
  83. // 保存,出库
  84. save(_t){
  85. console.log("dddddd", this.contents)
  86. if(this.contents.length <= 0) {
  87. return this.$msg('您未选择物资')
  88. }
  89. let list = this.contents.map(item => {
  90. return {
  91. m_id: item.material_id,
  92. m_spec_id: item.spec_id,
  93. tax_price: '',
  94. non_tax_price: '',
  95. purchase_id: item.purchase_id,
  96. out_number: ''
  97. }
  98. });
  99. // let state = ['', ''][_t]; // 传入状态
  100. this.$http(this.API.API_CANTEEN_WAREHOUSEOUT, {
  101. data: list
  102. }).then(res => {
  103. console.log("save", res);
  104. this.$msg('操作成功');
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped="scoped">
  111. .lf-m-t-5{
  112. margin-top: 5rpx;
  113. }
  114. .lf-icon{
  115. padding: 2rpx 10rpx;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. }
  120. .fixed-bottom{
  121. position: fixed;
  122. bottom: 0rpx;
  123. left: 0rpx;
  124. z-index: 99;
  125. width: 750rpx;
  126. height: 98rpx;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. border-top: 1rpx solid #E5E5E5;
  131. .btn{
  132. width: 320rpx;
  133. height: 82rpx;
  134. border-radius: 41rpx;
  135. margin: 0;
  136. padding: 0;
  137. font-size: 32rpx;
  138. display: flex;
  139. justify-content: center;
  140. align-items: center;
  141. }
  142. .btn1{
  143. border: 2rpx solid #555555;
  144. opacity: .5;
  145. }
  146. .btn2{
  147. background: #11D189;
  148. color: #FFFFFF;
  149. margin-left: 50rpx;
  150. }
  151. }
  152. </style>