details copy.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="入库详情"
  8. @clickLeft="back"
  9. ></uni-nav-bar>
  10. <view>
  11. <CellInfo label="单号" :value="infoData.bizNum" />
  12. <CellInfo
  13. label="状态"
  14. :value="getDictName(auditStatus, infoData.verifyStatus)"
  15. :valueClass="getAuditStatus(infoData.verifyStatus).class"
  16. >
  17. </CellInfo>
  18. <CellInfo label="创建时间" :value="infoData.createTime" />
  19. </view>
  20. <uni-section title="基本信息" type="line">
  21. <CellInfo
  22. label="来源单据"
  23. :value="infoData.documentSource"
  24. :isLink="true"
  25. />
  26. <CellInfo
  27. label="入库类型"
  28. :value="getDictValue('物品类型', infoData.assetType)"
  29. />
  30. <CellInfo label="权属部门" :value="infoData.deptName" />
  31. <CellInfo label="入库登记人" :value="infoData.createUserName" />
  32. <CellInfo label="入库时间" :value="infoData.verifyTime" />
  33. <CellInfo label="审核人" :value="infoData.verifyName" />
  34. <CellInfo label="供应商" :value="infoData.supplierName" />
  35. <CellInfo label="送货人" :value="infoData.deliveryName" />
  36. <CellInfo label="送货人联系方式" :value="infoData.deliveryPhone" />
  37. <CellInfo
  38. label="紧急状态"
  39. :value="getDictName(emergencyState, infoData.urgent)"
  40. />
  41. <!-- <CellInfo
  42. title="附件"
  43. :value="infoData.sourceBill ? infoData.sourceBill : '无 >'"
  44. >
  45. <view slot="value">
  46. </view>
  47. </CellInfo> -->
  48. <CellInfo label="备注" :value="infoData.remark" />
  49. </uni-section>
  50. <uni-section title="明细" type="line" class="listContent">
  51. <u-collapse>
  52. <u-collapse-item
  53. :open="false"
  54. :typeOpen="false"
  55. v-for="(item, index) in warehousingMaterialList"
  56. :key="index"
  57. >
  58. <view class="listBox" slot="title">
  59. <view class="listCont">
  60. <view class="" style="width: 100%">{{ item.assetCode }}</view>
  61. <view class="item"><text>名称:</text>{{ item.assetName }}</view>
  62. <view
  63. class="item"
  64. v-for="(itm, index) in tableHeader"
  65. :key="index"
  66. ><text>{{ itm.label }}:</text>{{ item[itm.prop] }}</view
  67. >
  68. <view class="item"><text>批次号:</text>{{ item.batchNum }}</view>
  69. <view class="item"
  70. ><text>最小包装单元:</text>{{ item.measurementUnit
  71. }}{{ item.unit }} /{{ item.minPackUnit }}</view
  72. >
  73. <view class="item"
  74. ><text>包装数量:</text>{{ item.outInNum }}</view
  75. >
  76. <view class="item"
  77. ><text>单价:</text>
  78. <template v-if="item.univalence || item.univalence === 0">
  79. {{ item.univalence
  80. }}{{ { yuan: '元', wanyuan: '万元' }[item.univalenceUnit] }}
  81. </template></view
  82. >
  83. <view class="item"
  84. ><text>总额:</text
  85. >{{
  86. calcSum(
  87. item.outInNum,
  88. item.measurementUnit,
  89. item.univalence,
  90. item
  91. )
  92. }}</view
  93. >
  94. <view class="item" v-if="infoData.assetType === 3"
  95. ><text>质检单:</text
  96. ><text
  97. class="text-primary"
  98. @tap.stop.prevent="viewFile(item.contentImage)"
  99. >查看</text
  100. ></view
  101. >
  102. <view class="item" style="width: 100%"
  103. ><text>仓库:</text
  104. >{{
  105. `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`
  106. }}</view
  107. >
  108. </view>
  109. </view>
  110. <view
  111. v-for="(itm, index) in item.warehouseLedgerDetails"
  112. class="codeList"
  113. :key="index"
  114. >
  115. <view style="width: 100%"
  116. >{{ getDictValue('物品类型', infoData.assetType) }}编码:{{
  117. itm.onlyCode
  118. }}</view
  119. >
  120. <view style="min-width: 20%">包装编码:{{ itm.num }}</view>
  121. <view
  122. >{{ itm.procurementTime ? '采购日期' : '生产日期' }}:{{
  123. itm.manufactureTime || itm.procurementTime
  124. }}</view
  125. >
  126. </view>
  127. </u-collapse-item>
  128. </u-collapse>
  129. </uni-section>
  130. <u-overlay :show="show" @click="show = false">
  131. <view class="warp">
  132. <image :src="imgs"></image>
  133. </view>
  134. </u-overlay>
  135. </view>
  136. </template>
  137. <script>
  138. import {
  139. warehousingType,
  140. sceneState,
  141. inputStatus,
  142. emergencyState,
  143. auditStatus,
  144. getDictName,
  145. getDict,
  146. materialType
  147. } from '../enum.js'
  148. import CellInfo from '@/components/CellInfo.vue'
  149. import { post, get, postB } from '@/utils/api.js'
  150. import getinput from '@/components/Getinput'
  151. import { tableHeader } from '../common'
  152. import dictMixins from '@/mixins/dictMixins.js'
  153. export default {
  154. components: {
  155. getinput,
  156. CellInfo
  157. // addDetails,
  158. },
  159. mixins: [dictMixins],
  160. data () {
  161. return {
  162. show: false,
  163. materialType,
  164. emergencyState,
  165. warehousingType,
  166. auditStatus,
  167. getDictName,
  168. getAuditStatus: getDict(auditStatus),
  169. id: '',
  170. code: '',
  171. infoData: {},
  172. warehousingMaterialList: [],
  173. imgs: ''
  174. }
  175. },
  176. onLoad (params) {
  177. this.id = params.id
  178. this.requestDict('物品类型')
  179. },
  180. onShow () {
  181. this.getDetails()
  182. },
  183. computed: {
  184. tableHeader () {
  185. return tableHeader(this.infoData.assetType)
  186. },
  187. isMaterial () {
  188. return this.infoData.assetType == 3
  189. },
  190. warehousingName () {
  191. return getDictName(warehousingType, this.infoData.assetType)
  192. },
  193. // 条码信息
  194. materialCodeReqList () {
  195. return this.warehousingMaterialList
  196. .map(i => i.warehouseLedgerDetails || [])
  197. .flat()
  198. }
  199. },
  200. methods: {
  201. calcSum (a, b, c, row) {
  202. if (
  203. (Number.isNaN(+a) && a !== '') ||
  204. (Number.isNaN(+b) && b !== '') ||
  205. (Number.isNaN(+c) && c !== '')
  206. ) {
  207. return ''
  208. }
  209. return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit]
  210. },
  211. viewFile (list) {
  212. this.show = true
  213. this.imgs = this.apiUrl + list[0]?.accessUrl || ''
  214. },
  215. //获取信息
  216. getDetails () {
  217. get(this.apiUrl + `/outInWarehouse/select/detail/${this.id}`, {})
  218. .then(res => {
  219. if (res?.success) {
  220. this.warehousingMaterialList = res.data.warehouseLedgerInfos
  221. this.infoData = res.data.outInWarehouse
  222. }
  223. })
  224. .catch(res => {})
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. .mainBox {
  231. padding-bottom: 120rpx;
  232. /deep/.content-class {
  233. background-color: rgba(240, 243, 243, 1);
  234. }
  235. }
  236. .warp {
  237. display: flex;
  238. justify-content: center;
  239. align-items: center;
  240. width: 100%;
  241. height: 100%;
  242. }
  243. .codeList {
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. flex-wrap: wrap;
  248. padding: 10rpx 0;
  249. font-size: 28rpx;
  250. border-bottom: 1rpx solid #ccc;
  251. view {
  252. }
  253. }
  254. .picList {
  255. display: flex;
  256. align-items: center;
  257. justify-items: flex-start;
  258. flex-wrap: wrap;
  259. }
  260. /deep/.picList .u-image {
  261. margin-right: 10rpx;
  262. margin-bottom: 10rpx;
  263. }
  264. /deep/.cLine .u-line:nth-child(1) {
  265. border-bottom: none !important;
  266. }
  267. .listContent {
  268. position: relative;
  269. // bottom: 50px;
  270. .selectEnterType {
  271. position: absolute;
  272. right: 10px;
  273. top: 10px;
  274. }
  275. .more {
  276. position: absolute;
  277. bottom: 26rpx;
  278. right: 30rpx;
  279. font-size: 28rpx;
  280. color: #fff !important;
  281. background-color: #36a82c;
  282. }
  283. }
  284. .footBox {
  285. position: fixed;
  286. left: 0px;
  287. bottom: 0px;
  288. height: 100rpx;
  289. width: 100%;
  290. display: flex;
  291. align-items: center;
  292. justify-content: space-between;
  293. view {
  294. width: 50%;
  295. height: 100%;
  296. text-align: center;
  297. color: #fff;
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. }
  302. .reg {
  303. background: $u-success-dark;
  304. }
  305. .uni-icons {
  306. margin-right: 8rpx !important;
  307. }
  308. }
  309. .listBox {
  310. border-bottom: 1px #f2f2f2 solid;
  311. position: relative;
  312. .listTit {
  313. display: flex;
  314. align-items: center;
  315. .name {
  316. width: 50%;
  317. margin-left: 10px;
  318. overflow: hidden;
  319. white-space: nowrap;
  320. -o-text-overflow: ellipsis;
  321. text-overflow: ellipsis;
  322. font-size: 30rpx;
  323. }
  324. .weight {
  325. font-size: 30rpx;
  326. margin-left: auto;
  327. margin-right: 60rpx;
  328. position: relative;
  329. }
  330. .weight::after {
  331. position: absolute;
  332. right: -30rpx;
  333. top: 50%;
  334. content: '';
  335. background: #eee;
  336. width: 1px;
  337. height: 28rpx;
  338. margin-top: -14rpx;
  339. }
  340. }
  341. .listCont {
  342. display: flex;
  343. align-items: center;
  344. flex-wrap: wrap;
  345. margin-top: 20rpx;
  346. margin-left: 10rpx;
  347. .item {
  348. width: 50%;
  349. font-size: $uni-font-size-sm;
  350. line-height: 45rpx;
  351. overflow: hidden;
  352. white-space: nowrap;
  353. text-overflow: ellipsis;
  354. -o-text-overflow: ellipsis;
  355. color: #000;
  356. }
  357. .item text {
  358. color: #666;
  359. }
  360. }
  361. .more {
  362. position: absolute;
  363. bottom: 26rpx;
  364. right: 30rpx;
  365. font-size: 28rpx;
  366. color: #666;
  367. }
  368. }
  369. .listBox:last-child {
  370. border: none !important;
  371. }
  372. .xuanze-css {
  373. color: #eee;
  374. background-color: #36a82c;
  375. font-size: 15px;
  376. position: absolute;
  377. right: 0px;
  378. top: 7px;
  379. cursor: pointer;
  380. }
  381. .btn-top {
  382. width: 100%;
  383. height: 70px;
  384. background-color: #fff;
  385. border-top: 1px solid rgb(211, 208, 208);
  386. position: fixed;
  387. top: 90%;
  388. z-index: 1px;
  389. display: flex;
  390. justify-content: right;
  391. line-height: 70px;
  392. view {
  393. width: 55px;
  394. text-align: center;
  395. color: #fff;
  396. margin-left: 6px;
  397. background-color: #36a82c;
  398. }
  399. }
  400. .jian-css {
  401. background-color: #36a82c;
  402. color: #fff;
  403. border-radius: 2px;
  404. }
  405. .laing-css {
  406. background-color: #409eff;
  407. color: #fff;
  408. border-radius: 2px;
  409. }
  410. </style>