order-info.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view>
  3. <view v-if="$util.isEmpty(orderInfo)"></view>
  4. <view class="work-info" v-else>
  5. <view class="work-detail">
  6. <view class="order-img">
  7. <image :src="orderInfo.cover"></image>
  8. </view>
  9. <view class="order-item">
  10. <view><text class="left">分类</text><text class="right">{{orderInfo.catName}}</text></view>
  11. <view><text class="left">名称</text><text class="right">{{orderInfo.name}}</text></view>
  12. <view><text class="left">数量</text><text class="right">{{orderInfo.num}}</text></view>
  13. <view><text class="left">商品编号</text><text class="right">{{orderInfo.goodsId}}</text></view>
  14. <view><text class="left">售价</text><text class="right">{{orderInfo.price||''}}</text></view>
  15. <view><text class="left">工单号</text><text class="right">{{orderInfo.workSn}}</text></view>
  16. <view><text class="left">订单号</text><text class="right">{{orderInfo.orderSn}}</text></view>
  17. <view><text class="left">状态</text><text class="right">{{getStatus(orderInfo.status)}}</text></view>
  18. <view><text class="left">备注</text><text class="right">{{orderInfo.remark}}</text></view>
  19. </view>
  20. </view>
  21. <view class="work-item-detail">
  22. <view class="flex-space right-detail-title">单位用材</view>
  23. <view class="unit-use-item">
  24. <view class="commodity-list">
  25. <view v-for="(s, idx) in orderItem" :key="idx" class="commodity-item" >
  26. <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})"></image>
  27. <view class="item-info">
  28. <view class="info-line">
  29. <text class="item-name">{{ s.name }}</text>
  30. <text class="item-price">
  31. <text class="unit">5扎</text>
  32. </text>
  33. </view>
  34. <view class="info-line">
  35. <text class="item-type">20支/扎</text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="summary-bar">
  41. <view class="operate-view" ></view>
  42. <view class="describe-view"><text>2扎</text> <text>3支</text></view>
  43. </view>
  44. </view>
  45. <view style="height:2vh;background-color:#EEEEEE;"></view>
  46. <view class="flex-space right-detail-title"> 累计用材 </view>
  47. <view class="total-use-item">
  48. <view class="commodity-list">
  49. <view v-for="(s, idx) in orderItem" :key="idx" class="commodity-item" >
  50. <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})" />
  51. <view class="item-info">
  52. <view class="info-line">
  53. <text class="item-name">{{ s.name }}</text>
  54. <text class="item-price">
  55. <text class="unit">5扎</text>
  56. </text>
  57. </view>
  58. <view class="info-line">
  59. <text class="item-type">20支/扎</text>
  60. <button class="wastage">报损</button>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="summary-bar">
  66. <view class="operate-view" ></view>
  67. <view class="describe-view"><text>2扎</text> <text>3支</text></view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="button-area">
  72. <view>修改</view>
  73. <view>取消</view>
  74. <view>锁定</view>
  75. <view class="active">完成</view>
  76. <view>打印</view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import { getFullInfo } from '@/api/work'
  83. export default {
  84. data() {
  85. return {
  86. orderInfo:[],
  87. orderItem:[]
  88. }
  89. },
  90. props: {
  91. selectOrderId: {
  92. type: Number,
  93. default: 0
  94. }
  95. },
  96. watch:{
  97. selectOrderId:{
  98. handler(newId){
  99. if(Number(newId)>0){
  100. this.getOrderDetail(newId)
  101. }
  102. },
  103. immediate:true
  104. }
  105. },
  106. methods:{
  107. getStatus(status) {
  108. switch (status) {
  109. case "0":
  110. return "待完成";
  111. break;
  112. case "1":
  113. return "已完成";
  114. break;
  115. case "2":
  116. return "已取消";
  117. break;
  118. default:
  119. return "待完成";
  120. }
  121. },
  122. getOrderDetail(id){
  123. getFullInfo({id}).then(res=>{
  124. if(res.code == 1){
  125. this.orderInfo = res.data.info
  126. this.orderItem = res.data.item
  127. }
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .work-info{
  135. display:flex;
  136. height: 100%;
  137. & .work-detail{
  138. border-right:1upx solid #EEEEEE;
  139. flex: 40;
  140. .order-img{
  141. display:flex;
  142. margin:5upx;
  143. justify-content:center;
  144. image{
  145. width:180upx;
  146. height:180upx;
  147. border-radius:3upx;
  148. }
  149. }
  150. .order-item{
  151. display:flex;
  152. font-size:11upx;
  153. margin-top:10upx;
  154. justify-content: center;
  155. flex-wrap:wrap;
  156. view{
  157. justify-content:space-between;
  158. align-items:center;
  159. display:flex;
  160. border-bottom:1upx solid #EEEEEE;
  161. width:180upx;
  162. height:19upx;
  163. padding:0 10upx 0 10upx;
  164. .left{
  165. color:#CCCCCC;
  166. }
  167. .right{
  168. color:#666666;
  169. }
  170. }
  171. }
  172. }
  173. & .button-area {
  174. flex: 9;
  175. height: 100vh;
  176. display: flex;
  177. flex-direction: column;
  178. justify-content: space-around;
  179. padding: 5upx;
  180. border-left:1upx solid #EEEEEE;
  181. & > view {
  182. border: 1upx solid #EEEEEE;
  183. border-radius: 5upx;
  184. text-align: center;
  185. padding: 10upx 0;
  186. color: #666666;
  187. margin-bottom: 10upx;
  188. font-size: 10upx;
  189. text-align: center;
  190. }
  191. & .active {
  192. color: #1627be;
  193. border-color: #1627be;
  194. font-size: 10upx;
  195. font-weight:bold;
  196. }
  197. }
  198. & .work-item-detail {
  199. flex: 40;
  200. height: 100%;
  201. & .right-detail-title{
  202. font-size:10upx;
  203. font-weight:bold;
  204. margin-left:5upx;
  205. margin-top:5upx;
  206. }
  207. & .unit-use-item {
  208. flex: 40;
  209. display: flex;
  210. flex-direction: column;
  211. .commodity-list {
  212. padding: 5upx;
  213. .commodity-item {
  214. display: flex;
  215. margin-top:5upx;
  216. .item-icon {
  217. flex-shrink: 0;
  218. width: 38upx;
  219. height: 38upx;
  220. border-radius:2upx;
  221. }
  222. .item-info {
  223. display: flex;
  224. flex-direction: column;
  225. flex: 1;
  226. margin-left:6upx;
  227. .info-line {
  228. display: flex;
  229. justify-content: space-between;
  230. align-items: flex-start;
  231. position: relative;
  232. .item-name {
  233. font-size:11upx;
  234. color: black;
  235. overflow: hidden;
  236. white-space: nowrap;
  237. text-overflow: ellipsis;
  238. }
  239. .item-price {
  240. color: #333;
  241. font-size: 10upx;
  242. }
  243. .item-type {
  244. color: #999;
  245. font-size: 8upx;
  246. }
  247. .item-count {
  248. color: #666;
  249. font-size: 11upx;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. .summary-bar {
  256. padding: 0 10upx;
  257. height: 30upx;
  258. display: flex;
  259. align-items: center;
  260. justify-content: space-between;
  261. border-top: 1upx solid #eeeeee;
  262. .operate-view {
  263. display: flex;
  264. align-items: center;
  265. color: #3385ff;
  266. font-size: 12upx;
  267. .iconfont {
  268. margin-right: 20upx;
  269. font-size: 10upx;
  270. }
  271. }
  272. .describe-view {
  273. display: flex;
  274. align-items: center;
  275. color: #333;
  276. font-size: 9upx;
  277. }
  278. }
  279. }
  280. & .total-use-item {
  281. flex: 40;
  282. display: flex;
  283. flex-direction: column;
  284. .commodity-list {
  285. padding: 5upx;
  286. .commodity-item {
  287. display: flex;
  288. margin-top:5upx;
  289. .item-icon {
  290. flex-shrink: 0;
  291. width: 38upx;
  292. height: 38upx;
  293. border-radius:2upx;
  294. }
  295. .item-info {
  296. display: flex;
  297. flex-direction: column;
  298. flex: 1;
  299. margin-left:6upx;
  300. .info-line {
  301. display: flex;
  302. justify-content: space-between;
  303. align-items: flex-start;
  304. position: relative;
  305. .item-name {
  306. font-size:11upx;
  307. color: black;
  308. overflow: hidden;
  309. white-space: nowrap;
  310. text-overflow: ellipsis;
  311. }
  312. .item-price {
  313. color: #333;
  314. font-size: 10upx;
  315. }
  316. .item-type {
  317. color: #999;
  318. font-size: 8upx;
  319. }
  320. .item-count {
  321. color: #666;
  322. font-size: 11upx;
  323. }
  324. .wastage{
  325. position: absolute;
  326. right:0upx;
  327. font-size:9upx;
  328. top:4upx;
  329. color:#666666;
  330. }
  331. }
  332. }
  333. }
  334. }
  335. .summary-bar {
  336. padding: 0 10upx;
  337. height: 30upx;
  338. display: flex;
  339. align-items: center;
  340. justify-content: space-between;
  341. border-top: 1upx solid #eeeeee;
  342. .operate-view {
  343. display: flex;
  344. align-items: center;
  345. color: #3385ff;
  346. font-size: 12upx;
  347. .iconfont {
  348. margin-right: 20upx;
  349. font-size: 10upx;
  350. }
  351. }
  352. .describe-view {
  353. display: flex;
  354. align-items: center;
  355. color: #333;
  356. font-size: 9upx;
  357. }
  358. }
  359. }
  360. }
  361. }
  362. </style>