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

247 lines
6.2 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: 'unit'
  70. },{
  71. label: '分类',
  72. key: 'category'
  73. },{
  74. label: '品牌',
  75. key: 'brand'
  76. },{
  77. label: '品级',
  78. key: 'quality_level'
  79. },{
  80. label: '编号',
  81. key: 'number'
  82. },{
  83. label: '起购数',
  84. key: 'purchase_limit'
  85. },{
  86. label: '含税价',
  87. key: 'tax_price'
  88. },{
  89. label: '非含税价',
  90. key: 'non_tax_price'
  91. }],
  92. contents: [],
  93. q_sn: '', // 订单号
  94. show_count: 0
  95. }
  96. },
  97. computed: {
  98. stateClass(){
  99. return function(val){
  100. let class_name = {
  101. '已通过': 'passed',
  102. '待发起': 'wait',
  103. '待审核': 'quoted-price',
  104. '未通过': 'refuse'
  105. }
  106. return class_name[val];
  107. }
  108. }
  109. },
  110. onLoad(options){
  111. this.q_sn = options.q_sn;
  112. this.getDetail();
  113. },
  114. onShow(options){
  115. this.show_count++;
  116. if(this.show_count > 1){
  117. this.getDetail();
  118. }
  119. },
  120. methods: {
  121. stateType(val){
  122. let type = 0;
  123. switch(val){
  124. case '待审核': type = 1; break;
  125. case '待发起': type = 2; break;
  126. case '已通过': type = 3; break;
  127. case '未通过': type = 4; break;
  128. }
  129. this.type = type;
  130. },
  131. getDetail(){
  132. this.$http(this.API.API_SUPPLIER_QUOTATIONDETAIL, {
  133. q_sn: this.q_sn
  134. }).then(res => {
  135. console.log("getDetail", res);
  136. this.stateType(res.data.order.state);
  137. this.order = res.data.order || {};
  138. let list = res.data.order.item || [];
  139. let contents = list.map(item => {
  140. let obj = {
  141. name: item.material?.m_name || '',
  142. material_id: item.material?.id,
  143. spec: item.spec?.name || '',
  144. spec_id: item.spec?.id,
  145. brand: item?.material?.brand || '',
  146. quality_level: item?.material?.quality_level || '',
  147. number: item?.material?.m_sn || '',
  148. tax_price: item.tax_price,
  149. non_tax_price: item.non_tax_price,
  150. purchase_limit: item.purchase_limit,
  151. unit: item?.material?.unit?.unit_name || '',
  152. category: item?.material?.category?.m_cate_name || ''
  153. }
  154. return obj;
  155. });
  156. this.contents = contents;
  157. }).catch(err => {
  158. this.$toBack();
  159. })
  160. },
  161. // 改变订单状态
  162. orderStateChange(state){
  163. this.$http(this.API.API_SUPPLIER_QUOTATIONUPDATE, {
  164. q_sn: this.q_sn,
  165. state: state
  166. }).then(res => {
  167. console.log("revokeOrder", res);
  168. this.$msg('操作成功');
  169. this.getDetail(); // 更新当前页面数据
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped="scoped">
  176. .head{
  177. padding: 0 32rpx;
  178. width: 750rpx;
  179. box-sizing: border-box;
  180. height: auto;
  181. .list{
  182. padding: 30rpx 0;
  183. border-bottom: 1rpx solid #e5e5e5;
  184. font-size: 28rpx;
  185. color: #555555;
  186. &:last-child{
  187. border-bottom: none;
  188. }
  189. }
  190. }
  191. .fixed-bottom{
  192. position: fixed;
  193. bottom: 0rpx;
  194. left: 0rpx;
  195. z-index: 99;
  196. width: 750rpx;
  197. height: 98rpx;
  198. display: flex;
  199. // justify-content: flex-end;
  200. align-items: center;
  201. border-top: 1rpx solid #E5E5E5;
  202. background-color: #FFFFFF;
  203. box-sizing: border-box;
  204. padding: 0 32rpx;
  205. .btn{
  206. width: 212rpx;
  207. height: 82rpx;
  208. border-radius: 41rpx;
  209. margin: 0;
  210. padding: 0;
  211. font-size: 32rpx;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. }
  216. .btn1{
  217. border: 2rpx solid #555555;
  218. opacity: .5;
  219. }
  220. .btn2{
  221. background: #1833F2;
  222. color: #FFFFFF;
  223. margin-left: 20rpx;
  224. }
  225. }
  226. .fixed-bottom>view{
  227. width: 100%;
  228. }
  229. // 已报价,等待审核
  230. .quoted-price{
  231. color: #777777;
  232. }
  233. // 等待报价
  234. .wait{
  235. color: #1833F2;
  236. }
  237. // 已通过审核
  238. .passed{
  239. color: #0BCE5F;
  240. }
  241. // 报价被拒绝
  242. .refuse{
  243. color: #FF0000;
  244. }
  245. </style>