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

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