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

225 lines
5.9 KiB

  1. <template>
  2. <view>
  3. <view class="head" v-if="$isRight(order)">
  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="order.supplier.logo" class="image"></image>
  9. <view class="info">
  10. <view class="lf-font-32 lf-color-black lf-font-bold">{{ order.supplier.supplier_name }}</view>
  11. <view class="lf-font-24 lf-color-555">{{ order.supplier.address }}</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. <lf-stepbar :list="order.state_log" v-if="order.state_log"></lf-stepbar>
  19. </view>
  20. <self-line></self-line>
  21. <view class="head">
  22. <view class="lf-row-between list">
  23. <view>车辆</view>
  24. <view class="lf-font-bold"></view>
  25. </view>
  26. <view class="lf-row-between list">
  27. <view>司机</view>
  28. <view class="lf-font-bold"></view>
  29. </view>
  30. <view class="lf-row-between list">
  31. <view>联系电话</view>
  32. <view class="lf-font-bold"></view>
  33. </view>
  34. <view class="list">
  35. <view>证明材料</view>
  36. <view class="lf-flex-wrap lf-m-t-10">
  37. <image :src="item.voucher_pic" @click="lookImage(index)" class="ms-img" v-for="(item, index) in order.voucher" :key="item.id"></image>
  38. </view>
  39. </view>
  40. </view>
  41. <self-line></self-line>
  42. <view class="lf-m-t-30 lf-m-l-32">
  43. <view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view>
  44. <wyb-table :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" width="max-content" height="350rpx"></wyb-table>
  45. </view>
  46. <view style="height: 100rpx;"></view>
  47. <!-- 操作按钮 -->
  48. <view class="fixed-bottom" v-if="type != 3">
  49. <view v-if="type == 1" class="lf-row-flex-end">
  50. <button class="btn btn1">编辑</button>
  51. <button class="btn btn2">立即发单</button>
  52. </view>
  53. <view v-else-if="type == 2" class="lf-row-flex-end">
  54. <button class="btn btn2" style="background-color: #FF0000;">撤销订单</button>
  55. </view>
  56. <view v-else-if="type == 4" class="lf-row-flex-end">
  57. <button class="btn btn1">退单</button>
  58. <button class="btn btn1 lf-m-l-20">上传凭证</button>
  59. <button class="btn btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button>
  60. </view>
  61. <view v-else-if="type == 5" class="lf-row-between">
  62. <button class="btn btn1">复用采购单</button>
  63. <view class="lf-font-32" style="color: #11D189;">已完成</view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import lfYsteps from '@/components/lf-ysteps/lf-ysteps';
  70. import wybTable from '@/components/wyb-table/wyb-table';
  71. export default {
  72. components: { lfYsteps, wybTable },
  73. data(){
  74. return {
  75. headers: [{
  76. key: 'name',
  77. label: '菜名'
  78. },{
  79. key: 'spec',
  80. label: '规格'
  81. },{
  82. key: 'pre_tax_price',
  83. label: '税前价格'
  84. },{
  85. key: 'after_tax_price',
  86. label: '税后价格'
  87. }],
  88. contents: [],
  89. order: {},
  90. p_sn: '',
  91. type: 4
  92. }
  93. },
  94. onLoad(options){
  95. // TODO 1、凭证上传流程变动:当采购单状态为已发货状态时,食堂可以上传凭证图片;
  96. // TODO 2、食堂收货时,实到数、实收数默认填充采购数量;
  97. this.p_sn = options.p_sn || '';
  98. // TODO 显示车辆等信息,显示table信息
  99. this.getData();
  100. },
  101. methods: {
  102. getData(){
  103. this.$http(this.API.API_CANTEEN_PURCHASEDETAIL, {
  104. p_sn: this.p_sn
  105. // p_sn: '802316269455228606'
  106. }).then(res => {
  107. console.log("xxx",res)
  108. this.order = res.data.order;
  109. let list = res.data.order.sheet || [];
  110. let contents = list.map(item => {
  111. return {
  112. name: item.material.m_name,
  113. spec: item.spec.name,
  114. pre_tax_price: {edit: true, value: item.tax_standard_price},
  115. after_tax_price: {edit: true, value: item.non_tax_standard_price},
  116. spec_id: item.spec.id,
  117. material_id: item.material.id
  118. }
  119. })
  120. this.contents = contents;
  121. })
  122. },
  123. // 预览图片
  124. lookImage(index){
  125. this.$u.throttle(() => {
  126. let images = this.order.voucher.map(item => item.voucher_pic);
  127. uni.previewImage({
  128. urls: images,
  129. current: index
  130. })
  131. }, 200);
  132. },
  133. // 改变订单状态 TODO
  134. orderStateChange(state){
  135. this.$http(this.API.API_CANTEEN_PURCHASEUPDATE, {
  136. p_sn: this.p_sn,
  137. state: state
  138. }).then(res => {
  139. console.log("orderStateChange", res);
  140. this.$msg('操作成功');
  141. })
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped="scoped">
  147. .head{
  148. padding: 0 32rpx;
  149. width: 750rpx;
  150. box-sizing: border-box;
  151. height: auto;
  152. .list{
  153. padding: 30rpx 0;
  154. border-bottom: 1rpx solid #e5e5e5;
  155. font-size: 28rpx;
  156. color: #555555;
  157. &:last-child{
  158. border-bottom: none;
  159. }
  160. .image{
  161. width: 140rpx;
  162. height: 140rpx;
  163. border-radius: 10rpx;
  164. background-color: #EEEEEE;
  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. .fixed-bottom>view{
  211. width: 100%;
  212. }
  213. .ms-img{
  214. width: 160rpx;
  215. height: 160rpx;
  216. margin-right: 15rpx;
  217. margin-top: 15rpx;
  218. background-color: #EEEEEE;
  219. &:nth-of-type(4n){
  220. margin-right: 0rpx;
  221. }
  222. }
  223. </style>