cylinderDetails.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <!-- 气瓶详情 -->
  2. <template>
  3. <view id="gasCylinderDetails">
  4. <view class="text-max-big-box">
  5. <view class="for-title-box">
  6. <view>气瓶状态:</view>
  7. <view :class="newData.state==1?'colorA':(newData.state==2?'colorB':'')">{{newData.state==0?'待入库':(newData.state==1?'已入库':'已出库')}}</view>
  8. </view>
  9. </view>
  10. <view class="title-p" v-if="newData.state == 1">气瓶信息</view>
  11. <view class="text-max-big-box">
  12. <view class="for-text-box" v-if="!newData.specialGases">
  13. <view>气瓶编码:</view>
  14. <view>{{newData.bottleCode}}</view>
  15. </view>
  16. <view class="for-text-box">
  17. <view>气体:</view>
  18. <view>{{newData.gasName}}</view>
  19. </view>
  20. <view class="for-text-box">
  21. <view>气瓶规格:</view>
  22. <view>{{newData.specification}}</view>
  23. </view>
  24. <view class="for-text-box">
  25. <view>气体类别:</view>
  26. <view>{{newData.gasCategory}}</view>
  27. </view>
  28. <view class="for-text-box">
  29. <view>纯度:</view>
  30. <view>{{newData.purity}}</view>
  31. </view>
  32. <view class="for-text-box" v-if="!newData.specialGases">
  33. <view>压力:</view>
  34. <view>{{newData.pressure}}</view>
  35. </view>
  36. <view class="for-text-box" v-if="newData.state == 2">
  37. <view>实验室名称:</view>
  38. <view>{{newData.subName}}</view>
  39. </view>
  40. <view class="for-text-box" v-if="newData.state == 2">
  41. <view>楼栋:</view>
  42. <view>{{newData.buildName}}</view>
  43. </view>
  44. <view class="for-text-box" v-if="newData.state == 2">
  45. <view>楼层:</view>
  46. <view>{{newData.floorName}}</view>
  47. </view>
  48. <view class="for-text-box" v-if="newData.state == 2">
  49. <view>房间:</view>
  50. <view>{{newData.roomNum}}</view>
  51. </view>
  52. </view>
  53. <view class="title-p" v-if="newData.state == 1">实验室信息</view>
  54. <view class="text-max-big-box" v-if="newData.state == 1">
  55. <view class="for-text-box">
  56. <view>实验室名称:</view>
  57. <view>{{newData.subName}}</view>
  58. </view>
  59. <view class="for-text-box">
  60. <view>楼栋:</view>
  61. <view>{{newData.buildName}}</view>
  62. </view>
  63. <view class="for-text-box">
  64. <view>楼层:</view>
  65. <view>{{newData.floorName}}</view>
  66. </view>
  67. <view class="for-text-box">
  68. <view>房间:</view>
  69. <view>{{newData.roomNum}}</view>
  70. </view>
  71. </view>
  72. <view class="text-max-big-box" v-if="newData.state == 1">
  73. <view class="for-text-box">
  74. <view>签收人:</view>
  75. <view>{{newData.receiver}}</view>
  76. </view>
  77. </view>
  78. <view class="text-max-big-box" v-if="newData.state == 1">
  79. <view class="for-text-box">
  80. <view>费用:</view>
  81. <view>{{newData.latestStorageIn.cost}}</view>
  82. </view>
  83. </view>
  84. <view class="text-max-big-box" v-if="newData.state == 2">
  85. <view class="for-border-box" style="padding-bottom:20rpx;">
  86. <view>出库类型:</view>
  87. <view>{{newData.latestStorageOut.outType==1?'空瓶出库':'满瓶出库'}}</view>
  88. </view>
  89. <view class="for-text-box" style="padding-top:20rpx;">
  90. <view>费用:</view>
  91. <view>{{newData.latestStorageOut.outType==1?newData.latestStorageOut.cost:'0'}}</view>
  92. </view>
  93. </view>
  94. <view class="text-max-big-box" v-if="newData.state == 2">
  95. <view class="for-text-box">
  96. <view>签出人:</view>
  97. <view>{{newData.signerOut}}</view>
  98. </view>
  99. </view>
  100. <view class="text-max-big-box" v-if="newData.state == 1">
  101. <view class="for-img-box">
  102. <view>入库单:</view>
  103. <img class="img-box"
  104. v-for="(item,index) in newData.latestStorageIn.voucherUrl" :key="index"
  105. @click="previewSingleImage(baseUrl+item)"
  106. :src="baseUrl+item">
  107. </view>
  108. <view class="for-text-box">
  109. <view>入库时间:</view>
  110. <view>{{newData.latestStorageIn.storageTime}}</view>
  111. </view>
  112. <view class="for-text-box">
  113. <view>入库人:</view>
  114. <view>{{newData.latestStorageIn.operator}}</view>
  115. </view>
  116. <view class="for-text-box">
  117. <view>联系电话</view>
  118. <view>{{newData.latestStorageIn.operatorPhone}}</view>
  119. </view>
  120. </view>
  121. <view class="text-max-big-box" v-if="newData.state == 2">
  122. <view class="for-img-box">
  123. <view>出库单:</view>
  124. <img class="img-box"
  125. v-for="(item,index) in newData.latestStorageOut.voucherUrl" :key="index"
  126. @click="previewSingleImage(baseUrl+item)"
  127. :src="baseUrl+item">
  128. </view>
  129. <view class="for-text-box">
  130. <view>出库时间:</view>
  131. <view>{{newData.latestStorageOut.storageTime}}</view>
  132. </view>
  133. <view class="for-text-box">
  134. <view>出库人:</view>
  135. <view>{{newData.latestStorageOut.operator}}</view>
  136. </view>
  137. <view class="for-text-box">
  138. <view>联系电话</view>
  139. <view>{{newData.latestStorageOut.operatorPhone}}</view>
  140. </view>
  141. </view>
  142. <view class="text-max-big-box" :class="newData.state == 2?'margin-bottom-p':''">
  143. <view class="for-text-one-box">
  144. <view>备注:</view>
  145. <view v-if="newData.state == 1">{{newData.latestStorageIn.remark}}</view>
  146. <view v-if="newData.state == 2">{{newData.latestStorageOut.remark}}</view>
  147. </view>
  148. </view>
  149. <view v-if="newData.state == 1" class="bottom-button-box">
  150. <view @click="submitButton()">撤回入库</view>
  151. <view @click="goPage()">气瓶出库</view>
  152. </view>
  153. </view>
  154. </template>
  155. <script>
  156. import {
  157. parseTime
  158. } from '@/component/public.js'
  159. import {
  160. config
  161. } from '@/api/request/config.js'
  162. import {
  163. airbottleNewQpAppletBottleDetail,airBottleNewQpAppletBottleStorageWithdraw
  164. } from '@/pages_supplierCylinderManagement/api/index.js'
  165. export default {
  166. data() {
  167. return {
  168. baseUrl: config.base_url,
  169. newData: {
  170. bottleCode: '',
  171. gasName: '',
  172. specification: '',
  173. gasCategory: '',
  174. purity: '',
  175. specialGases: '',
  176. state: '',
  177. pressure: '',
  178. subName: '',
  179. buildName: '',
  180. floorName: '',
  181. roomNum: '',
  182. receiver: '',
  183. cost: '',
  184. latestStorageIn:{
  185. voucherUrl:[],
  186. storageTime:'',
  187. operator:'',
  188. operatorPhone:'',
  189. },
  190. latestStorageOut:{
  191. voucherUrl:[],
  192. storageTime:'',
  193. operator:'',
  194. operatorPhone:'',
  195. },
  196. }
  197. }
  198. },
  199. onLoad(options) {
  200. this.airbottleNewQpAppletBottleDetail(options.id);
  201. },
  202. onShow() {
  203. },
  204. methods: {
  205. //气瓶详情
  206. async airbottleNewQpAppletBottleDetail(id) {
  207. const {
  208. data
  209. } = await airbottleNewQpAppletBottleDetail({
  210. id: id
  211. });
  212. if (data.code == 200) {
  213. if(data.data.latestStorageIn){
  214. data.data.latestStorageIn.storageTime = parseTime(data.data.latestStorageIn.storageTime, "{y}-{m}-{d} {h}:{i}");
  215. data.data.latestStorageIn.voucherUrl = data.data.latestStorageIn.voucherUrl.split(",");
  216. }
  217. if(data.data.latestStorageOut){
  218. data.data.latestStorageOut.storageTime = parseTime(data.data.latestStorageOut.storageTime, "{y}-{m}-{d} {h}:{i}");
  219. data.data.latestStorageOut.voucherUrl = data.data.latestStorageOut.voucherUrl.split(",");
  220. }
  221. this.$set(this,'newData', data.data);
  222. }
  223. },
  224. //撤回入库
  225. async airBottleNewQpAppletBottleStorageWithdraw() {
  226. const {
  227. data
  228. } = await airBottleNewQpAppletBottleStorageWithdraw({
  229. bottleId: this.newData.id
  230. });
  231. if (data.code == 200) {
  232. uni.showToast({
  233. title: '撤回成功',
  234. icon: "success",
  235. mask: true,
  236. duration: 2000
  237. });
  238. setTimeout(function() {
  239. uni.navigateBack({ delta: 1 });
  240. }, 2000);
  241. }
  242. },
  243. //气瓶出库
  244. goPage(){
  245. uni.navigateTo({
  246. url: '/pages_supplierCylinderManagement/views/gasCylinderManagement/outbound?id='+this.newData.id,
  247. });
  248. },
  249. //撤回入库
  250. submitButton(){
  251. let self = this;
  252. uni.showModal({
  253. title: '撤回入库',
  254. content: '撤回后,该气体气瓶的当前状态将被强制回退至待入库。',
  255. showCancel: true,
  256. cancelText: '关闭',
  257. confirmText: '确认撤回',
  258. confirmColor:'#FF0000',
  259. success: (res) => {
  260. if (res.confirm) {
  261. self.airBottleNewQpAppletBottleStorageWithdraw();
  262. }
  263. }
  264. });
  265. },
  266. //预览图片
  267. previewSingleImage(imageUrl) {
  268. uni.previewImage({
  269. urls: [imageUrl] // 必须包裹成数组
  270. });
  271. },
  272. }
  273. }
  274. </script>
  275. <style lang="stylus" scoped>
  276. #gasCylinderDetails {
  277. height: 100%;
  278. width: 100%;
  279. display flex;
  280. flex-direction column;
  281. overflow-y: scroll;
  282. .title-p{
  283. margin: 25rpx 25rpx 0 50rpx;
  284. font-size:28rpx;
  285. }
  286. .text-max-big-box {
  287. padding: 20rpx 30rpx;
  288. background-color: #fff;
  289. border-radius: 10rpx;
  290. margin: 25rpx 25rpx 0;
  291. .for-title-box {
  292. display: flex;
  293. view {
  294. line-height: 60rpx ;
  295. font-weight: 700;
  296. }
  297. view:nth-child(1) {}
  298. view:nth-child(2) {
  299. flex: 1;
  300. text-align: right;
  301. }
  302. .colorA {
  303. color: #FF6B00;
  304. }
  305. .colorB {
  306. color: #0075FF;
  307. }
  308. }
  309. .for-text-box{
  310. display: flex;
  311. view{
  312. line-height: 60rpx
  313. font-weight: 700;
  314. }
  315. view:nth-child(1){
  316. }
  317. view:nth-child(2){
  318. flex:1;
  319. text-align: right;
  320. }
  321. }
  322. .for-border-box{
  323. display: flex;
  324. border-bottom:1rpx solid #dedede;
  325. view{
  326. line-height: 60rpx
  327. font-weight: 700;
  328. }
  329. view:nth-child(1){
  330. }
  331. view:nth-child(2){
  332. flex:1;
  333. text-align: right;
  334. }
  335. }
  336. .for-img-box{
  337. view{
  338. line-height: 60rpx
  339. font-weight: 700;
  340. }
  341. .img-box{
  342. display: inline-block;
  343. margin:15rpx 30rpx 30rpx 15rpx;
  344. width:160rpx;
  345. height:160rpx;
  346. border-radius:12rpx;
  347. overflow: hidden;
  348. }
  349. }
  350. .for-text-one-box{
  351. view{
  352. line-height: 60rpx
  353. font-weight: 700;
  354. }
  355. view:nth-child(1){
  356. }
  357. view:nth-child(2){
  358. padding:10rpx 0 20rpx;
  359. font-size:24rpx;
  360. line-height:30rpx;
  361. }
  362. }
  363. }
  364. .margin-bottom-p{
  365. margin-bottom:60rpx;
  366. }
  367. .bottom-button-box{
  368. display: flex;
  369. margin:40rpx 30rpx 60rpx;
  370. view:nth-child(1){
  371. border:1rpx solid #0183FA;
  372. color:#0183FA;
  373. text-align: center;
  374. border-radius:12rpx;
  375. line-height:80rpx;
  376. width:200rpx;
  377. }
  378. view:nth-child(2){
  379. margin-left:30rpx;
  380. border:1rpx solid #0183FA;
  381. color:#fff;
  382. background-color: #0183fa;
  383. text-align: center;
  384. border-radius:12rpx;
  385. line-height:80rpx;
  386. flex:1;
  387. }
  388. }
  389. }
  390. </style>