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

227 lines
5.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.q_name }}</view>
  15. </view>
  16. </view>
  17. <self-line></self-line>
  18. <view class="lf-m-t-30 lf-m-l-32 lf-m-r-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="550rpx"></wyb-table>
  21. </view>
  22. <view style="height: 100rpx;"></view>
  23. <!-- 操作按钮 -->
  24. <view class="fixed-bottom" v-if="$isRight(order) && type != 0">
  25. <view v-if="type == 1" class="lf-row-flex-end">
  26. <button class="btn btn2" style="background-color: #FF0000;" @click="orderStateChange('待发起')">撤销订单</button>
  27. </view>
  28. <view v-if="type == 2" class="lf-row-flex-end">
  29. <button class="btn btn1" @click="$url('/pages/offer/index?type=1&code='+ order.q_sn)">编辑</button>
  30. <button class="btn btn2" @click="orderStateChange('待审核')">发起报价</button>
  31. </view>
  32. <view v-if="type == 3 || type == 4" class="lf-row-between">
  33. <button class="btn btn1" @click="$url('/pages/offer/index?type=2&code='+ order.q_sn)">复用报价单</button>
  34. <button class="btn btn1" @click="$url('/pages/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: 0,
  48. order: {},
  49. headers: [{
  50. label: '物资名称',
  51. key: 'name'
  52. },{
  53. label: '规格',
  54. key: 'spec'
  55. },{
  56. label: '品牌',
  57. key: 'brand'
  58. },{
  59. label: '品级',
  60. key: 'quality_level'
  61. },{
  62. label: '编号',
  63. key: 'number'
  64. },{
  65. label: '起购数',
  66. key: 'purchase_limit'
  67. },{
  68. label: '含税价',
  69. key: 'tax_price'
  70. },{
  71. label: '非含税价',
  72. key: 'non_tax_price'
  73. }],
  74. contents: [],
  75. q_sn: '', // 订单号
  76. show_count: 0
  77. }
  78. },
  79. computed: {
  80. stateClass(){
  81. return function(val){
  82. let class_name = {
  83. '已通过': 'passed',
  84. '待发起': 'wait',
  85. '待审核': 'quoted-price',
  86. '未通过': 'refuse'
  87. }
  88. return class_name[val];
  89. }
  90. }
  91. },
  92. onLoad(options){
  93. this.q_sn = options.q_sn;
  94. this.getDetail();
  95. },
  96. onShow(options){
  97. this.show_count++;
  98. if(this.show_count > 1){
  99. this.getDetail();
  100. }
  101. },
  102. methods: {
  103. stateType(val){
  104. let type = 0;
  105. switch(val){
  106. case '待审核': type = 1; break;
  107. case '待发起': type = 2; break;
  108. case '已通过': type = 3; break;
  109. case '未通过': type = 4; break;
  110. }
  111. this.type = type;
  112. },
  113. getDetail(){
  114. this.$http(this.API.API_SUPPLIER_QUOTATIONDETAIL, {
  115. q_sn: this.q_sn
  116. }).then(res => {
  117. console.log("getDetail", res);
  118. this.stateType(res.data.order.state);
  119. this.order = res.data.order || {};
  120. let list = res.data.order.item || [];
  121. let contents = list.map(item => {
  122. let obj = {
  123. name: item.material?.m_name || '',
  124. material_id: item.material?.id,
  125. spec: item.spec?.name || '',
  126. spec_id: item.spec?.id,
  127. brand: item?.material?.brand || '',
  128. quality_level: item?.material?.quality_level || '',
  129. number: item?.material?.m_sn || '',
  130. tax_price: item.tax_price,
  131. non_tax_price: item.non_tax_price,
  132. purchase_limit: item.purchase_limit
  133. }
  134. return obj;
  135. });
  136. this.contents = contents;
  137. }).catch(err => {
  138. this.$toBack();
  139. })
  140. },
  141. // 改变订单状态
  142. orderStateChange(state){
  143. this.$http(this.API.API_SUPPLIER_QUOTATIONUPDATE, {
  144. q_sn: this.q_sn,
  145. state: state
  146. }).then(res => {
  147. console.log("revokeOrder", res);
  148. this.$msg('操作成功');
  149. this.getDetail(); // 更新当前页面数据
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped="scoped">
  156. .head{
  157. padding: 0 32rpx;
  158. width: 750rpx;
  159. box-sizing: border-box;
  160. height: auto;
  161. .list{
  162. padding: 30rpx 0;
  163. border-bottom: 1rpx solid #e5e5e5;
  164. font-size: 28rpx;
  165. color: #555555;
  166. &:last-child{
  167. border-bottom: none;
  168. }
  169. }
  170. }
  171. .fixed-bottom{
  172. position: fixed;
  173. bottom: 0rpx;
  174. left: 0rpx;
  175. z-index: 99;
  176. width: 750rpx;
  177. height: 98rpx;
  178. display: flex;
  179. // justify-content: flex-end;
  180. align-items: center;
  181. border-top: 1rpx solid #E5E5E5;
  182. background-color: #FFFFFF;
  183. box-sizing: border-box;
  184. padding: 0 32rpx;
  185. .btn{
  186. width: 212rpx;
  187. height: 82rpx;
  188. border-radius: 41rpx;
  189. margin: 0;
  190. padding: 0;
  191. font-size: 32rpx;
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. }
  196. .btn1{
  197. border: 2rpx solid #555555;
  198. opacity: .5;
  199. }
  200. .btn2{
  201. background: #1833F2;
  202. color: #FFFFFF;
  203. margin-left: 20rpx;
  204. }
  205. }
  206. .fixed-bottom>view{
  207. width: 100%;
  208. }
  209. // 已报价,等待审核
  210. .quoted-price{
  211. color: #777777;
  212. }
  213. // 等待报价
  214. .wait{
  215. color: #1833F2;
  216. }
  217. // 已通过审核
  218. .passed{
  219. color: #0BCE5F;
  220. }
  221. // 报价被拒绝
  222. .refuse{
  223. color: #FF0000;
  224. }
  225. </style>