inbound.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <!-- 气瓶入库 -->
  2. <template>
  3. <view id="gasCylinderInbound">
  4. <view class="gasCylinderInbound-page">
  5. <view class="content-max-box">
  6. <view class="content-big-box">
  7. <view class="content-title-p">气瓶信息</view>
  8. <view class="content-min-box">
  9. <view class="content-check-box" @click="checkButton(1)">
  10. <view>选择气瓶</view>
  11. <view>{{newData.newData1?'更改':'请选择'}}</view>
  12. <uni-icons class="right-icon" type="right"></uni-icons>
  13. </view>
  14. <view class="content-bottom-text-box" v-if="newData.newData1">
  15. <view class="content-text-box">
  16. <view>气瓶编码:</view>
  17. <view>{{newData.newData2}}</view>
  18. </view>
  19. <view class="content-text-box">
  20. <view>气体:</view>
  21. <view>{{newData.newData3}}</view>
  22. </view>
  23. <view class="content-text-box">
  24. <view>气瓶规格:</view>
  25. <view>{{newData.newData4}}</view>
  26. </view>
  27. <view class="content-text-box">
  28. <view>气体类别:</view>
  29. <view>{{newData.newData5}}</view>
  30. </view>
  31. <view class="content-text-box">
  32. <view>压力:</view>
  33. <view>{{newData.newData6}}</view>
  34. </view>
  35. <view class="content-text-box">
  36. <view>纯度:</view>
  37. <view>{{newData.newData7}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="content-big-box">
  43. <view class="content-title-p">实验室信息</view>
  44. <view class="content-min-box">
  45. <view class="content-check-box" @click="checkButton(2)">
  46. <view>选择气瓶</view>
  47. <view>{{newData.newData8?'更改':'请选择'}}</view>
  48. <uni-icons class="right-icon" type="right"></uni-icons>
  49. </view>
  50. <view class="content-bottom-text-box" v-if="newData.newData8">
  51. <view class="content-text-box">
  52. <view>实验室名称:</view>
  53. <view>{{newData.newData9}}</view>
  54. </view>
  55. <view class="content-text-box">
  56. <view>楼栋:</view>
  57. <view>{{newData.newData10}}</view>
  58. </view>
  59. <view class="content-text-box">
  60. <view>楼层:</view>
  61. <view>{{newData.newData11}}</view>
  62. </view>
  63. <view class="content-text-box">
  64. <view>房间:</view>
  65. <view>{{newData.newData12}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="content-max-input-box">
  71. <view class="name-box">签收人</view>
  72. <input class="uni-input input-box" v-model="newData.newData13" maxlength="20" placeholder="请输入" />
  73. </view>
  74. <view class="content-max-input-box">
  75. <view class="name-box">费用</view>
  76. <input class="uni-input input-box" v-model="newData.newData14" type="number" maxlength="10"
  77. placeholder="请输入" />
  78. </view>
  79. <view class="content-max-up-box">
  80. <view class="name-box">入库单</view>
  81. <view class="up-big-box">
  82. <img class="img-data" v-if="newData.newData15" @click="previewSingleImage(baseUrl+newData.newData15)"
  83. :src="baseUrl+newData.newData15">
  84. <view class="add-button" @click="selectImage()">
  85. <uni-icons type="cloud-upload" size="30" color="#666"></uni-icons>
  86. <view>上传照片</view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="content-max-up-box">
  91. <view class="name-box">备注</view>
  92. <textarea class="textarea textarea-box" placeholder="请输入" maxlength="100"
  93. v-model="newData.newData16"></textarea>
  94. </view>
  95. </view>
  96. <view class="bottom-button-p">确认入库</view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. config
  103. } from '@/api/request/config.js'
  104. export default {
  105. data() {
  106. return {
  107. baseUrl: config.base_url,
  108. newData: {
  109. newData1: '',
  110. newData2: '',
  111. newData3: '',
  112. newData4: '',
  113. newData5: '',
  114. newData6: '',
  115. newData7: '',
  116. newData8: '',
  117. newData9: '',
  118. newData10: '',
  119. newData11: '',
  120. newData12: '',
  121. newData13: '',
  122. newData14: '',
  123. newData15: '',
  124. newData16: '',
  125. }
  126. }
  127. },
  128. onLoad(option) {
  129. },
  130. onShow() {
  131. },
  132. methods: {
  133. checkButton(type) {
  134. if (type == 1) {
  135. uni.navigateTo({
  136. url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectCylinder",
  137. });
  138. } else if (type == 2) {
  139. uni.navigateTo({
  140. url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectLab",
  141. });
  142. }
  143. },
  144. /******图片上传******/
  145. selectImage() {
  146. let self = this;
  147. let photoMaxNun = 0;
  148. wx.chooseImage({
  149. count: photoMaxNun,
  150. sizeType: ["original", "compressed"],
  151. sourceType: ["album", "camera"],
  152. success: function(res) {
  153. if (res.tempFilePaths[0]) {
  154. res.tempFilePaths.forEach(function(item, index) {
  155. self.uploadImg(item);
  156. })
  157. }
  158. }
  159. });
  160. },
  161. async uploadImg(tempFilePaths) {
  162. var self = this;
  163. uni.showLoading({
  164. title: '上传中',
  165. mask: true
  166. });
  167. uni.uploadFile({
  168. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  169. header: {
  170. 'Authorization': uni.getStorageSync('token')
  171. },
  172. filePath: tempFilePaths,
  173. name: 'file',
  174. formData: {
  175. 'user': 'test'
  176. },
  177. success: (uploadFileRes) => {
  178. let res = JSON.parse(uploadFileRes.data);
  179. if (res.code == 200) {
  180. this.$set(this.newData, 'newData15', res.data.url);
  181. } else {
  182. uni.showToast({
  183. title: res.msg,
  184. icon: "none",
  185. mask: true,
  186. duration: 2000
  187. });
  188. }
  189. },
  190. fail: err => {},
  191. complete: () => {
  192. uni.hideLoading()
  193. }
  194. });
  195. },
  196. //预览图片
  197. previewSingleImage(imageUrl) {
  198. uni.previewImage({
  199. urls: [imageUrl] // 必须包裹成数组
  200. });
  201. },
  202. }
  203. }
  204. </script>
  205. <style lang="stylus" scoped>
  206. #gasCylinderInbound {
  207. height: 100%;
  208. width: 100%;
  209. display flex;
  210. flex-direction column;
  211. overflow: hidden;
  212. .gasCylinderInbound-page {
  213. flex: 1;
  214. display flex;
  215. flex-direction column;
  216. overflow: hidden;
  217. .content-max-box {
  218. flex: 1;
  219. display flex;
  220. flex-direction column;
  221. overflow-y: scroll;
  222. .content-big-box {
  223. margin: 0 30rpx 0;
  224. .content-title-p {
  225. line-height: 80rpx;
  226. padding: 0 20rpx;
  227. color: #666;
  228. }
  229. .content-min-box {
  230. background-color: #fff;
  231. border-radius: 12rpx;
  232. .content-check-box {
  233. display: flex;
  234. padding: 40rpx 30rpx;
  235. view {
  236. font-size: 30rpx;
  237. line-height: 40rpx;
  238. }
  239. view:nth-child(1) {
  240. flex: 1;
  241. font-weight: 600;
  242. }
  243. view:nth-child(2) {
  244. font-size: 28rpx;
  245. font-weight: 600;
  246. margin-right: 10rpx;
  247. color: #666;
  248. }
  249. .right-icon {
  250. font-size: 30rpx;
  251. }
  252. }
  253. .content-bottom-text-box {
  254. border-top: 1rpx solid #dedede;
  255. margin: 0 30rpx;
  256. padding: 20rpx 0;
  257. .content-text-box {
  258. display: flex;
  259. view {
  260. font-size: 28rpx;
  261. line-height: 60rpx;
  262. }
  263. view:nth-child(1) {}
  264. view:nth-child(2) {
  265. flex: 1;
  266. text-align: right;
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. .content-max-input-box {
  274. background-color: #fff;
  275. border-radius: 12rpx;
  276. display: flex;
  277. margin: 30rpx 30rpx 0;
  278. padding: 0 30rpx;
  279. .name-box {
  280. font-size: 30rpx;
  281. font-weight: 600;
  282. line-height: 100rpx;
  283. }
  284. .input-box {
  285. flex: 1;
  286. height: 100rpx;
  287. line-height: 100rpx;
  288. text-align: right;
  289. }
  290. }
  291. .content-max-up-box {
  292. background-color: #fff;
  293. border-radius: 12rpx;
  294. margin: 30rpx 30rpx 0;
  295. padding: 0 30rpx;
  296. .name-box {
  297. font-size: 30rpx;
  298. font-weight: 600;
  299. line-height: 100rpx;
  300. }
  301. .up-big-box {
  302. display: flex;
  303. padding: 0 0 30rpx 0;
  304. .img-data {
  305. display: block;
  306. width: 160rpx;
  307. height: 160rpx;
  308. border-radius: 12rpx;
  309. overflow: hidden;
  310. margin-right: 30rpx;
  311. }
  312. .add-button {
  313. border: 1rpx solid #dedede;
  314. border-radius: 12rpx;
  315. width: 160rpx !important;
  316. height: 130rpx;
  317. text-align: center;
  318. color: #666;
  319. font-size: 28rpx;
  320. padding-top: 30rpx;
  321. }
  322. }
  323. .textarea-box {
  324. width: 570rpx;
  325. padding: 30rpx;
  326. border: 1px solid #dedede;
  327. border-radius: 12rpx;
  328. margin-bottom: 30rpx;
  329. }
  330. }
  331. .bottom-button-p {
  332. width: 700rpx;
  333. height: 100rpx;
  334. line-height: 100rpx;
  335. text-align: center;
  336. margin: 30rpx auto 60rpx;
  337. color: #fff;
  338. background-color: #0183FA;
  339. border-radius: 16rpx;
  340. }
  341. }
  342. }
  343. </style>