detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <view class="detail-page">
  3. <u-navbar
  4. height="40px"
  5. :title="navTitle"
  6. bgColor="#0256FF"
  7. :titleStyle="{ color: '#fff' }"
  8. leftIconColor="#fff"
  9. autoBack
  10. placeholder
  11. >
  12. </u-navbar>
  13. <view class="container_main">
  14. <view class="info-box">
  15. <view class="info-line">
  16. <view class="info-line-label">
  17. <text>货物名称</text>
  18. </view>
  19. <view class="info-line-value">
  20. {{ goodsInfo.materialName }}
  21. </view>
  22. </view>
  23. <view class="info-line">
  24. <view class="info-line-label">
  25. <text>货物条码</text>
  26. </view>
  27. <view class="info-line-value">
  28. {{ goodsInfo.barCode }}
  29. </view>
  30. </view>
  31. <view class="info-line">
  32. <view class="info-line-label">
  33. <text>货物图片</text>
  34. </view>
  35. <view class="info-line-value ss-p-y-24">
  36. <u-image
  37. :src="
  38. goodsInfo.imgNameArr && goodsInfo.imgNameArr.length > 0
  39. ? goodsInfo.imgNameArr[0]
  40. : ''
  41. "
  42. width="120rpx"
  43. height="120rpx"
  44. ></u-image>
  45. </view>
  46. </view>
  47. <view class="info-line">
  48. <view class="info-line-label">
  49. <text>规格</text>
  50. </view>
  51. <view class="info-line-value">
  52. {{ goodsInfo.materialStandard || "-" }}
  53. </view>
  54. </view>
  55. <view class="info-line">
  56. <view class="info-line-label">
  57. <text>批次号</text>
  58. </view>
  59. <view class="info-line-value">
  60. {{ goodsInfo.batchNumber || "-" }}
  61. </view>
  62. </view>
  63. <view class="info-line">
  64. <view class="info-line-label">
  65. <text>生产日期</text>
  66. </view>
  67. <view class="info-line-value">
  68. {{ goodsInfo.productionDate || "-" }}
  69. </view>
  70. </view>
  71. <view class="info-line">
  72. <view class="info-line-label">
  73. <text>库存</text>
  74. </view>
  75. <view class="info-line-value">
  76. {{ goodsInfo.inventory ? (goodsInfo.inventory * 1).toFixed(0) : "0"
  77. }}{{ goodsInfo.commodityUnit || "" }}
  78. </view>
  79. </view>
  80. <view class="info-line">
  81. <view class="info-line-label">
  82. <text>库位</text>
  83. </view>
  84. <view class="info-line-value">
  85. {{ goodsInfo.position || "-" }}
  86. </view>
  87. </view>
  88. <view class="info-line">
  89. <view class="info-line-label">
  90. <text>创建时间</text>
  91. </view>
  92. <view class="info-line-value">
  93. {{ goodsInfo.createTime }}
  94. </view>
  95. </view>
  96. </view>
  97. <view class="crk-box" @click="getMaterialDepotDetail(), (crkShow = true)">
  98. <u-image
  99. src="@/static/image/cgrk-icon.png"
  100. width="48rpx"
  101. height="48rpx"
  102. ></u-image>
  103. <view class="crk-msg">
  104. <view class="crk-msg-name">出入库明细</view>
  105. <view>查看最近的出入库记录</view>
  106. </view>
  107. <u-icon
  108. name="arrow-right"
  109. color="rgba(173, 181, 189, 0.50)"
  110. size="14"
  111. ></u-icon>
  112. </view>
  113. </view>
  114. <!-- 出入库明细 -->
  115. <u-popup
  116. :show="crkShow"
  117. @close="crkShow = false"
  118. round="18"
  119. closeable
  120. :closeOnClickOverlay="false"
  121. >
  122. <view class="crk-cont">
  123. <view class="crk-cont-title">出入库明细</view>
  124. <view class="crk-cont-tab">
  125. <view
  126. class="tab-item"
  127. :class="currentCrkId == item.id ? 'tab-item-active' : ''"
  128. v-for="(item, i) in crkList"
  129. :key="i"
  130. @click="tabClick(item)"
  131. >
  132. {{ item.name }}
  133. </view>
  134. </view>
  135. <scroll-view scroll-y class="scroll-y">
  136. <view class="crk-item" v-for="(item, i) in cukList" :key="item">
  137. <view class="crk-item-title">{{ item.materialName }}</view>
  138. <!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
  139. <view class="crk-item-line"
  140. >货物规格:{{ item.materialStandard }}</view
  141. >
  142. <view class="crk-item-line"
  143. >{{ currentCrkId == "out" ? "出库" : "入库" }}时间:{{
  144. item.warehousingTime || "-"
  145. }}</view
  146. >
  147. <view class="crk-item-line"
  148. >{{ currentCrkId == "out" ? "出库" : "入库" }}数量:{{
  149. (item.actualQuantityInStorage * 1).toFixed(0) || 0
  150. }}{{ item.commodityUnit || "" }}</view
  151. >
  152. <view class="img-box">
  153. <image
  154. v-if="currentCrkId == 'out'"
  155. src="@/static/image/yck-img.png"
  156. width="132rpx"
  157. height="132rpx"
  158. ></image>
  159. <image
  160. v-if="currentCrkId == 'in'"
  161. src="@/static/image/yrk-img.png"
  162. width="132rpx"
  163. height="132rpx"
  164. ></image>
  165. </view>
  166. </view>
  167. <u-empty
  168. mode="data"
  169. text="暂无内容"
  170. marginTop="60"
  171. icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
  172. v-if="cukList.length == 0"
  173. ></u-empty>
  174. <u-divider
  175. text="仅展示最近10条记录"
  176. v-if="cukList.length > 0"
  177. :dashed="true"
  178. ></u-divider>
  179. <view style="height: 40rpx"></view>
  180. </scroll-view>
  181. </view>
  182. </u-popup>
  183. </view>
  184. </template>
  185. <script>
  186. import {
  187. materialDetail,
  188. materialDepotDetail,
  189. } from "@/common/request/apis/purchase";
  190. import { mapGetters } from "vuex";
  191. export default {
  192. data() {
  193. return {
  194. navTitle: "哇哈哈AD盖",
  195. goodsId: 0, //单据id
  196. // materialId:0,//商品id
  197. crkShow: false,
  198. currentCrkId: "out",
  199. crkList: [
  200. {
  201. name: "出库",
  202. id: "out",
  203. },
  204. {
  205. name: "入库",
  206. id: "in",
  207. },
  208. ],
  209. goodsInfo: {},
  210. cukList: [],
  211. };
  212. },
  213. computed: {
  214. ...mapGetters(["depotInfo"]),
  215. curDepotId() {
  216. return this.depotInfo ? this.depotInfo.id : "";
  217. },
  218. curDepotName() {
  219. return this.depotInfo ? this.depotInfo.depotName : "";
  220. },
  221. },
  222. onLoad(e) {
  223. this.navTitle = e.name ? decodeURIComponent(e.name) : "";
  224. this.goodsId = e.id;
  225. // this.materialId = e.materialId
  226. this.getMaterialDetail();
  227. },
  228. methods: {
  229. tabClick(item) {
  230. console.log("tabClick=====", item);
  231. this.currentCrkId = item.id;
  232. this.getMaterialDepotDetail();
  233. },
  234. getMaterialDetail() {
  235. materialDetail(`${this.goodsId}/${this.curDepotId}`).then((res) => {
  236. if (res.code == 200) {
  237. console.log(res.data, "data---------");
  238. if (res.data.imgName && res.data.imgName.length > 0) {
  239. res.data.imgNameArr = res.data.imgName.split(",");
  240. } else {
  241. res.data.imgNameArr = [];
  242. }
  243. this.goodsInfo = res.data;
  244. }
  245. });
  246. },
  247. getMaterialDepotDetail() {
  248. uni.showLoading();
  249. let urlParams = {
  250. type: this.currentCrkId,
  251. materialId: this.goodsInfo.materialId,
  252. depotId: this.curDepotId,
  253. };
  254. let data = { pageNum: 1, pageSize: 10 };
  255. materialDepotDetail(urlParams, data)
  256. .then((res) => {
  257. if (res.code == 200) {
  258. this.cukList = res.data.rows;
  259. }
  260. uni.hideLoading();
  261. })
  262. .catch((err) => {
  263. uni.hideLoading();
  264. });
  265. },
  266. },
  267. };
  268. </script>
  269. <style lang="scss" scoped>
  270. .detail-page {
  271. min-height: 100vh;
  272. background-color: #f0f6fb;
  273. padding: 24rpx;
  274. .container_main {
  275. .info-box {
  276. background-color: #fff;
  277. border-radius: 16rpx 16rpx 0 0;
  278. padding: 24rpx;
  279. .info-line {
  280. border-bottom: 1px solid #f4f4f4;
  281. min-height: 92rpx;
  282. color: #333;
  283. font-family: "PingFang SC";
  284. font-size: 28rpx;
  285. font-weight: 400;
  286. display: flex;
  287. align-items: center;
  288. &-label {
  289. width: 162rpx;
  290. }
  291. .must-box {
  292. color: #ff3b1d;
  293. }
  294. }
  295. }
  296. .crk-box {
  297. border-radius: 16rpx;
  298. background: #fff;
  299. padding: 32rpx 24rpx;
  300. margin-top: 24rpx;
  301. display: flex;
  302. align-items: center;
  303. .crk-msg {
  304. flex: 1;
  305. margin-left: 24rpx;
  306. color: #666;
  307. font-size: 28rpx;
  308. font-weight: 400;
  309. .crk-msg-name {
  310. color: #333;
  311. font-size: 32rpx;
  312. font-weight: bold;
  313. }
  314. }
  315. }
  316. }
  317. .crk-cont {
  318. height: 75vh;
  319. &-title {
  320. height: 80rpx;
  321. line-height: 80rpx;
  322. text-align: center;
  323. color: #1f1f39;
  324. font-size: 36rpx;
  325. font-weight: bold;
  326. }
  327. &-tab {
  328. height: 100rpx;
  329. display: flex;
  330. align-items: center;
  331. justify-content: center;
  332. .tab-item {
  333. width: 160rpx;
  334. height: 56rpx;
  335. border-radius: 40rpx;
  336. border: 1px solid rgba(173, 181, 189, 0.5);
  337. color: #666;
  338. text-align: center;
  339. font-size: 28rpx;
  340. font-weight: 500;
  341. line-height: 56rpx;
  342. margin-right: 24rpx;
  343. }
  344. .tab-item-active {
  345. background: #0256ff;
  346. border: 1px solid #0256ff;
  347. color: #fff;
  348. }
  349. }
  350. .scroll-y {
  351. height: calc(75vh - 80rpx - 100rpx);
  352. padding: 0 24rpx;
  353. .crk-item {
  354. border-radius: 16rpx;
  355. background: #f6f8fa;
  356. padding: 24rpx;
  357. font-family: "PingFang SC";
  358. margin-bottom: 24rpx;
  359. position: relative;
  360. &-title {
  361. color: #000;
  362. font-size: 28rpx;
  363. font-weight: 500;
  364. margin-bottom: 16rpx;
  365. }
  366. &-line {
  367. color: #666;
  368. font-size: 28rpx;
  369. font-weight: 400;
  370. margin-bottom: 8rpx;
  371. }
  372. .img-box {
  373. position: absolute;
  374. top: 24rpx;
  375. right: 24rpx;
  376. image {
  377. width: 132rpx;
  378. height: 132rpx;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. </style>