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

195 lines
4.6 KiB

  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="lf-row-between list">
  5. <view>订单编号</view>
  6. <view class="lf-color-black">{{ order.q_sn }}</view>
  7. </view>
  8. <view class="lf-row-between list">
  9. <view>订单状态</view>
  10. <view :class="stateClass(order.state)">{{ order.state }}</view>
  11. </view>
  12. <view class="lf-row-between list">
  13. <view>报价商</view>
  14. <view class="lf-color-black">{{ order.contact_name }}</view>
  15. </view>
  16. </view>
  17. <self-line></self-line>
  18. <view class="lf-m-t-30 lf-m-l-32">
  19. <view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">报价明细</view>
  20. <wyb-table :headers="headers" :contents="contents" :first-line-fixed="true" contentBgColor="#eef6fe" width="max-content" height="350rpx"></wyb-table>
  21. </view>
  22. <view style="height: 100rpx;"></view>
  23. <!-- 操作按钮 -->
  24. <view class="fixed-bottom">
  25. <view v-if="type == 1" class="lf-row-flex-end">
  26. <button class="btn btn2" style="background-color: #FF0000;" @click="revokeOrder">撤销订单</button>
  27. </view>
  28. <view v-if="type == 2" class="lf-row-flex-end">
  29. <button class="btn btn1" @click="$url('/pages/supply/offer/index?type=1&code='+ order.q_sn)">编辑</button>
  30. <button class="btn btn2" @click="initiateQuotation">发起报价</button>
  31. </view>
  32. <view v-if="type == 3 || type == 4" class="lf-row-between">
  33. <button class="btn btn1" @click="$url('/pages/supply/offer/index?type=2&code='+ order.q_sn)">复用报价单</button>
  34. <button class="btn btn1" @click="$url('/pages/supply/offer/index?type=3&code='+ order.batch_sn)">复用批次号</button>
  35. <view class="lf-font-32" style="color: #11D189;" v-if="type == 3">报价已通过</view>
  36. <view class="lf-font-32" style="color: #FF0000;" v-if="type == 4">报价已被拒绝</view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import wybTable from '@/components/wyb-table/wyb-table';
  43. export default {
  44. components: { wybTable },
  45. data(){
  46. return {
  47. type: 3,
  48. order: {},
  49. headers: [{
  50. label: '菜品名称',
  51. key: 'name'
  52. },{
  53. label: '规格',
  54. key: 'spec'
  55. },{
  56. label: '税前价',
  57. key: 'pre_tax_price'
  58. },{
  59. label: '税后价',
  60. key: 'after_tax_price'
  61. }],
  62. contents: [],
  63. q_sn: '' // 订单号
  64. }
  65. },
  66. computed: {
  67. stateClass(){
  68. return function(val){
  69. let class_name = {
  70. '已通过': 'quoted-price',
  71. '待发起': 'wait',
  72. '待审核': 'passed',
  73. '未通过': 'refuse'
  74. }
  75. return class_name[val];
  76. }
  77. }
  78. },
  79. onLoad(options){
  80. this.q_sn = options.q_sn;
  81. this.getDetail();
  82. },
  83. methods: {
  84. getDetail(){
  85. this.$http(this.API.API_SUPPLIER_QUOTATIONDETAIL, {
  86. q_sn: this.q_sn
  87. }).then(res => {
  88. console.log("getDetail", res);
  89. this.order = res.data.order || {};
  90. let list = res.data.order.item || [];
  91. let contents = list.map(item => {
  92. let obj = {
  93. name: item.material?.m_name,
  94. material_id: item.material?.id,
  95. spec: item.spec?.name,
  96. spec_id: item.spec?.id,
  97. pre_tax_price: item.tax_price,
  98. after_tax_price: item.non_tax_price
  99. }
  100. return obj;
  101. });
  102. this.contents = contents;
  103. })
  104. },
  105. // 发起报价
  106. initiateQuotation(){
  107. // todo 是传入全部信息还是改变订单状态
  108. },
  109. // 撤销订单
  110. revokeOrder(){
  111. this.$http(this.API.API_SUPPLIER_QUOTATIONUPDATE, {
  112. q_sn: this.q_sn,
  113. state: '待发起'
  114. }).then(res => {
  115. console.log("revokeOrder", res);
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped="scoped">
  122. .head{
  123. padding: 0 32rpx;
  124. width: 750rpx;
  125. box-sizing: border-box;
  126. height: auto;
  127. .list{
  128. padding: 30rpx 0;
  129. border-bottom: 1rpx solid #e5e5e5;
  130. font-size: 28rpx;
  131. color: #555555;
  132. &:last-child{
  133. border-bottom: none;
  134. }
  135. }
  136. }
  137. .fixed-bottom{
  138. position: fixed;
  139. bottom: 0rpx;
  140. left: 0rpx;
  141. z-index: 99;
  142. width: 750rpx;
  143. height: 98rpx;
  144. display: flex;
  145. // justify-content: flex-end;
  146. align-items: center;
  147. border-top: 1rpx solid #E5E5E5;
  148. background-color: #FFFFFF;
  149. box-sizing: border-box;
  150. padding: 0 32rpx;
  151. .btn{
  152. width: 212rpx;
  153. height: 82rpx;
  154. border-radius: 41rpx;
  155. margin: 0;
  156. padding: 0;
  157. font-size: 32rpx;
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. }
  162. .btn1{
  163. border: 2rpx solid #555555;
  164. opacity: .5;
  165. }
  166. .btn2{
  167. background: #1833F2;
  168. color: #FFFFFF;
  169. margin-left: 20rpx;
  170. }
  171. }
  172. .fixed-bottom>view{
  173. width: 100%;
  174. }
  175. // 已报价,等待审核
  176. .quoted-price{
  177. color: #777777;
  178. }
  179. // 等待报价
  180. .wait{
  181. color: #1833F2;
  182. }
  183. // 已通过审核
  184. .passed{
  185. color: #0BCE5F;
  186. }
  187. // 报价被拒绝
  188. .refuse{
  189. color: #FF0000;
  190. }
  191. </style>