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

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