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

215 lines
5.3 KiB

  1. <template>
  2. <view v-if="$isRight(order)">
  3. <view class="head">
  4. <view class="lf-row-between lf-color-gray list">
  5. <view>采购单 {{order.sheet[0].purchase.p_sn}}</view>
  6. </view>
  7. <view class="list">
  8. <!-- <lf-ysteps :stepList="stepList" color="#11D189"></lf-ysteps> -->
  9. <lf-stepbar :list="stepList"></lf-stepbar>
  10. </view>
  11. </view>
  12. <self-line></self-line>
  13. <view class="head">
  14. <view class="lf-row-between list">
  15. <view>申请人</view>
  16. <view class="lf-font-bold">{{order.sheet[0].purchase.contact_name}}</view>
  17. </view>
  18. <view class="lf-row-between list">
  19. <view>联系电话</view>
  20. <view class="lf-font-bold">{{order.sheet[0].purchase.contact_phone}}</view>
  21. </view>
  22. </view>
  23. <self-line></self-line>
  24. <view class="lf-m-t-30 lf-m-l-32">
  25. <view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view>
  26. <wyb-table :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" @onButtonClick="onButtonClick" width="100%" height="350rpx"></wyb-table>
  27. </view>
  28. <view style="height: 100rpx;"></view>
  29. <!-- 操作按钮 -->
  30. <view class="fixed-bottom">
  31. <view v-if="type == '待确认'" class="lf-row-flex-end" style="justify-content: space-between;width: 100%;">
  32. <button class="btn btn1" @click="$url('/pages/delivery/apply?o_sn='+ o_sn+'&enter_type=1')">编辑</button>
  33. <button class="btn btn2">立即申请</button>
  34. </view>
  35. <view v-else-if="type == '已出库'" class="lf-row-between" style="justify-content: space-between;width: 100%;">
  36. <button class="btn btn1" @click="$url('/pages/delivery/apply?o_sn='+ o_sn+'&enter_type=2')">复用出库单</button>
  37. <view class="lf-font-32" style="color: #11D189;">已出库</view>
  38. </view>
  39. <view v-else class="lf-row-between">
  40. <view></view>
  41. <view class="lf-font-32" style="color: #1833F2;">{{type}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import lfYsteps from '@/components/lf-ysteps/lf-ysteps';
  48. import wybTable from '@/components/wyb-table/wyb-table';
  49. export default {
  50. components: { lfYsteps, wybTable },
  51. data(){
  52. return {
  53. stepList: [],
  54. headers: [{
  55. label: '物资名称',
  56. key: 'material_name'
  57. },{
  58. label: '规格',
  59. key: 'spec_name'
  60. },{
  61. key: 'brand',
  62. label: '品牌'
  63. },{
  64. key: 'quality_level',
  65. label: '品级'
  66. },{
  67. label: '编号',
  68. key: 'm_sn'
  69. },{
  70. label: '供应商',
  71. key: 'supplier_name'
  72. },{
  73. label: '批次',
  74. key: 'purchase_id'
  75. },{
  76. key: 'delivery_number',
  77. label: '出库数量'
  78. }],
  79. contents: [],
  80. o_sn: '',
  81. order: {},
  82. type: 4,
  83. }
  84. },
  85. onLoad(options){
  86. this.o_sn = options.id || '';
  87. this.getData();
  88. },
  89. methods: {
  90. getData(){
  91. this.$http(this.API.API_CANTEEN_OUTDETAIL, {
  92. o_sn: this.o_sn
  93. }).then(res => {
  94. this.order = res.data
  95. this.stepList = this.order.state_log.map((item, index) => {
  96. item.isFinished = false;
  97. if(index == this.order.state_log.length - 1){
  98. if(item.action == '订单已完成' || item.action == '订单已退款'){
  99. item.isFinished = true;
  100. }
  101. }
  102. return item;
  103. })
  104. let list = res.data.sheet || [];
  105. let contents = list.map(item => {
  106. console.log(item)
  107. return {
  108. material_name: item.material.m_name,
  109. spec_name: item.spec.name,
  110. brand: item.material.brand,
  111. quality_level: item.material.quality_level,
  112. m_sn: item.material.m_sn,
  113. supplier_name: item.purchase.supplier.supplier_name,
  114. purchase_id: item.purchase_id,
  115. delivery_number: item.out_number
  116. }
  117. })
  118. this.contents = contents;
  119. console.log(this.contents)
  120. this.type = res.data.state
  121. })
  122. },
  123. onButtonClick(event){
  124. uni.showModal({
  125. title: '温馨提示',
  126. content: '您确定移除该项吗?',
  127. success: result => {
  128. if(result.confirm){
  129. console.log("移除某一项", event);
  130. let { contentIndex } = event;
  131. this.contents.splice(contentIndex, 1);
  132. }
  133. }
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped="scoped">
  140. .head{
  141. padding: 0 32rpx;
  142. width: 750rpx;
  143. box-sizing: border-box;
  144. height: auto;
  145. .list{
  146. padding: 30rpx 0;
  147. border-bottom: 1rpx solid #e5e5e5;
  148. font-size: 28rpx;
  149. color: #555555;
  150. &:last-child{
  151. border-bottom: none;
  152. }
  153. .image{
  154. width: 140rpx;
  155. height: 140rpx;
  156. border-radius: 10rpx;
  157. }
  158. .info{
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: space-around;
  162. width: 530rpx;
  163. height: 140rpx;
  164. }
  165. }
  166. }
  167. .fixed-bottom{
  168. position: fixed;
  169. bottom: 0rpx;
  170. left: 0rpx;
  171. z-index: 99;
  172. width: 750rpx;
  173. height: 98rpx;
  174. display: flex;
  175. justify-content: flex-end;
  176. align-items: center;
  177. border-top: 1rpx solid #E5E5E5;
  178. background-color: #FFFFFF;
  179. box-sizing: border-box;
  180. padding: 0 32rpx;
  181. .btn{
  182. width: 212rpx;
  183. height: 82rpx;
  184. border-radius: 41rpx;
  185. margin: 0;
  186. padding: 0;
  187. font-size: 32rpx;
  188. display: flex;
  189. justify-content: center;
  190. align-items: center;
  191. }
  192. .btn1{
  193. border: 2rpx solid #555555;
  194. opacity: .5;
  195. }
  196. .btn2{
  197. background: #11D189;
  198. color: #FFFFFF;
  199. margin-left: 20rpx;
  200. }
  201. }
  202. .ms-img{
  203. width: 160rpx;
  204. height: 160rpx;
  205. margin-right: 15rpx;
  206. margin-top: 15rpx;
  207. &:nth-of-type(4n){
  208. margin-right: 0rpx;
  209. }
  210. }
  211. </style>