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

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