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

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