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

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